hqchart 1.1.14354 → 1.1.14367

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;
@@ -4587,11 +4587,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
4587
4587
  var y=(e.clientY-uielement.getBoundingClientRect().top)*pixelTatio;
4588
4588
  var data= { X:e.clientX, Y:e.clientY, FrameID:-1 };
4589
4589
 
4590
- var isInClient=false;
4591
- this.Canvas.beginPath();
4592
- this.Canvas.rect(this.Frame.ChartBorder.GetLeft(),this.Frame.ChartBorder.GetTop(),this.Frame.ChartBorder.GetWidth(),this.Frame.ChartBorder.GetHeight());
4593
- isInClient=this.Canvas.isPointInPath(x,y);
4594
- if (isInClient)
4590
+ var clientPos=this.PtInClient(x,y);
4591
+ if (clientPos>0)
4595
4592
  {
4596
4593
  var yValueExtend={};
4597
4594
  var yValue=this.Frame.GetYData(y,yValueExtend);
@@ -41340,10 +41337,18 @@ function ChartMultiText()
41340
41337
  var mapItem=this.MapCache.get(key);
41341
41338
  if (!IFrameSplitOperator.IsNonEmptyArray(mapItem.Data)) continue;
41342
41339
 
41343
- var left=xOffset;
41344
- var right=xOffset+dataWidth;
41345
- if (right>chartright) break;
41346
- var x=left+(right-left)/2;
41340
+ if (isMinute)
41341
+ {
41342
+ var x=this.ChartFrame.GetXFromIndex(j);
41343
+ }
41344
+ else
41345
+ {
41346
+ var left=xOffset;
41347
+ var right=xOffset+dataWidth;
41348
+ if (right>chartright) break;
41349
+ var x=left+(right-left)/2;
41350
+ }
41351
+
41347
41352
 
41348
41353
  for(var k=0;k<mapItem.Data.length;++k)
41349
41354
  {
@@ -44365,11 +44370,15 @@ function KLineTooltipPaint()
44365
44370
  }
44366
44371
 
44367
44372
  //换手率
44368
- if (MARKET_SUFFIX_NAME.IsSHSZStockA(this.HQChart.Symbol) && item.FlowCapital>0)
44373
+ if (IFrameSplitOperator.IsNumber(item.FlowCapital))
44369
44374
  {
44375
+ var text="--.--"
44370
44376
  title=g_JSChartLocalization.GetText('Tooltip-Exchange',this.LanguageID);
44371
- var value=item.Vol/item.FlowCapital*100;
44372
- var text=value.toFixed(2)+'%';
44377
+ if (item.FlowCapital!=0)
44378
+ {
44379
+ var value=item.Vol/item.FlowCapital*100;
44380
+ var text=value.toFixed(2)+'%';
44381
+ }
44373
44382
  aryText.push({Title:title, TitleColor:this.TitleColor, Text:text, Color:this.TitleColor });
44374
44383
  }
44375
44384
 
@@ -53149,8 +53158,9 @@ function ChartCorssCursor()
53149
53158
  Icon:g_JSChartResource.CorssCursor.RightButton.Icon
53150
53159
  };
53151
53160
 
53152
- this.RightMargin={ Left:2, Right:2, Top:4, Bottom:3 };
53153
- CopyMarginConfig(this.RightMargin, g_JSChartResource.CorssCursor.RightMargin);
53161
+ this.RightMargin=CloneData(g_JSChartResource.CorssCursor.RightMargin);
53162
+ this.BottomConfig=CloneData(g_JSChartResource.CorssCursor.BottomText); //底部输出配置
53163
+ this.LeftConfig=CloneData(g_JSChartResource.CorssCursor.LeftText);
53154
53164
 
53155
53165
  //内部使用
53156
53166
  this.Close=null; //收盘价格
