hqchart 1.1.14276 → 1.1.14283

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hqchart",
3
- "version": "1.1.14276",
3
+ "version": "1.1.14283",
4
4
  "description": "HQChart - H5, 微信小程序 沪深/港股/数字货币/期货/美股 K线图(kline),走势图,缩放,拖拽,十字光标,画图工具,截图,筹码图. 分析家语法,通达信语法,(麦语法),第3方数据对接",
5
5
  "main": "lib/main.js",
6
6
  "scripts": {
@@ -57368,6 +57368,8 @@ HQData.Report_APIIndex=function(data, callback)
57368
57368
  HQData.APIIndex_MULTI_LINE(data, callback);
57369
57369
  else if (request.Data.indexname=="API-MULTI_SVGICON")
57370
57370
  HQData.APIIndex_MULTI_SVGICON(data, callback);
57371
+ else if (request.Data.indexname=="API-DRAWTEXT_LINE")
57372
+ HQData.APIIndex_DRAWTEXT_LINE(data, callback);
57371
57373
  }
57372
57374
 
57373
57375
 
@@ -57754,3 +57756,40 @@ HQData.APIIndex_MULTI_SVGICON=function(data, callback)
57754
57756
  }
57755
57757
 
57756
57758
 
57759
+ HQData.APIIndex_DRAWTEXT_LINE=function(data, callback)
57760
+ {
57761
+ data.PreventDefault=true;
57762
+ var hqchart=data.HQChart;
57763
+ var kData=hqchart.GetKData();
57764
+
57765
+ var lastItem=kData.Data[kData.Data.length-1];
57766
+ var price=(lastItem.High+lastItem.Low)/2;
57767
+
57768
+ var lineData=
57769
+ {
57770
+ name:'DRAWTEXT_LINE', type:1,
57771
+ Draw:
57772
+ {
57773
+ DrawType:'DRAWTEXT_LINE',
57774
+ DrawData:
57775
+ {
57776
+ Price:price,
57777
+ Text:{ Title:`价格:${price.toFixed(2)}`, Color:"rgb(255, 165, 0)" },
57778
+ Line:{ Type:1, Color:"rgb(200,200,0)" }, //Type 0=不画 1=直线 2=虚线
57779
+ }
57780
+ }
57781
+ };
57782
+
57783
+ var apiData=
57784
+ {
57785
+ code:0,
57786
+ stock:{ name:hqchart.Name, symbol:hqchart.Symbol },
57787
+ outdata: { date:kData.GetDate() , outvar:[lineData] }
57788
+ };
57789
+
57790
+
57791
+ console.log('[HQData.APIIndex_DRAWTEXT_LINE] apiData ', apiData);
57792
+ callback(apiData);
57793
+ }
57794
+
57795
+
@@ -21376,6 +21376,29 @@ function ScriptIndex(name,script,args,option)
21376
21376
  hqChart.ChartPaint.push(chart);
21377
21377
  }
21378
21378
 
21379
+ this.CreateSimpleTable=function(hqChart,windowIndex,varItem,id)
21380
+ {
21381
+ var chart=new ChartSimpleTable();
21382
+ chart.Canvas=hqChart.Canvas;
21383
+ chart.Name=varItem.Name;
21384
+ chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;
21385
+ chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;
21386
+
21387
+ if (varItem.Draw && varItem.Draw.DrawData)
21388
+ {
21389
+ var drawData=varItem.Draw.DrawData;
21390
+ if (drawData.TableData) chart.Data.Data=drawData.TableData;
21391
+ if (drawData.BGColor) chart.BGColor=drawData.BGColor;
21392
+ if (drawData.BorderColor) chart.BorderColor=drawData.BorderColor;
21393
+ if (drawData.TextFont) chart.TextFontConfig=drawData.TextFont;
21394
+ if (drawData.TextColor) chart.TextColor=drawData.TextColor;
21395
+ if (IFrameSplitOperator.IsNumber(drawData.XOffset)) chart.Offset.X=drawData.XOffset;
21396
+ if (IFrameSplitOperator.IsNumber(drawData.YOffset)) chart.Offset.Y=drawData.YOffset;
21397
+ }
21398
+
21399
+ hqChart.ChartPaint.push(chart);
21400
+ }
21401
+
21379
21402
  this.CreateTradeIcon=function(hqChart,windowIndex,varItem,id)
