hqchart 1.1.14349 → 1.1.14363

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.
@@ -73,10 +73,8 @@ function JSTReportChart(divElement)
73
73
 
74
74
  if (option.EnableResize==true) this.CreateResizeListener();
75
75
 
76
- if (option.MinuteChartTooltip && option.MinuteChartTooltip.Enable)
77
- {
78
- chart.InitalMinuteChartTooltip(option.MinuteChartTooltip);
79
- }
76
+ if (option.MinuteChartTooltip && option.MinuteChartTooltip.Enable) chart.InitalMinuteChartTooltip(option.MinuteChartTooltip); //分时图
77
+ if (option.FloatTooltip && option.FloatTooltip.Enable) chart.InitalFloatTooltip(option.FloatTooltip); //提示信息
80
78
 
81
79
  if (option.Symbol)
82
80
  {
@@ -330,6 +328,7 @@ function JSTReportChartContainer(uielement)
330
328
  this.EnablePageCycle=false; //是否循环翻页
331
329
 
332
330
  this.TooltipMinuteChart; //分时图
331
+ this.FloatTooltip; //浮框提示
333
332
  this.LastMouseStatus={ MoveStatus:null, TooltipStatus:null, MouseOnStatus:null };
334
333
 
335
334
  this.IsDestroy=false; //是否已经销毁了
@@ -339,6 +338,7 @@ function JSTReportChartContainer(uielement)
339
338
  this.IsDestroy=true;
340
339
  this.StopAutoUpdate();
341
340
  this.DestroyMinuteChartTooltip();
341
+ this.DestroyFloatTooltip();
342
342
  }
343
343
 
344
344
  this.InitalMinuteChartTooltip=function(option)
@@ -381,6 +381,51 @@ function JSTReportChartContainer(uielement)
381
381
  this.TooltipMinuteChart.Hide();
382
382
  }
383
383
 
384
+ this.InitalFloatTooltip=function(option)
385
+ {
386
+ if (this.FloatTooltip) return;
387
+
388
+ this.FloatTooltip=new JSFloatTooltip();
389
+ this.FloatTooltip.Inital(this, option);
390
+ this.FloatTooltip.Create();
391
+ }
392
+
393
+ this.HideFloatTooltip=function()
394
+ {
395
+ if (!this.FloatTooltip) return;
396
+
397
+ this.FloatTooltip.Hide();
398
+ }
399
+
400
+ this.DestroyFloatTooltip=function()
401
+ {
402
+ if (!this.FloatTooltip) return;
403
+
404
+ this.FloatTooltip.Destroy();
405
+ this.FloatTooltip=null;
406
+ }
407
+
408
+ this.DrawFloatTooltip=function(point,toolTip)
409
+ {
410
+ if (!this.FloatTooltip) return;
411
+
412
+ this.UpdateFloatTooltip(point, toolTip)
413
+ }
414
+
415
+ this.UpdateFloatTooltip=function(point, toolTip)
416
+ {
417
+ if (!this.FloatTooltip) return;
418
+
419
+ var sendData=
420
+ {
421
+ Tooltip:toolTip,
422
+ Point:point,
423
+ DataType:4,
424
+ };
425
+
426
+ this.FloatTooltip.Update(sendData);
427
+ }
428
+
384
429
  //清空固定行数据
385
430
  this.ClearFixedRowData=function()
386
431
  {
@@ -1060,8 +1105,7 @@ function JSTReportChartContainer(uielement)
1060
1105
  var oldMouseOnStatus=this.LastMouseStatus.MouseOnStatus;
1061
1106
  this.LastMouseStatus.OnMouseMove=null;
1062
1107
 
1063
- var bDrawTooltip=false;
1064
- if (this.LastMouseStatus.TooltipStatus) bDrawTooltip=true;
1108
+ var bShowTooltip=false;
1065
1109
  this.LastMouseStatus.TooltipStatus=null;
1066
1110
 
1067
1111
  var bShowChartTooltip=false;
@@ -1088,7 +1132,7 @@ function JSTReportChartContainer(uielement)
1088
1132
  else
1089
1133
  {
1090
1134
  this.LastMouseStatus.TooltipStatus={ X:x, Y:y, Data:tooltipData, ClientX:e.clientX, ClientY:e.clientY };
1091
- bDrawTooltip=true;
1135
+ bShowTooltip=true;
1092
1136
  }
1093
1137
  }