@@ -53522,36 +53532,48 @@ function ChartCorssCursor()
53522
53532
  {
53523
53533
  var text=this.StringFormatY.Text;
53524
53534
  this.Canvas.font=this.Font;
53525
- var textWidth=this.Canvas.measureText(text).width+4; //前后各空2个像素
53526
- var textSize={ Width:textWidth, Height:this.TextHeight, Text:[] };
53535
+ var textWidth=this.Canvas.measureText(text).width; //前后各空2个像素
53536
+ var textSize={ Width:textWidth+4, Height:this.TextHeight, Text:[] };
53527
53537
  var buttonData={Y:y, YValue:yValue, FrameID:yValueExtend.FrameID };
53528
- if (this.Frame.ChartBorder.Left>=30 && this.ShowTextMode.Left==1)
53538
+
53539
+ if (this.Frame.ChartBorder.Left>=30) //左边
53529
53540
  {
53530
- if (left<textWidth ) //左边空白的地方太少了画布下
53541
+ var margin=this.LeftConfig.Margin;
53542
+ var textOffset=this.LeftConfig.TextOffset;
53543
+
53544
+ var rtBG=null;
53545
+ if (this.ShowTextMode.Left==1)
53531
53546
  {
53532
- this.DrawTextBGRect(ToFixedPoint(2),ToFixedPoint(y-this.TextHeight/2),ToFixedRect(textWidth),ToFixedRect(this.TextHeight));
53533
- this.Canvas.textAlign="left";
53534
- this.Canvas.textBaseline="middle";
53535
- this.Canvas.fillStyle=this.TextColor;
53536
- this.Canvas.fillText(text,2+2,y,textWidth);
53547
+ var rtBG={ Right:left, Width:textWidth+margin.Left+margin.Right, YCenter:y, Height:textHeight+margin.Top+margin.Bottom };
53548
+ rtBG.Left=rtBG.Right-rtBG.Width;
53549
+ rtBG.Top=rtBG.YCenter-rtBG.Height/2;
53550
+ rtBG.Bottom=rtBG.Top+rtBG.Height;
53551
+
53552
+ if (rtBG.Left<0)
53553
+ {
53554
+ rtBG.Left=0;
53555
+ rtBG.Right=rtBG.Left+rtBG.Width;
53556
+ }
53537
53557
  }
53538
- else
53558
+ else if (this.ShowTextMode.Left==2) //在框架内显示
53539
53559
  {
53540
- this.DrawTextBGRect(left-2,y-this.TextHeight/2,-textWidth,this.TextHeight);
53541
- this.Canvas.textAlign="right";
53542
- this.Canvas.textBaseline="middle";
53560
+ var rtBG={ Left:left, Width:textWidth+margin.Left+margin.Right, YCenter:y, Height:textHeight+margin.Top+margin.Bottom };
53561
+ rtBG.Right=rtBG.Left+rtBG.Width;
53562
+ rtBG.Top=rtBG.YCenter-rtBG.Height/2;
53563
+ rtBG.Bottom=rtBG.Top+rtBG.Height;
53564
+ }
53565
+
53566
+ if (rtBG)
53567
+ {
53568
+ this.DrawTextBGRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);
53569
+ this.Canvas.textAlign="left";
53570
+ this.Canvas.textBaseline="bottom";
53543
53571
  this.Canvas.fillStyle=this.TextColor;
53544
- this.Canvas.fillText(text,left-4,y,textWidth);
53572
+ this.Canvas.fillText(text,rtBG.Left+textOffset.X, rtBG.Bottom+textOffset.Y);
53545
53573
  }
53546
53574
  }
53547
- else if (this.ShowTextMode.Left==2) //在框架内显示
53548
- {
53549
- this.DrawTextBGRect(left,y-this.TextHeight/2,textWidth,this.TextHeight);
53550
- this.Canvas.textAlign="left";
53551
- this.Canvas.textBaseline="middle";
53552
- this.Canvas.fillStyle=this.TextColor;
53553
- this.Canvas.fillText(text,left+2,y,textWidth);
53554
- }
53575
+
53576
+
53555
53577
 
53556
53578
  var complexText=