21380
21403
  {
21381
21404
  var chart=new ChartTradeIcon();
@@ -22241,6 +22264,9 @@ function ScriptIndex(name,script,args,option)
22241
22264
  case "MULTI_POINT_LINE":
22242
22265
  this.CreateLineMultiData(hqChart,windowIndex,item,i);
22243
22266
  break;
22267
+ case "DRAW_SIMPLE_TABLE":
22268
+ this.CreateSimpleTable(hqChart,windowIndex,item,i);
22269
+ break;
22244
22270
  case "BUY":
22245
22271
  case "SELL":
22246
22272
  case "SELLSHORT":
@@ -22588,6 +22614,10 @@ function OverlayScriptIndex(name,script,args,option)
22588
22614
  this.CreateMulitHtmlDom(hqChart,windowIndex,item,i);
22589
22615
  break;
22590
22616
 
22617
+ case "DRAW_SIMPLE_TABLE":
22618
+ this.CreateSimpleTable(hqChart,windowIndex,item,i);
22619
+ break;
22620
+
22591
22621
  case "KLINE_BG":
22592
22622
  this.CreateBackgroud(hqChart,windowIndex,item,i);
22593
22623
  break;
@@ -23597,6 +23627,33 @@ function OverlayScriptIndex(name,script,args,option)
23597
23627
  frame.ChartPaint.push(chart);
23598
23628
  }
23599
23629
 
23630
+ this.CreateSimpleTable=function(hqChart,windowIndex,varItem,i)
23631
+ {
23632
+ var overlayIndex=this.OverlayIndex;
23633
+ var frame=overlayIndex.Frame;
23634
+ var chart=new ChartSimpleTable();
23635
+ chart.Canvas=hqChart.Canvas;
23636
+ chart.Name=varItem.Name;
23637
+ chart.ChartBorder=frame.Frame.ChartBorder;
23638
+ chart.ChartFrame=frame.Frame;
23639
+ chart.Identify=overlayIndex.Identify;
23640
+ chart.HQChart=hqChart;
23641
+
23642
+ if (varItem.Draw && varItem.Draw.DrawData)
23643
+ {
23644
+ var drawData=varItem.Draw.DrawData;
23645
+ if (drawData.TableData) chart.Data.Data=drawData.TableData;
23646
+ if (drawData.BGColor) chart.BGColor=drawData.BGColor;
23647
+ if (drawData.BorderColor) chart.BorderColor=drawData.BorderColor;
23648
+ if (drawData.TextFont) chart.TextFontConfig=drawData.TextFont;
23649
+ if (drawData.TextColor) chart.TextColor=drawData.TextColor;
23650
+ if (IFrameSplitOperator.IsNumber(drawData.XOffset)) chart.Offset.X=drawData.XOffset;
23651
+ if (IFrameSplitOperator.IsNumber(drawData.YOffset)) chart.Offset.Y=drawData.YOffset;
23652
+ }
23653
+
23654
+ frame.ChartPaint.push(chart);
23655
+ }
23656
+
23600
23657
  this.CreateChartVericaltLine=function(hqChart,windowIndex,varItem,id)
23601
23658
  {
23602
23659
  var overlayIndex=this.OverlayIndex;
@@ -24775,6 +24832,30 @@ function APIScriptIndex(name,script,args,option, isOverlay)
24775
24832
 
24776
24833
  result.push(outVarItem);
24777
24834
  }
24835
+ else if (draw.DrawType=="DRAWTEXT_LINE")
24836
+ {
24837
+ drawItem.Name=draw.Name;
24838
+ drawItem.Type=draw.Type;
24839
+
24840
+ drawItem.DrawType=draw.DrawType;
24841
+ drawItem.DrawData=draw.DrawData; //{ Price:, Text:{ Title:text, Color:textcolor }, Line:{ Type:linetype, Color:linecolor } };
24842
+
24843
+ outVarItem.Draw=drawItem;
24844
+ if (draw.Font) outVarItem.Font=draw.Font;
24845
+
24846
+ result.push(outVarItem);
24847
+ }
24848
+ else if (draw.DrawType=="DRAW_SIMPLE_TABLE")
24849
+ {
24850
+ drawItem.Name=draw.Name;
24851
+ drawItem.Type=draw.Type;
24852
+
24853
+ drawItem.DrawType=draw.DrawType;
24854
+ drawItem.DrawData=draw.DrawData; //{ TableData:[ [ {AryCell:[{Text:, Color: }]}, ], ], BGColor:, TextFont:{ Size:, Name: } };
24855
+
24856
+ outVarItem.Draw=drawItem;
24857
+ result.push(outVarItem);
24858
+ }
24778
24859
  else