1094
1138
 
@@ -1104,7 +1148,6 @@ function JSTReportChartContainer(uielement)
1104
1148
  */
1105
1149
 
1106
1150
  if (mouseStatus) this.UIElement.style.cursor=mouseStatus.Cursor;
1107
- //if (bDrawTooltip) this.DrawTooltip(this.LastMouseStatus.TooltipStatus);
1108
1151
 
1109
1152
  if (bShowChartTooltip)
1110
1153
  {
@@ -1114,6 +1157,17 @@ function JSTReportChartContainer(uielement)
1114
1157
  {
1115
1158
  this.HideMinuteChartTooltip();
1116
1159
  }
1160
+
1161
+ if (bShowTooltip)
1162
+ {
1163
+ var xTooltip = e.clientX-this.UIElement.getBoundingClientRect().left;
1164
+ var yTooltip = e.clientY-this.UIElement.getBoundingClientRect().top;
1165
+ this.DrawFloatTooltip({X:xTooltip, Y:yTooltip, YMove:20/pixelTatio},this.LastMouseStatus.TooltipStatus.Data);
1166
+ }
1167
+ else
1168
+ {
1169
+ this.HideFloatTooltip();
1170
+ }
1117
1171
  }
1118
1172
 
1119
1173
  this.UIOnMounseOut=function(e)
@@ -1343,6 +1397,7 @@ function JSTReportChartContainer(uielement)
1343
1397
  {
1344
1398
  this.LastMouseStatus.TooltipStatus=null;
1345
1399
  this.HideMinuteChartTooltip();
1400
+ this.HideFloatTooltip();
1346
1401
  var result=this.MoveSelectedRow(1,{ EnablePageCycle:this.EnablePageCycle })
1347
1402
  if (result)
1348
1403
  {
@@ -1354,6 +1409,7 @@ function JSTReportChartContainer(uielement)
1354
1409
  {
1355
1410
  this.LastMouseStatus.TooltipStatus=null;
1356
1411
  this.HideMinuteChartTooltip();
1412
+ this.HideFloatTooltip();
1357
1413
  var result=this.MoveSelectedRow(-1,{ EnablePageCycle:this.EnablePageCycle} );
1358
1414
  if (result)
1359
1415
  {
@@ -1376,6 +1432,7 @@ function JSTReportChartContainer(uielement)
1376
1432
  if (keyID==116) return; //F15刷新不处理
1377
1433
 
1378
1434
  this.HideMinuteChartTooltip();
1435
+ this.HideFloatTooltip();
1379
1436
 
1380
1437
  switch(keyID)
1381
1438
  {
@@ -2496,11 +2553,11 @@ function ChartTReport()
2496
2553
  if (leftData.TitleColor) drawInfo.TextColor=leftData.TitleColor;
2497
2554
  if (leftData.Text && leftData.TextColor)
2498
2555
  {
2499
- drawInfo.Left={ Text:leftData.Text, TextColor:leftData.TextColor};
2556
+ drawInfo.Left={ Text:leftData.Text, TextColor:leftData.TextColor, Tooltip:leftData.Tooltip};
2500
2557
  }
2501
2558
  else if (leftData.IconFont && leftData.TextColor)
2502
2559
  {
2503
- drawInfo.Left={ IconFont:leftData.IconFont, TextColor:leftData.TextColor};
2560
+ drawInfo.Left={ IconFont:leftData.IconFont, TextColor:leftData.TextColor, Tooltip:leftData.Tooltip};
2504
2561
  }
2505
2562
 
2506
2563
  }
@@ -2512,11 +2569,11 @@ function ChartTReport()
2512
2569
 
2513
2570
  if (rightData.Text && rightData.TextColor)
2514
2571
  {
2515
- drawInfo.Right={ Text:rightData.Text, TextColor:rightData.TextColor};
2572
+ drawInfo.Right={ Text:rightData.Text, TextColor:rightData.TextColor, Tooltip:rightData.Tooltip};
2516
2573
  }
2517
2574
  else if (rightData.IconFont && rightData.TextColor)
2518
2575
  {
2519
- drawInfo.Right={ IconFont:rightData.IconFont, TextColor:rightData.TextColor};
2576
+ drawInfo.Right={ IconFont:rightData.IconFont, TextColor:rightData.TextColor, Tooltip:rightData.Tooltip};
2520
2577
  }
2521
2578
  }
2522
2579
  }
@@ -2547,9 +2604,21 @@ function ChartTReport()
2547
2604
 
2548
2605
  this.FormatCenterItem(data,drawInfo);
2549
2606
 
2550
-
2551
-
2552
2607
  this.DrawCell(drawInfo);
2608
+
2609
+ if (drawInfo.LeftIconTooltip)
2610
+ {
2611
+ var tooltipItem=drawInfo.LeftIconTooltip;
2612
+ var tooltipData={ Rect:tooltipItem.Rect, Data:tooltipItem.Data, Index:index, Column:column, CellType:cellType, Type:2 };
2613
+ this.TooltipRect.push(tooltipData);
2614
+ }
2615
+
2616
+ if (drawInfo.RightIconTooltip)
2617
+ {
2618
+ var tooltipItem=drawInfo.RightIconTooltip;
2619
+ var tooltipData={ Rect:tooltipItem.Rect, Data:tooltipItem.Data, Index:index, Column:column, CellType:cellType, Type:3 };
2620
+ this.TooltipRect.push(tooltipData);
2621
+ }
2553
2622
  }
2554
2623
 
2555
2624
  this.DrawItem=function(index, exePriceData, data, column, rtItem, cellType)
@@ -2818,7 +2887,7 @@ function ChartTReport()
2818
2887
  this.DrawText(drawInfo.Text, drawInfo.TextAlign, rtText.Left, yCenter, rtText.Width);
2819
2888
  }