53557
53579
  {
@@ -53693,26 +53715,42 @@ function ChartCorssCursor()
53693
53715
  var text=this.StringFormatX.Text;
53694
53716
  this.Canvas.font=this.Font;
53695
53717
  this.Canvas.fillStyle=this.TextBGColor;
53696
- var textWidth=this.Canvas.measureText(text).width+4; //前后各空2个像素
53718
+ var textWidth=this.Canvas.measureText(text).width; //前后各空2个像素
53719
+ var margin=this.BottomConfig.Margin;
53720
+ var textOffset=this.BottomConfig.TextOffset;
53721
+ var rtBG=
53722
+ {
53723
+ Top:bottom, Height:margin.Top+margin.Bottom+textHeight,
53724
+ XCenter:x, Width:textWidth+margin.Left+margin.Right
53725
+ };
53726
+ rtBG.Bottom=rtBG.Top+rtBG.Height;
53727
+ rtBG.Left=rtBG.XCenter-rtBG.Width/2;
53728
+ rtBG.Right=rtBG.Left+rtBG.Width;
53729
+
53730
+ if (rtBG.Left<=0)
53731
+ {
53732
+ rtBG.Left=0;
53733
+ rtBG.Right=rtBG.Left+rtBG.Width;
53734
+ }
53735
+ else if (rtBG.Right>=right)
53736
+ {
53737
+ rtBG.Right=right;
53738
+ rtBG.Left=rtBG.Right-rtBG.Width;
53739
+ }
53697
53740
 
53698
- var yCenter=bottom+2+this.TextHeight/2;
53699
- var yTop=bottom+2;
53700
53741
  var bShowText=true;
53701
53742
  if (this.ShowTextMode.Bottom==2)
53702
53743
  {
53703
- yCenter=bottom-this.TextHeight/2-2;
53704
- yTop=bottom-this.TextHeight-2;
53744
+ rtBG.Bottom=bottom;
53745
+ rtBG.Top=rtBG.Bottom-rtBG.Height;
53705
53746
  }
53706
53747
  else if (this.ShowTextMode.Bottom==8)
53707
53748
  {
53708
53749
  var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_CORSSCURSOR_POSITION);
53709
53750
  if (event && event.Callback)
53710
53751
  {
53711
- var sendData={ YCenter:yCenter, YTop:yTop, Height:this.TextHeight, IsShowText:bShowText };
53752
+ var sendData={ RectText:rtBG, IsShowText:bShowText, X:x, Y:y };
53712
53753
  event.Callback(event, sendData, this);
53713
-
53714
- yCenter=sendData.YCenter;
53715
- yTop=sendData.YTop;
53716
53754
  bShowText=sendData.IsShowText;
53717
53755
  }
53718
53756
  }
@@ -53720,31 +53758,12 @@ function ChartCorssCursor()
53720
53758
  //JSConsole.Chart.Log('[ChartCorssCursor::Draw] ',yCenter);
53721
53759
  if (bShowText)
53722
53760
  {
53723
- if (x-textWidth/2<3) //左边位置不够了, 顶着左边画
53724
- {
53725
- this.DrawTextBGRect(x-1,yTop,textWidth,this.TextHeight);
53726
- this.Canvas.textAlign="left";
53727
- this.Canvas.textBaseline="middle";
53728
- this.Canvas.fillStyle=this.TextColor;
53729
- this.Canvas.fillText(text,x+1,yCenter,textWidth);
53730
- }
53731
- else if (x+textWidth/2>=right)
53732
- {
53733
- this.DrawTextBGRect(right-textWidth,yTop,textWidth,this.TextHeight);
53734
- this.Canvas.textAlign="right";
53735
- this.Canvas.textBaseline="middle";
53736
- this.Canvas.fillStyle=this.TextColor;
53737
- this.Canvas.fillText(text,right-2,yCenter,textWidth);
53738
- }
53739
- else
53740
- {
53741
- this.DrawTextBGRect(x-textWidth/2,yTop,textWidth,this.TextHeight);
53742
- this.Canvas.textAlign="center";
53743
- this.Canvas.textBaseline="middle";
53744
- this.Canvas.fillStyle=this.TextColor;
53745
- this.Canvas.fillText(text,x,yCenter,textWidth);
53746
- }
53747
- }
53761
+ this.DrawTextBGRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);
53762
+ this.Canvas.textAlign="left";
53763
+ this.Canvas.textBaseline="bottom";
53764
+ this.Canvas.fillStyle=this.TextColor;
53765
+ this.Canvas.fillText(text,rtBG.Left+textOffset.X,rtBG.Bottom+textOffset.Y,textWidth);
53766
+ }
53748
53767
  }