24779
24860
  {
24780
24861
  var find=g_ScriptIndexChartFactory.Get(draw.DrawType); //外部挂接
@@ -31501,6 +31501,225 @@ function ChartKLineTable()
31501
31501
  }
31502
31502
  }
31503
31503
 
31504
+ //表格
31505
+ function ChartSimpleTable()
31506
+ {
31507
+ this.newMethod=IChartPainting; //派生
31508
+ this.newMethod();
31509
+ delete this.newMethod;
31510
+
31511
+ this.ClassName='ChartSimpleTable'; //类名
31512
+ //this.Data;
31513
+
31514
+ this.TextFontConfig=CloneData(g_JSChartResource.ChartSimpleTable.TextFont);
31515
+ this.ItemMargin=CloneData(g_JSChartResource.ChartSimpleTable.ItemMargin);
31516
+ this.TextColor=g_JSChartResource.ChartSimpleTable.TextColor; //默认颜色
31517
+ this.BGColor=g_JSChartResource.ChartSimpleTable.BGColor; //背景色
31518
+ this.BorderColor=g_JSChartResource.ChartSimpleTable.BorderColor; //边框颜色
31519
+ this.Offset={ X:-3, Y:0 }, //位置偏移
31520
+
31521
+
31522
+ this.DefaultCellWidth=30;
31523
+
31524
+ this.RectClient={ };
31525
+ this.AryColumnCache=[]; //列缓存
31526
+ this.TextFontHeight;
31527
+ this.TextFont;
31528
+ this.RowHeight; //行高
31529
+
31530
+ this.ReloadResource=function(resource)
31531
+ {
31532
+ this.TextFontConfig=CloneData(g_JSChartResource.ChartSimpleTable.TextFont);
31533
+ this.ItemMargin=CloneData(g_JSChartResource.ChartSimpleTable.ItemMargin);
31534
+ this.TextColor=g_JSChartResource.ChartSimpleTable.TextColor; //默认颜色
31535
+ this.BGColor=g_JSChartResource.ChartSimpleTable.BGColor; //背景色
31536
+ this.BorderColor=g_JSChartResource.ChartSimpleTable.BorderColor; //边框颜色
31537
+ }
31538
+
31539
+ this.CalculateSize=function()
31540
+ {
31541
+ this.AryColumnCache=[];
31542
+
31543
+ var pixelRatio=GetDevicePixelRatio();
31544
+ this.TextFont=`${this.TextFontConfig.Size*pixelRatio}px ${ this.TextFontConfig.Name}`;
31545
+ this.TextFontHeight=this.GetFontHeight(this.TextFont,"擎");
31546
+ this.RowHeight=this.TextFontHeight+this.ItemMargin.Top+this.ItemMargin.Bottom;
31547
+
31548
+ var rowCount=this.Data.Data.length;
31549
+ for(var i=0, j=0;i<rowCount;++i)
31550
+ {
31551
+ var rowItem=this.Data.Data[i];
31552
+ for(j=0;j<rowItem.AryCell.length;++j)
31553
+ {
31554
+ if (!this.AryColumnCache[j]) this.AryColumnCache[j]={ Width:this.DefaultCellWidth };
31555
+ var colItem=this.AryColumnCache[j];
31556
+
31557
+ var cellItem=rowItem.AryCell[j];
31558
+ var textWidth=this.Canvas.measureText(cellItem.Text).width;
31559
+ if (colItem.Width<textWidth) colItem.Width=textWidth;
31560
+ }
31561
+ }
31562
+
31563
+ var tableWidth=0;
31564
+ for(var i=0;i<this.AryColumnCache.length;++i)
31565
+ {
31566
+ var item=this.AryColumnCache[i];
31567
+ item.Width+=(this.ItemMargin.Left+this.ItemMargin.Right); //增加左右间距
31568
+
31569
+ tableWidth+=item.Width;
31570
+ }
31571
+
31572
+ this.RectClient={ Width:tableWidth, Height:this.RowHeight*rowCount };
31573
+
31574
+ var border=this.ChartFrame.GetBorder();
31575
+ this.RectClient.Right=border.Right+this.Offset.X;
31576
+ this.RectClient.Top=border.TopEx+this.Offset.Y;
31577
+ this.RectClient.Left=this.RectClient.Right-this.RectClient.Width;
31578
+ this.RectClient.Bottom=this.RectClient.Top+this.RectClient.Height;
31579
+ }
31580
+
31581
+ this.Draw=function()
31582
+ {
31583
+ if (!this.IsShow || this.ChartFrame.IsMinSize) return;
31584
+ if (!this.Data || !IFrameSplitOperator.IsNonEmptyArray(this.Data.Data)) return;
31585
+
31586
+ var isHScreen=(this.ChartFrame.IsHScreen===true);
31587
+ if (isHScreen) return;
31588
+
31589
+ this.CalculateSize();
31590
+
31591
+ if (this.BGColor)
31592
+ {
31593
+ this.Canvas.fillStyle=this.BGColor;
31594
+ this.Canvas.fillRect(this.RectClient.Left, this.RectClient.Top, this.RectClient.Width, this.RectClient.Height);
31595
+ }
31596
+
31597
+ var itemHeight=this.RowHeight;
31598
+ this.Canvas.font=this.TextFont;
31599
+ this.Canvas.textBaseline='bottom';
31600
+ this.Canvas.textAlign='left';
31601
+ var rtRow={ Left:this.RectClient.Left, Top:this.RectClient.Top, Width:this.RectClient.Width, Height:itemHeight };
31602
+ rtRow.Right=rtRow.Left+rtRow.Width;
31603
+ rtRow.Bottom=rtRow.Top+rtRow.Height;
31604
+ var rowCount=this.Data.Data.length;
31605
+ for(var i=0;i<rowCount;++i)
31606
+ {
31607
+ var rowItem=this.Data.Data[i];
31608
+ this.DrawRow(rowItem, rtRow);
31609
+
31610
+ rtRow.Top+=itemHeight;
31611
+ rtRow.Bottom+=itemHeight;
31612
+ }
31613
+
31614
+ this.DrawBorder();
31615
+ }
31616
+
31617
+ this.DrawBorder=function()
31618
+ {
31619
+ if (!this.BorderColor) return;
31620
+
31621
+ var rowCount=this.Data.Data.length;
31622
+ var colCount=this.AryColumnCache.length;
31623
+ this.Canvas.strokeStyle=this.BorderColor;
31624
+ this.Canvas.beginPath();
31625
+
31626
+ //横线
31627
+ var rowTop=this.RectClient.Top;
31628
+ var left=this.RectClient.Left, right=this.RectClient.Right;
31629
+ var bottom=this.RectClient.Bottom, top=this.RectClient.Top;
31630
+ for(var i=0;i<rowCount;++i)
31631
+ {
31632
+ if (i==0)
31633
+ {
31634
+ var drawTop=ToFixedPoint(rowTop);
31635
+ this.Canvas.moveTo(left,drawTop);
31636
+ this.Canvas.lineTo(right,drawTop);
31637
+ }
31638
+
31639
+ var drawTop=ToFixedPoint(rowTop+this.RowHeight);
31640
+ this.Canvas.moveTo(left,drawTop);
31641
+ this.Canvas.lineTo(right,drawTop);
31642
+
31643
+ rowTop+=this.RowHeight;
31644
+ }
31645
+
31646
+ //竖线
31647
+ var columnLeft=this.RectClient.Left;
31648
+ for(var i=0;i<colCount; ++i)
31649
+ {
31650
+ var item=this.AryColumnCache[i];
31651
+
31652
+ if (i==0)
31653
+ {
31654
+ var drawLeft=ToFixedPoint(columnLeft);
31655
+ this.Canvas.moveTo(drawLeft,top);
31656
+ this.Canvas.lineTo(drawLeft,bottom);
31657
+ }
31658
+
31659
+ var drawLeft=ToFixedPoint(columnLeft+item.Width);
31660
+ this.Canvas.moveTo(drawLeft,top);
31661
+ this.Canvas.lineTo(drawLeft,bottom);
31662
+
31663
+ columnLeft+=item.Width;
31664
+ }
31665
+
31666
+ this.Canvas.stroke();
31667
+ }
31668
+
31669
+ this.DrawRow=function(data, rtRow)
31670
+ {
31671
+ if (!IFrameSplitOperator.IsNonEmptyArray(data.AryCell)) return;
31672
+
31673
+ var x=rtRow.Left,y=rtRow.Top, width=rtRow.Width;
31674
+ for(var i=0;i<data.AryCell.length;++i)
31675
+ {
31676
+ var item=data.AryCell[i];
31677
+ var colItem=this.AryColumnCache[i];
31678
+
31679
+ var rtBG={Left:x, Top:rtRow.Top, Bottom:rtRow.Bottom, Height:this.RowHeight, Width:colItem.Width };
31680
+ rtBG.Right=rtBG.Top+rtBG.Height;
31681
+
31682
+ if (item)
31683
+ {
31684
+ if (item.BGColor)
31685
+ {
31686
+ this.Canvas.fillStyle=item.BGColor;
31687
+ this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
31688
+ }
31689
+
31690
+ if (item.Text && rtBG.Width>10)
31691
+ {
31692
+ if (item.Color) this.Canvas.fillStyle=item.Color;
31693
+ else this.Canvas.fillStyle=this.TextColor
31694
+
31695
+ var xText=x+this.ItemMargin.Left;
31696
+ var yText=rtBG.Bottom-this.ItemMargin.Bottom;
31697
+
31698
+ if (item.TextAlign=='right')
31699
+ {
31700
+ var textWidth=this.Canvas.measureText(item.Text).width;
31701
+ xText=rtBG.Right-this.ItemMargin.Right-textWidth;
31702
+ }
31703
+ else if (item.TextAlign=='center')
31704
+ {
31705
+ var textWidth=this.Canvas.measureText(item.Text).width;
31706
+ xText=rtBG.Left+rtBG.Width/2-textWidth/2;
31707
+ }
31708
+
31709
+ this.Canvas.fillText(item.Text,xText,yText);
31710
+ }
31711
+ }
31712
+
31713
+ x+=rtBG.Width;
31714
+ }
31715
+ }
31716
+
31717
+ this.GetMaxMin=function()
31718
+ {
31719
+ return { Min:null, Max:null };
31720
+ }
31721
+ }
31722
+
31504
31723
  //分钟成交量 支持横屏