2820
2889
 
2821
- if (drawInfo.Left)
2890
+ if (drawInfo.Left) //左边图标
2822
2891
  {
2823
2892
  var item=drawInfo.Left;
2824
2893
  this.Canvas.textAlign="left";
@@ -2829,6 +2898,13 @@ function ChartTReport()
2829
2898
  if (!fontBackup) fontBackup=this.Canvas.font;
2830
2899
  this.Canvas.font=item.IconFont.Font;
2831
2900
  this.Canvas.fillText(item.IconFont.Symbol,rtText.Left,yCenter);
2901
+ if (item.Tooltip)
2902
+ {
2903
+ var iconWidth=this.Canvas.measureText(item.IconFont.Symbol).width;
2904
+ var rtIcon={ Left:rtText.Left, Top:rtText.Top, Bottom:rtText.Bottom, Height:rtText.Height, Width:iconWidth };
2905
+ rtIcon.Right=rtIcon.Left+rtIcon.Width;
2906
+ drawInfo.LeftIconTooltip={ Rect:rtIcon, Data:item.Tooltip };
2907
+ }
2832
2908
  }
2833
2909
  else if (item.Text)
2834
2910
  {
@@ -2836,7 +2912,7 @@ function ChartTReport()
2836
2912
  }
2837
2913
  }
2838
2914
 
2839
- if (drawInfo.Right)
2915
+ if (drawInfo.Right) //右边图标
2840
2916
  {
2841
2917
  var item=drawInfo.Right;
2842
2918
  this.Canvas.textAlign="right";
@@ -2847,6 +2923,14 @@ function ChartTReport()
2847
2923
  if (!fontBackup) fontBackup=this.Canvas.font;
2848
2924
  this.Canvas.font=item.IconFont.Font;
2849
2925
  this.Canvas.fillText(item.IconFont.Symbol,rtText.Right,yCenter);
2926
+
2927
+ if (item.Tooltip)
2928
+ {
2929
+ var iconWidth=this.Canvas.measureText(item.IconFont.Symbol).width;
2930
+ var rtIcon={ Right:rtText.Right, Top:rtText.Top, Bottom:rtText.Bottom, Height:rtText.Height, Width:iconWidth };
2931
+ rtIcon.Left=rtIcon.Right-rtIcon.Width;
2932
+ drawInfo.RightIconTooltip={ Rect:rtIcon, Data:item.Tooltip };
2933
+ }
2850
2934
  }
2851
2935
  else if (item.Text)
2852
2936
  {
@@ -25530,6 +25530,16 @@ function APIScriptIndex(name,script,args,option, isOverlay)
25530
25530
 
25531
25531
  result.push(outVarItem);
25532
25532
  }