53749
53768
 
53750
53769
  //子坐标Y轴
@@ -55551,13 +55570,19 @@ function HistoryDataStringFormat()
55551
55570
  aryText.push(item);
55552
55571
  }
55553
55572
 
55554
- if(MARKET_SUFFIX_NAME.IsSHSZStockA(this.Symbol) && data.FlowCapital>0) //换手率
55573
+ if(IFrameSplitOperator.IsNumber(data.FlowCapital)) //换手率
55555
55574
  {
55556
- var value=data.Vol/data.FlowCapital*100;
55575
+ var text="--.--";
55576
+ if (data.FlowCapital!=0)
55577
+ {
55578
+ var value=data.Vol/data.FlowCapital*100;
55579
+ var text=`${value.toFixed(2)}%`;
55580
+ }
55581
+
55557
55582
  var item=
55558
55583
  {
55559
55584
  Title:g_JSChartLocalization.GetText('DivTooltip-Exchange',this.LanguageID),
55560
- Text:`${value.toFixed(2)}%`,
55585
+ Text:text,
55561
55586
  Color:this.TurnoverRateColor
55562
55587
  }
55563
55588
  aryText.push(item);
@@ -56254,10 +56279,14 @@ function DynamicKLineTitlePainting()
56254
56279
  aryText.push({ Text:text, Color:this.AmountColor});
56255
56280
  }
56256
56281
 
56257
- if (MARKET_SUFFIX_NAME.IsSHSZStockA(this.Symbol) && item.FlowCapital>0) //A股有换手率
56282
+ if (IFrameSplitOperator.IsNumber(item.FlowCapital)) //换手率
56258
56283
  {
56259
- var value=item.Vol/item.FlowCapital*100; //成交量/流通A股*100
56260
- var text=g_JSChartLocalization.GetText('KTitle-Exchange',this.LanguageID)+IFrameSplitOperator.FormatValueString(value,2,this.LanguageID)+'%';
56284
+ var text="--.--";
56285
+ if (item.FlowCapital!=0)
56286
+ {
56287
+ var value=item.Vol/item.FlowCapital*100; //成交量/流通A股*100
56288
+ var text=g_JSChartLocalization.GetText('KTitle-Exchange',this.LanguageID)+IFrameSplitOperator.FormatValueString(value,2,this.LanguageID)+'%';
56289
+ }
56261
56290
  aryText.push({ Text:text, Color:this.TurnoverRateColor});
56262
56291
  }
56263
56292
 
@@ -71072,7 +71101,10 @@ function JSChartResource()
71072
71101
  Icon: { Text:'\ue6a3', Color:'rgb(255,255,255)', Family:"iconfont", Size:18 }
71073
71102
  },
71074
71103
 
71075
- RightMargin: { Left:2, Right:2, Top:5, Bottom:3 }
71104
+ RightMargin: { Left:2, Right:2, Top:5, Bottom:3 },
71105
+
71106
+ BottomText:{ Margin: { Left:4, Right:4, Top:0, Bottom:0 }, TextOffset:{X:4, Y:-1 } },
71107
+ LeftText:{ Margin: { Left:4, Right:4, Top:0, Bottom:0 }, TextOffset:{X:4, Y:-1 } }
71076
71108
  };
71077
71109
 
71078
71110
  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
+