31505
31724
  function ChartMinuteVolumBar()
31506
31725
  {
@@ -70097,6 +70316,15 @@ function JSChartResource()
70097
70316
  ItemMergin:{ Left:5, Right:5, Top:4, Bottom:2 },
70098
70317
  };
70099
70318
 
70319
+ this.ChartSimpleTable=
70320
+ {
70321
+ TextFont:{ Family:'微软雅黑' , Size:14 },
70322
+ ItemMargin:{ Left:5, Right:5, Top:4, Bottom:2 },
70323
+ TextColor:"rgb(0,0,0)",
70324
+ BGColor:"rgba(255,255,255,0.95)",
70325
+ BorderColor:"rgb(217,217,217)",
70326
+ }
70327
+
70100
70328
  //手机端tooltip
70101
70329
  this.TooltipPaint = {
70102
70330
  BGColor:'rgba(250,250,250,0.8)', //背景色
@@ -71325,6 +71553,8 @@ function JSChartResource()
71325
71553
  if (style.Title.PositionColor) this.Title.PositionColor=style.Title.PositionColor;
71326
71554
  }
71327
71555
 
71556
+ if (style.ChartSimpleTable) this.SetChartSimpleTable(style.ChartSimpleTable);
71557
+
71328
71558
  if (style.DRAWICON)