25533
+ else if (draw.DrawType=='MULTI_BAR')
25534
+ {
25535
+ drawItem.Text=draw.Text;
25536
+ drawItem.Name=draw.Name;
25537
+ drawItem.DrawType=draw.DrawType;
25538
+ drawItem.DrawData=draw.DrawData;
25539
+ outVarItem.Draw=drawItem;
25540
+
25541
+ result.push(outVarItem);
25542
+ }
25533
25543
  else if (draw.DrawType=="DRAWCOLORKLINE")
25534
25544
  {
25535
25545
  drawItem.Name=draw.Name;
@@ -40562,7 +40562,7 @@ function ChartMultiBar()
40562
40562
 
40563
40563
  for(var mapItem of mapBar)
40564
40564
  {
40565
- aryBar=mapItem[1].AryBar;
40565
+ var aryBar=mapItem[1].AryBar;
40566
40566
  if (!IFrameSplitOperator.IsNonEmptyArray(aryBar)) continue;
40567
40567
 
40568
40568
  var config=null;
@@ -40570,6 +40570,7 @@ function ChartMultiBar()
40570
40570
  var count=0;
40571
40571
  var drawType=-1; //1=直线 2=实心 3=空心
40572
40572
  var barWidth=1;
40573
+ this.Canvas.beginPath();
40573
40574
  for(var i=0;i<aryBar.length;++i)
40574
40575
  {
40575
40576
  var item=aryBar[i];
@@ -40593,7 +40594,6 @@ function ChartMultiBar()
40593
40594
 
40594
40595
  if (drawType==1)
40595
40596
  {
40596
- this.Canvas.beginPath();
40597
40597
  if (this.IsHScreen)
40598
40598
  {
40599
40599
  this.Canvas.moveTo(ToFixedPoint(item.Y),ToFixedPoint(item.X));
@@ -41340,10 +41340,18 @@ function ChartMultiText()
41340
41340
  var mapItem=this.MapCache.get(key);
41341
41341
  if (!IFrameSplitOperator.IsNonEmptyArray(mapItem.Data)) continue;
41342
41342
 
41343
- var left=xOffset;
41344
- var right=xOffset+dataWidth;
41345
- if (right>chartright) break;
41346
- var x=left+(right-left)/2;
41343
+ if (isMinute)
41344
+ {
41345
+ var x=this.ChartFrame.GetXFromIndex(j);
41346
+ }
41347
+ else
41348
+ {
41349
+ var left=xOffset;
41350
+ var right=xOffset+dataWidth;
41351
+ if (right>chartright) break;
41352
+ var x=left+(right-left)/2;
41353
+ }
41354
+
41347
41355
 
41348
41356
  for(var k=0;k<mapItem.Data.length;++k)
41349
41357
  {
@@ -41398,7 +41406,6 @@ function ChartMultiText()
41398
41406
 
41399
41407
  if (item.Line)
41400
41408
  {
41401
- var kItem=this.Data.Data[item.Index];
41402
41409
  var price=item.Line.KData=="H"? kItem.High:kItem.Low;
41403
41410
  var yPrice=this.ChartFrame.GetYFromData(price, false);
41404
41411
  var yText=y;
@@ -53150,8 +53157,9 @@ function ChartCorssCursor()
53150
53157
  Icon:g_JSChartResource.CorssCursor.RightButton.Icon
53151
53158
  };
53152
53159
 
53153
- this.RightMargin={ Left:2, Right:2, Top:4, Bottom:3 };
53154
- CopyMarginConfig(this.RightMargin, g_JSChartResource.CorssCursor.RightMargin);
53160
+ this.RightMargin=CloneData(g_JSChartResource.CorssCursor.RightMargin);
53161
+ this.BottomConfig=CloneData(g_JSChartResource.CorssCursor.BottomText); //底部输出配置
53162
+ this.LeftConfig=CloneData(g_JSChartResource.CorssCursor.LeftText);
53155
53163
 
53156
53164
  //内部使用
53157
53165
  this.Close=null; //收盘价格
@@ -53523,36 +53531,48 @@ function ChartCorssCursor()
53523
53531
  {
53524
53532
  var text=this.StringFormatY.Text;
53525
53533
  this.Canvas.font=this.Font;
53526
- var textWidth=this.Canvas.measureText(text).width+4; //前后各空2个像素
53527
- var textSize={ Width:textWidth, Height:this.TextHeight, Text:[] };
53534
+ var textWidth=this.Canvas.measureText(text).width; //前后各空2个像素
53535
+ var textSize={ Width:textWidth+4, Height:this.TextHeight, Text:[] };
53528
53536
  var buttonData={Y:y, YValue:yValue, FrameID:yValueExtend.FrameID };
53529
- if (this.Frame.ChartBorder.Left>=30 && this.ShowTextMode.Left==1)
53537
+
53538
+ if (this.Frame.ChartBorder.Left>=30) //左边
53530
53539
  {
53531
- if (left<textWidth ) //左边空白的地方太少了画布下
53540
+ var margin=this.LeftConfig.Margin;
53541
+ var textOffset=this.LeftConfig.TextOffset;
53542
+
53543
+ var rtBG=null;
53544
+ if (this.ShowTextMode.Left==1)
53532
53545
  {
53533
- this.DrawTextBGRect(ToFixedPoint(2),ToFixedPoint(y-this.TextHeight/2),ToFixedRect(textWidth),ToFixedRect(this.TextHeight));
53534
- this.Canvas.textAlign="left";
53535
- this.Canvas.textBaseline="middle";
53536
- this.Canvas.fillStyle=this.TextColor;
53537
- this.Canvas.fillText(text,2+2,y,textWidth);
53546
+ var rtBG={ Right:left, Width:textWidth+margin.Left+margin.Right, YCenter:y, Height:textHeight+margin.Top+margin.Bottom };
53547
+ rtBG.Left=rtBG.Right-rtBG.Width;
53548
+ rtBG.Top=rtBG.YCenter-rtBG.Height/2;
53549
+ rtBG.Bottom=rtBG.Top+rtBG.Height;
53550
+
53551
+ if (rtBG.Left<0)
53552
+ {
53553
+ rtBG.Left=0;
53554
+ rtBG.Right=rtBG.Left+rtBG.Width;
53555
+ }
53538
53556
  }
53539
- else
53557
+ else if (this.ShowTextMode.Left==2) //在框架内显示
53540
53558
  {
53541
- this.DrawTextBGRect(left-2,y-this.TextHeight/2,-textWidth,this.TextHeight);
53542
- this.Canvas.textAlign="right";
53543
- this.Canvas.textBaseline="middle";
53559
+ var rtBG={ Left:left, Width:textWidth+margin.Left+margin.Right, YCenter:y, Height:textHeight+margin.Top+margin.Bottom };
53560
+ rtBG.Right=rtBG.Left+rtBG.Width;
53561
+ rtBG.Top=rtBG.YCenter-rtBG.Height/2;
53562
+ rtBG.Bottom=rtBG.Top+rtBG.Height;
53563
+ }
53564
+
53565
+ if (rtBG)
53566
+ {
53567
+ this.DrawTextBGRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);
53568
+ this.Canvas.textAlign="left";
53569
+ this.Canvas.textBaseline="bottom";
53544
53570
  this.Canvas.fillStyle=this.TextColor;
53545
- this.Canvas.fillText(text,left-4,y,textWidth);
53571
+ this.Canvas.fillText(text,rtBG.Left+textOffset.X, rtBG.Bottom+textOffset.Y);
53546
53572
  }
53547
53573
  }
53548
- else if (this.ShowTextMode.Left==2) //在框架内显示
53549
- {
53550
- this.DrawTextBGRect(left,y-this.TextHeight/2,textWidth,this.TextHeight);
53551
- this.Canvas.textAlign="left";
53552
- this.Canvas.textBaseline="middle";
53553
- this.Canvas.fillStyle=this.TextColor;
53554
- this.Canvas.fillText(text,left+2,y,textWidth);
53555
- }
53574
+
53575
+
53556
53576
 
53557
53577
  var complexText=
53558
53578
  {
@@ -53694,26 +53714,42 @@ function ChartCorssCursor()
53694
53714
  var text=this.StringFormatX.Text;
53695
53715
  this.Canvas.font=this.Font;
53696
53716
  this.Canvas.fillStyle=this.TextBGColor;
53697
- var textWidth=this.Canvas.measureText(text).width+4; //前后各空2个像素
53717
+ var textWidth=this.Canvas.measureText(text).width; //前后各空2个像素
53718
+ var margin=this.BottomConfig.Margin;
53719
+ var textOffset=this.BottomConfig.TextOffset;
53720
+ var rtBG=
53721
+ {
53722
+ Top:bottom, Height:margin.Top+margin.Bottom+textHeight,
53723
+ XCenter:x, Width:textWidth+margin.Left+margin.Right
53724
+ };
53725
+ rtBG.Bottom=rtBG.Top+rtBG.Height;
53726
+ rtBG.Left=rtBG.XCenter-rtBG.Width/2;
53727
+ rtBG.Right=rtBG.Left+rtBG.Width;
53728
+
53729
+ if (rtBG.Left<=0)
53730
+ {
53731
+ rtBG.Left=0;
53732
+ rtBG.Right=rtBG.Left+rtBG.Width;
53733
+ }
53734
+ else if (rtBG.Right>=right)
53735
+ {
53736
+ rtBG.Right=right;
53737
+ rtBG.Left=rtBG.Right-rtBG.Width;
53738
+ }
53698
53739
 
53699
- var yCenter=bottom+2+this.TextHeight/2;
53700
- var yTop=bottom+2;
53701
53740
  var bShowText=true;
53702
53741
  if (this.ShowTextMode.Bottom==2)
53703
53742
  {
53704
- yCenter=bottom-this.TextHeight/2-2;
53705
- yTop=bottom-this.TextHeight-2;
53743
+ rtBG.Bottom=bottom;
53744
+ rtBG.Top=rtBG.Bottom-rtBG.Height;
53706
53745
  }
53707
53746
  else if (this.ShowTextMode.Bottom==8)
53708
53747
  {
53709
53748
  var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_CORSSCURSOR_POSITION);
53710
53749
  if (event && event.Callback)
53711
53750
  {
53712
- var sendData={ YCenter:yCenter, YTop:yTop, Height:this.TextHeight, IsShowText:bShowText };
53751
+ var sendData={ RectText:rtBG, IsShowText:bShowText, X:x, Y:y };
53713
53752
  event.Callback(event, sendData, this);
53714
-
53715
- yCenter=sendData.YCenter;
53716
- yTop=sendData.YTop;
53717
53753
  bShowText=sendData.IsShowText;
53718
53754
  }
53719
53755
  }
@@ -53721,31 +53757,12 @@ function ChartCorssCursor()
53721
53757
  //JSConsole.Chart.Log('[ChartCorssCursor::Draw] ',yCenter);
53722
53758
  if (bShowText)
53723
53759
  {
53724
- if (x-textWidth/2<3) //左边位置不够了, 顶着左边画
53725
- {
53726
- this.DrawTextBGRect(x-1,yTop,textWidth,this.TextHeight);
53727
- this.Canvas.textAlign="left";
53728
- this.Canvas.textBaseline="middle";
53729
- this.Canvas.fillStyle=this.TextColor;
53730
- this.Canvas.fillText(text,x+1,yCenter,textWidth);
53731
- }
53732
- else if (x+textWidth/2>=right)
53733
- {
53734
- this.DrawTextBGRect(right-textWidth,yTop,textWidth,this.TextHeight);
53735
- this.Canvas.textAlign="right";
53736
- this.Canvas.textBaseline="middle";
53737
- this.Canvas.fillStyle=this.TextColor;
53738
- this.Canvas.fillText(text,right-2,yCenter,textWidth);
53739
- }
53740
- else
53741
- {
53742
- this.DrawTextBGRect(x-textWidth/2,yTop,textWidth,this.TextHeight);
53743
- this.Canvas.textAlign="center";
53744
- this.Canvas.textBaseline="middle";
53745
- this.Canvas.fillStyle=this.TextColor;
53746
- this.Canvas.fillText(text,x,yCenter,textWidth);
53747
- }
53748
- }
53760
+ this.DrawTextBGRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);
53761
+ this.Canvas.textAlign="left";
53762
+ this.Canvas.textBaseline="bottom";
53763
+ this.Canvas.fillStyle=this.TextColor;
53764
+ this.Canvas.fillText(text,rtBG.Left+textOffset.X,rtBG.Bottom+textOffset.Y,textWidth);
53765
+ }
53749
53766
  }
53750
53767
 
53751
53768
  //子坐标Y轴
@@ -71073,7 +71090,10 @@ function JSChartResource()
71073
71090
  Icon: { Text:'\ue6a3', Color:'rgb(255,255,255)', Family:"iconfont", Size:18 }
71074
71091
  },
71075
71092
 
71076
- RightMargin: { Left:2, Right:2, Top:5, Bottom:3 }
71093
+ RightMargin: { Left:2, Right:2, Top:5, Bottom:3 },
71094
+
71095
+ BottomText:{ Margin: { Left:4, Right:4, Top:0, Bottom:0 }, TextOffset:{X:4, Y:-1 } },
71096
+ LeftText:{ Margin: { Left:4, Right:4, Top:0, Bottom:0 }, TextOffset:{X:4, Y:-1 } }
71077
71097
  };
71078
71098
 
71079
71099
  this.LockBGColor = "rgb(220, 220, 220)"; //指标锁区域颜色
@@ -1866,6 +1866,8 @@ HQData.Report_APIIndex=function(data, callback)
1866
1866
  HQData.APIIndex_DRAW_SIMPLE_RADAR(data, callback);
1867
1867
  else if (request.Data.indexname=="API_MULTI_BAR")
1868
1868
  HQData.APIIndex_MULTI_BAR(data, callback);
1869
+ else if (request.Data.indexname=="API_MULTI_TEXT")
1870
+ HQData.APIIndex_MULTI_TEXT(data, callback);
1869
1871
 
1870
1872
  }