71329
71559
  {
71330
71560
  if (style.DRAWICON.Icon)
@@ -71584,7 +71814,7 @@ function JSChartResource()
71584
71814
  {
71585
71815
  var mergin=header.Mergin;
71586
71816
  if (IFrameSplitOperator.IsNumber(mergin.Left)) this.DealList.Header.Mergin.Left=mergin.Left;
71587
- if (IFrameSplitOperator.IsNumber(mergin.Right)) this.DealList.Header.Mergin.Left=mergin.Right;
71817
+ if (IFrameSplitOperator.IsNumber(mergin.Right)) this.DealList.Header.Mergin.Right=mergin.Right;
71588
71818
  if (IFrameSplitOperator.IsNumber(mergin.Top)) this.DealList.Header.Mergin.Top=mergin.Top;
71589
71819
  if (IFrameSplitOperator.IsNumber(mergin.Bottom)) this.DealList.Header.Mergin.Bottom=mergin.Bottom;
71590
71820
  }
@@ -72370,6 +72600,32 @@ function JSChartResource()
72370
72600
  if (IFrameSplitOperator.IsBool(style.AddIndexWindow)) dest.AddIndexWindow=style.AddIndexWindow;
72371
72601
  }
72372
72602
 
72603
+
72604
+ this.SetChartSimpleTable=function(style)
72605
+ {
72606
+ var dest=this.ChartSimpleTable;
72607
+
72608
+ if (style.TextColor) dest.TextColor=style.TextColor;
72609
+ if (style.BGColor) dest.BGColor=style.BGColor;
72610
+ if (style.BorderColor) dest.BorderColor=style.BorderColor;
72611
+
72612
+ if (style.TextFont)
72613
+ {
72614
+ var item=style.TextFont;
72615
+ if (item.Name) dest.TextFont.Name=item.Name;
72616
+ if (IFrameSplitOperator.IsNumber(item.Size)) dest.TextFont.Size=item.Size;
72617
+ }
72618
+
72619
+ if (style.ItemMargin)
72620
+ {
72621
+ var margin=style.ItemMargin;
72622
+ if (IFrameSplitOperator.IsNumber(margin.Left)) dest.ItemMargin.Left=margin.Left;
72623
+ if (IFrameSplitOperator.IsNumber(margin.Right)) dest.ItemMargin.Right=margin.Right;
72624
+ if (IFrameSplitOperator.IsNumber(margin.Top)) dest.ItemMargin.Top=margin.Top;
72625
+ if (IFrameSplitOperator.IsNumber(margin.Bottom)) dest.ItemMargin.Bottom=margin.Bottom;
72626
+ }
72627
+ }
72628
+
72373
72629
  }
72374
72630
 
72375
72631
  var g_JSChartResource=new JSChartResource();
@@ -4383,6 +4383,8 @@ var REPORT_COLUMN_ID=
4383
4383
  CUSTOM_PROGRESS_ID:106, //进度条
4384
4384
  CUSTOM_LINK_ID:107, //链接
4385
4385
 
4386
+ MULTI_LINE_CONTAINER:108, //多行组合输出
4387
+
4386
4388
 
4387
4389
  //预留数值类型 10个
4388
4390
  RESERVE_NUMBER1_ID:201, //ReserveNumber1:
@@ -4944,6 +4946,10 @@ function ChartReport()
4944
4946
  {
4945
4947
  if (IFrameSplitOperator.IsNumber(item.FormatType)) colItem.FormatType=item.FormatType;
4946
4948
  }
4949
+ else if (item.Type==REPORT_COLUMN_ID.MULTI_LINE_CONTAINER)
4950
+ {
4951
+ if (IFrameSplitOperator.IsNonEmptyArray(item.AryField)) colItem.AryField=item.AryField.slice();
4952
+ }
4947
4953
 
4948
4954
  return colItem;
4949
4955
  }
@@ -5096,6 +5102,12 @@ function ChartReport()
5096
5102
  { Type:REPORT_COLUMN_ID.RISING_SPEED_10M_ID, Title:"10分涨速%", TextAlign:"right", Width:null, MaxText:"-888.88" },
5097
5103
  { Type:REPORT_COLUMN_ID.RISING_SPEED_15M_ID, Title:"15分涨速%", TextAlign:"right", Width:null, MaxText:"-888.88" },
5098
5104
 
5105
+ //组合多行字段
5106
+ {
5107
+ Type:REPORT_COLUMN_ID.MULTI_LINE_CONTAINER, Title:"涨幅",TextAlign:"right", MaxText:"1000.00%",
5108
+ AryField:[ { Type:REPORT_COLUMN_ID.PRICE_ID},{ Type:REPORT_COLUMN_ID.INCREASE_ID, DynamicFormat:"{Value}%"} ]
5109
+ },
5110
+
5099
5111
  { Type:REPORT_COLUMN_ID.RESERVE_NUMBER1_ID, Title:"数值1", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"9999.99", FloatPrecision:2 },
5100
5112
  { Type:REPORT_COLUMN_ID.RESERVE_NUMBER2_ID, Title:"数值2", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"9999.99", FloatPrecision:2 },