1871
1873
 
@@ -2502,7 +2504,7 @@ HQData.APIIndex_MULTI_BAR=function(data, callback)
2502
2504
  [
2503
2505
  //{Date:20190916, Time: Value:15.5, Value2:0 },
2504
2506
  ],
2505
- Width:20
2507
+ Width:5
2506
2508
  };
2507
2509
 
2508
2510
  for(var i=0;i<kData.Data.length;++i)
@@ -2531,3 +2533,54 @@ HQData.APIIndex_MULTI_BAR=function(data, callback)
2531
2533
  }
2532
2534
 
2533
2535
 
2536
+ HQData.APIIndex_MULTI_TEXT=function(data, callback)
2537
+ {
2538
+ data.PreventDefault=true;
2539
+ var hqchart=data.HQChart;
2540
+ var kData=hqchart.GetKData();
2541
+
2542
+ var SVGData=
2543
+ {
2544
+ name:'MULTI_TEXT', type:1,
2545
+ Draw:
2546
+ {
2547
+ DrawType:'MULTI_TEXT',
2548
+ DrawData: []
2549
+ } //绘制文字
2550
+ };
2551
+
2552
+ var ARRAY_COLOR=['rgb(255,248,220)','rgb(230,230,250)','rgb(100,149,237)','rgb(32,178,170)','rgb(152,251,152)','rgb(128,128,0)','rgb(255,165,0)','rgb(255,160,122)','rgb(205,92,92)']
2553
+
2554
+ for(var i=0;i<kData.Data.length;++i)
2555
+ {
2556
+ var item=kData.Data[i];
2557
+ if (i%5!=3) continue;
2558
+
2559
+ var colorIndex=Math.ceil(Math.random()*ARRAY_COLOR.length-1);
2560
+ var drawItem=
2561
+ {
2562
+ Date:item.Date, Time:item.Time, Value:"H", Text:`最高:${item.High.toFixed(2)}`,Color:ARRAY_COLOR[colorIndex], Baseline:2, YMove:-2
2563
+ };
2564
+
2565
+ var colorIndex=Math.ceil(Math.random()*ARRAY_COLOR.length-1);
2566
+ var drawItem2=
2567
+ {
2568
+ Date:item.Date, Time:item.Time, Value:item.Low, Text:`最低:${item.Low.toFixed(2)}`,Color:ARRAY_COLOR[colorIndex], Baseline:1, YMove:2
2569
+ };
2570
+
2571
+ SVGData.Draw.DrawData.push(drawItem);
2572
+ SVGData.Draw.DrawData.push(drawItem2);
2573
+ }
2574
+
2575
+ var apiData=
2576
+ {
2577
+ code:0,
2578
+ stock:{ name:hqchart.Name, symbol:hqchart.Symbol },
2579
+ outdata: { date:kData.GetDate(), time:kData.GetTime(), outvar:[SVGData] }
2580
+ };
2581
+
2582
+ console.log('[HQData.APIIndex_MULTI_TEXT] apiData ', apiData);
2583
+ callback(apiData);
2584
+ }
2585
+
2586
+