5101
5113
  { Type:REPORT_COLUMN_ID.RESERVE_NUMBER3_ID, Title:"数值3", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"9999.99", FloatPrecision:2 },
@@ -5307,6 +5319,17 @@ function ChartReport()
5307
5319
  if (rowHeight>this.RowHeight) this.RowHeight=rowHeight;
5308
5320
  if (rowHeight>this.FixedRowHeight) this.FixedRowHeight=rowHeight;
5309
5321
  }
5322
+ else if (item.Type==REPORT_COLUMN_ID.MULTI_LINE_CONTAINER)
5323
+ {
5324
+ if (IFrameSplitOperator.IsNumber(item.FixedWidth)) itemWidth=item.FixedWidth;
5325
+ else itemWidth=this.Canvas.measureText(item.MaxText).width;
5326
+
5327
+ item.Width=itemWidth+4+this.ItemMergin.Left+this.ItemMergin.Right;
5328
+ this.ItemTextLines=item.AryField.length;
5329
+ var rowHeight=(this.ItemFontHeight*item.AryField.length)+this.ItemMergin.Top+ this.ItemMergin.Bottom;
5330
+ if (rowHeight>this.RowHeight) this.RowHeight=rowHeight;
5331
+ if (rowHeight>this.FixedRowHeight) this.FixedRowHeight=rowHeight;
5332
+ }
5310
5333
  else if (item.Type==REPORT_COLUMN_ID.SYMBOL_NAME_V2_ID) //单行显示
5311
5334
  {
5312
5335
  this.Canvas.font==this.NameSymbolFont.Name;
@@ -5900,6 +5923,87 @@ function ChartReport()
5900
5923
  }
5901
5924
  }
5902
5925
 
5926
+ this.BuildSubCellTextData=function(subItem, column, stock, drawInfo, data, option)
5927
+ {
5928
+ switch(subItem.Type)
5929
+ {
5930
+ case REPORT_COLUMN_ID.NAME_ID:
5931
+ if (stock && stock.Name) drawInfo.Text=stock.Name;
5932
+ else drawInfo.Text=data.Name;
5933
+ break;
5934
+ case REPORT_COLUMN_ID.SYMBOL_ID:
5935
+ if (stock && stock.Symbol) drawInfo.Text=stock.Symbol;
5936
+ else drawInfo.Text=data.Symbol;
5937
+ break;
5938
+
5939
+ case REPORT_COLUMN_ID.PRICE_ID:
5940
+ case REPORT_COLUMN_ID.OPEN_ID:
5941
+ case REPORT_COLUMN_ID.HIGH_ID:
5942
+ case REPORT_COLUMN_ID.LOW_ID:
5943
+ case REPORT_COLUMN_ID.YCLOSE_ID:
5944
+ case REPORT_COLUMN_ID.BUY_PRICE_ID:
5945
+ case REPORT_COLUMN_ID.SELL_PRICE_ID:
5946
+ case REPORT_COLUMN_ID.AVERAGE_PRICE_ID:
5947
+ case REPORT_COLUMN_ID.FUTURES_CLOSE_ID:
5948
+ case REPORT_COLUMN_ID.FUTURES_YCLOSE_ID:
5949
+ var fieldName=MAP_COLUMN_FIELD.get(subItem.Type);
5950
+ if (stock && IFrameSplitOperator.IsNumber(stock[fieldName])) this.GetPriceDrawInfo(stock[fieldName], stock, data, drawInfo, option);
5951
+ break;
5952
+
5953
+ case REPORT_COLUMN_ID.INCREASE_ID:
5954
+ case REPORT_COLUMN_ID.AMPLITUDE_ID:
5955
+ case REPORT_COLUMN_ID.UPDOWN_ID:
5956
+ case REPORT_COLUMN_ID.RISING_SPEED_1M_ID:
5957
+ case REPORT_COLUMN_ID.RISING_SPEED_3M_ID:
5958
+ case REPORT_COLUMN_ID.RISING_SPEED_5M_ID:
5959
+ case REPORT_COLUMN_ID.RISING_SPEED_10M_ID:
5960
+ case REPORT_COLUMN_ID.RISING_SPEED_15M_ID:
5961
+ var fieldName=MAP_COLUMN_FIELD.get(subItem.Type);
5962
+ if (stock && IFrameSplitOperator.IsNumber(stock[fieldName]))
5963
+ {
5964
+ var value=stock[fieldName];
5965
+ var text=value.toFixed(2);
5966
+ if (subItem.DynamicFormat)
5967
+ text=subItem.DynamicFormat.replace('{Value}',text);
5968
+
5969
+ drawInfo.Text=text
5970
+ drawInfo.TextColor=this.GetUpDownColor(value,0);
5971
+ }
5972
+ break;
5973
+ }
5974
+ }
5975
+
5976
+ this.DrawSubCellText=function(drawInfo, column, rtText)
5977
+ {
5978
+ if (!drawInfo.Text) return;
5979
+
5980
+ var text=drawInfo.Text;
5981
+ var x=rtText.Left;
5982
+ if (drawInfo.TextAlign=='center')
5983
+ {
5984
+ x=rtText.Left+rtText.Width/2;
5985
+ this.Canvas.textAlign="center";
5986
+ }
5987
+ else if (drawInfo.TextAlign=='right')
5988
+ {
5989
+ x=rtText.Left+rtText.Width-2;
5990
+ this.Canvas.textAlign="right";
5991
+ }
5992
+ else
5993
+ {
5994
+ x+=2;
5995
+ this.Canvas.textAlign="left";
5996
+ }
5997
+
5998
+ var bClip=false;
5999
+
6000
+ this.Canvas.textBaseline="bottom";
6001
+ this.Canvas.fillStyle=drawInfo.TextColor;
6002
+ this.Canvas.fillText(text,x,rtText.Bottom);
6003
+
6004
+ if (bClip) this.Canvas.restore();
6005
+ }
6006
+
5903
6007
  this.DrawItem=function(index, data, column, left, top, rowType, columnIndex)
5904
6008
  {
5905
6009
  var itemWidth=column.Width;
@@ -6225,6 +6329,26 @@ function ChartReport()
6225
6329
  {
6226
6330
  this.FormatReserveButton(column, stock, drawInfo);
6227
6331
  }
6332
+ else if (column.Type==REPORT_COLUMN_ID.MULTI_LINE_CONTAINER)
6333
+ {
6334
+ if (IFrameSplitOperator.IsNonEmptyArray(column.AryField))
6335
+ {
6336
+ var yBottom=rtItem.Bottom-this.ItemMergin.Bottom-(column.AryField.length-1)*this.ItemFontHeight;
6337
+ var rtText={ Left:left+this.ItemMergin.Left, Width:textWidth, Height:this.ItemFontHeight, Bottom:yBottom };
6338
+ rtText.Right=rtText.Left+rtText.Width;
6339
+ rtText.Top=rtText.Bottom-rtText.Height;
6340
+ for(var k=0;k<column.AryField.length;++k)
6341
+ {
6342
+ drawInfo.Text=null;
6343
+ var subItem=column.AryField[k];
6344
+ this.BuildSubCellTextData(subItem, column, stock, drawInfo, data);
6345
+ this.DrawSubCellText(drawInfo, column, rtText);
6346
+
6347
+ rtText.Bottom+=this.ItemFontHeight;
6348
+ rtText.Top+=this.ItemFontHeight;
6349
+ }
6350
+ }
6351
+ }
6228
6352
 
6229
6353
 
6230
6354
  //拖拽行颜色
@@ -6254,6 +6378,10 @@ function ChartReport()
6254
6378
  else if (column.Type==REPORT_COLUMN_ID.CUSTOM_LINK_ID)
6255
6379
  {
6256
6380
  this.DrawLinkText(drawInfo, x, top, textWidth);
6381
+ }
6382
+ else if (column.Type==REPORT_COLUMN_ID.MULTI_LINE_CONTAINER)
6383
+ {
6384
+
6257
6385
  }
6258
6386
  else
6259
6387
  {
@@ -534,6 +534,13 @@ function GetBlackStyle()
534
534
  }
535
535
  },
536
536
 
537
+ ChartSimpleTable:
538
+ {
539
+ TextColor:"rgb(250,250,250)",
540
+ BGColor:"rgba(0,0,0,0.85)",
541
+ BorderColor:"rgb(90,90,90)",
542
+ },
543
+
537
544
  ChartDrawVolProfile:
538
545
  {
539
546
  BGColor:"rgba(244,250,254,0.3)",