hqchart 1.1.15258 → 1.1.15292

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.
@@ -7445,6 +7445,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7445
7445
  this.IsPress=false; //是否长按
7446
7446
  this.IsPressKeyboard=false; //是否键盘按键
7447
7447
  this.PressKeyboardConfig={ PauseUpdate:false, }; //按键以后 是否涨停数据更新
7448
+ this.DrawStatusData={ LatestTime:{ Draw:null, DrawDynamicInfo:null } };
7448
7449
 
7449
7450
  this.NetworkFilter; //网络请求回调 function(data, callback);
7450
7451
  this.LastMouseStatus={ MouseOnToolbar:null }; // MouseOnToolbar={ Rect:{}, Title: }
@@ -7650,6 +7651,24 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7650
7651
  return unit;
7651
7652
  }
7652
7653
 
7654
+ this.ClearDrawStatusData=function()
7655
+ {
7656
+ this.DrawStatusData.LatestTime.Draw=null;
7657
+ this.DrawStatusData.LatestTime.DrawDynamicInfo=null;
7658
+ }
7659
+
7660
+ this.UpdateDrawStatusData=function(funName)
7661
+ {
7662
+ if (funName=="Draw")
7663
+ {
7664
+ this.DrawStatusData.LatestTime.Draw=new Date();
7665
+ }
7666
+ else if (funName=="DrawDynamicInfo")
7667
+ {
7668
+ this.DrawStatusData.LatestTime.DrawDynamicInfo=new Date();
7669
+ }
7670
+ }
7671
+
7653
7672
  this.ClearStockCache=function()
7654
7673
  {
7655
7674
  this.StockCache.Data=null;
@@ -10962,6 +10981,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
10962
10981
  ++this.TouchDrawCount;
10963
10982
 
10964
10983
  this.UpdateCorssCursorStatus();
10984
+ this.UpdateDrawStatusData("Draw");
10965
10985
  }
10966
10986
 
10967
10987
  this.DrawExtendChartPaint=function(level, option)
@@ -11190,7 +11210,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
11190
11210
  IsOnTouch:this.IsOnTouch,
11191
11211
  CorssCursorTouchEnd:this.CorssCursorTouchEnd,
11192
11212
  IsTitleShowLatestData:this.IsTitleShowLatestData,
11193
- IsMinuteChart:(this.ClassName=="MinuteChartContainer" || this.ClassName=="MinuteChartHScreenContainer") ? true:false
11213
+ IsMinuteChart:(this.ClassName=="MinuteChartContainer" || this.ClassName=="MinuteChartHScreenContainer") ? true:false,
11214
+ DrawStatusData:this.DrawStatusData,
11194
11215
  };
11195
11216
 
11196
11217
  status.FrameID=this.Frame.PtInFrame(this.LastPoint.X, this.LastPoint.Y);
@@ -11485,6 +11506,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
11485
11506
  ++this.TouchDrawCount;
11486
11507
 
11487
11508
  this.UpdateCorssCursorStatus();
11509
+ this.UpdateDrawStatusData("DrawDynamicInfo");
11510
+
11488
11511
  }
11489
11512
 
11490
11513
  this.DrawAnimation=function() //绘制动画 如弹幕
@@ -43716,6 +43739,294 @@ function ChartSingleText()
43716
43739
  }
43717
43740
  }
43718
43741
 
43742
+ function ChartDrawText_Fix()
43743
+ {
43744
+ this.newMethod=IChartPainting; //派生
43745
+ this.newMethod();
43746
+ delete this.newMethod;
43747
+
43748
+ this.ClassName='ChartDrawText_Fix'; //类名
43749
+
43750
+ this.Color="rgb(255,193,37)"; //字颜色
43751
+ this.TextFont=g_JSChartResource.DRAWTEXT_FIX.Font;
43752
+ this.PtPercentage=null; //{ X:, Y: } 百分比坐标
43753
+ this.TextBaseline="top";
43754
+ this.TextAlign='center';
43755
+ this.ShowOffset={ X:0, Y:0 }; //显示偏移
43756
+ this.MapCache;
43757
+ this.HQChart;
43758
+ this.AryText;
43759
+
43760
+ this.BuildCacheData=function(kData, data)
43761
+ {
43762
+ var mapData=new Map();
43763
+ this.MapCache=mapData;
43764
+ if (!kData || !IFrameSplitOperator.IsNonEmptyArray(kData.Data)) return;
43765
+ if (!data || !IFrameSplitOperator.IsNonEmptyArray(data.Value) || !IFrameSplitOperator.IsNonEmptyArray(data.Text)) return;
43766
+
43767
+ for(var i=0;i<kData.Data.length;++i)
43768
+ {
43769
+ var value=data.Value[i];
43770
+ if (value!==1) continue;
43771
+
43772
+ var text=data.Text[i];
43773
+ if (!text) continue;
43774
+
43775
+ var kItem=kData.Data[i];
43776
+ var item={ Value:value, Text:text, Date:kItem.Date, Time:kItem.Time };
43777
+ var key=this.BuildKey(item);
43778
+
43779
+ /* //测试
43780
+ item.Text=
43781
+ [
43782
+ { Name:`日期`, Text:`${item.Date}`, Margin:{ Bottom:10 }},
43783
+ { Name:`日期2`, Text:`${item.Date}-2`},
43784
+ ]
43785
+ */
43786
+
43787
+ mapData.set(key,item);
43788
+ }
43789
+ }
43790
+
43791
+ this.ReloadResource=function(resource)
43792
+ {
43793
+ this.TextFont=g_JSChartResource.DRAWTEXT_FIX.Font;
43794
+ }
43795
+
43796
+ this.Draw=function()
43797
+ {
43798
+ this.AryText=null;
43799
+ if (!this.IsShow || this.ChartFrame.IsMinSize) return;
43800
+ if (this.IsShowIndexTitleOnly()) return;
43801
+ if (this.IsHideScriptIndex()) return;
43802
+ if (!this.MapCache || this.MapCache.size<=0) return;
43803
+ if (!this.PtPercentage || !IFrameSplitOperator.IsNumber(this.PtPercentage.X) || !IFrameSplitOperator.IsNumber(this.PtPercentage.Y)) return;
43804
+ if (!this.IsDrawText()) return;
43805
+
43806
+ var bHScreen=(this.ChartFrame.IsHScreen===true)
43807
+ this.Canvas.save();
43808
+ this.ClipClient(bHScreen);
43809
+
43810
+ this.DrawText();
43811
+
43812
+ this.Canvas.restore();
43813
+ this.AryText=null;
43814
+ }
43815
+
43816
+ //当前屏是否要绘制文字
43817
+ this.IsDrawText=function()
43818
+ {
43819
+ if (!this.HQChart) return false;
43820
+ var kData=this.HQChart.GetKData();
43821
+ if (!kData || !IFrameSplitOperator.IsNonEmptyArray(kData.Data)) return false;
43822
+
43823
+ var bHScreen=(this.ChartFrame.IsHScreen===true)
43824
+ var dataWidth=this.ChartFrame.DataWidth;
43825
+ var distanceWidth=this.ChartFrame.DistanceWidth;
43826
+ var xPointCount=this.ChartFrame.XPointCount;
43827
+ var xOffset=this.ChartBorder.GetLeft()+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;
43828
+ var chartright=this.ChartBorder.GetRight();
43829
+ var top=this.ChartBorder.GetTopEx();
43830
+ var bottom=this.ChartBorder.GetBottomEx();
43831
+
43832
+ if (bHScreen)
43833
+ {
43834
+ chartright=this.ChartBorder.GetBottom();
43835
+ top=this.ChartBorder.GetRightEx();
43836
+ bottom=this.ChartBorder.GetLeftEx();
43837
+ xOffset=this.ChartBorder.GetTop()+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;
43838
+ }
43839
+
43840
+ for(var i=kData.DataOffset,j=0;i<kData.Data.length && j<xPointCount;++i,++j,xOffset+=(dataWidth+distanceWidth))
43841
+ {
43842
+ var kItem=kData.Data[i];
43843
+ if (kItem==null) continue;
43844
+
43845
+ var key=this.BuildKey(kItem);
43846
+ if (!this.MapCache.has(key)) continue;
43847
+
43848
+ var item=this.MapCache.get(key);
43849
+ if (Array.isArray(item.Text)) this.AryText=item.Text;
43850
+ else this.AryText=[{ Name:item.Text }];
43851
+ return true;
43852
+ }
43853
+
43854
+ return false;
43855
+ }
43856
+
43857
+ this.DrawText=function()
43858
+ {
43859
+ var bHScreen=(this.ChartFrame.IsHScreen===true);
43860
+ if (bHScreen)
43861
+ {
43862
+ var x=this.ChartBorder.GetRightEx()-this.ChartBorder.GetWidthEx()*this.PtPercentage.Y;
43863
+ var y=this.ChartBorder.GetTop()+this.ChartBorder.GetHeight()*this.PtPercentage.X;
43864
+ }
43865
+ else
43866
+ {
43867
+ var x=this.ChartBorder.GetLeft()+this.ChartBorder.GetWidth()*this.PtPercentage.X;
43868
+ var y=this.ChartBorder.GetTopEx()+this.ChartBorder.GetHeightEx()*this.PtPercentage.Y;
43869
+ }
43870
+
43871
+ var drawInfo=this.CalculateComplexTextSize(this.AryText, { Font:this.TextFont, Color:this.Color });
43872
+ if (!drawInfo) return;
43873
+
43874
+ drawInfo.IsHScreen=bHScreen;
43875
+
43876
+ if (bHScreen)
43877
+ {
43878
+ if (this.TextBaseline=="middle") x=x-drawInfo.Height/2; //上下居中
43879
+ else if (this.TextBaseline=="bottom") x=x-drawInfo.Height; //底部
43880
+
43881
+ if (this.TextAlign=="center") y=y-drawInfo.Width/2; //左右居中
43882
+ else if (this.TextAlign=='right') y=y-drawInfo.Width; //右对齐
43883
+
43884
+ this.DrawComplexText(x,y, drawInfo);
43885
+ }
43886
+ else
43887
+ {
43888
+ if (this.TextBaseline=="middle") y=y-drawInfo.Height/2; //上下居中
43889
+ else if (this.TextBaseline=="bottom") y=y-drawInfo.Height; //底部
43890
+
43891
+ if (this.TextAlign=="center") x=x-drawInfo.Width/2; //左右居中
43892
+ else if (this.TextAlign=='right') x=x-drawInfo.Width; //右对齐
43893
+
43894
+ this.DrawComplexText(x,y, drawInfo);
43895
+ }
43896
+ }
43897
+
43898
+ this.DrawComplexText=function(x, y, drawInfo)
43899
+ {
43900
+ var left=x;
43901
+ var lineTop=y;
43902
+ if (drawInfo.IsHScreen)
43903
+ {
43904
+ left=0;
43905
+ lineTop=0;
43906
+ this.Canvas.save();
43907
+ this.Canvas.translate(x, y);
43908
+ this.Canvas.rotate(90 * Math.PI / 180);
43909
+ }
43910
+
43911
+ this.Canvas.textBaseline="bottom";
43912
+ this.Canvas.textAlign="left";
43913
+ for(var i=0;i<drawInfo.AryData.length;++i)
43914
+ {
43915
+ var item=drawInfo.AryData[i];
43916
+ var margin=item.Margin;
43917
+ var xText=left+margin.Left;
43918
+ var yText=lineTop+item.Height-margin.Bottom;
43919
+
43920
+ if (item.Name)
43921
+ {
43922
+ this.Canvas.font=item.Font;
43923
+ this.Canvas.fillStyle=item.NameColor;
43924
+ this.Canvas.fillText(item.Name,xText,yText);
43925
+ xText+=item.NameWidth+item.Space;
43926
+ }
43927
+
43928
+ if (item.Text)
43929
+ {
43930
+ this.Canvas.font=item.Font;
43931
+ this.Canvas.fillStyle=item.TextColor;
43932
+ this.Canvas.fillText(item.Text,xText,yText);
43933
+ xText+=item.TextWidth;
43934
+ }
43935
+
43936
+ lineTop+=item.Height;
43937
+ }
43938
+
43939
+ if (drawInfo.IsHScreen) this.Canvas.restore();
43940
+ }
43941
+
43942
+ //计算复杂文本长度高度 defaultOption:{ Font:, }
43943
+ this.CalculateComplexTextSize=function(aryText, defaultOption)
43944
+ {
43945
+ if (!defaultOption) return null;
43946
+ if (!aryText || !IFrameSplitOperator.IsNonEmptyArray(aryText)) return null;
43947
+
43948
+ this.Canvas.font=defaultOption.Font;
43949
+ var lineHeight=this.Canvas.measureText("擎").width;
43950
+ var maxNameWidth=0, maxTextWidth=0;
43951
+ var result={ AryData:[], Width:0, Height:0 }
43952
+ for(var i=0;i<aryText.length;++i)
43953
+ {
43954
+ var item=aryText[i];
43955
+ var newItem={ NameWidth:0, TextWidth:0, Margin:{ Left:0, Top:0, Right:0, Bottom:0 }, Font:defaultOption.Font, Space:0, YOffset:0, Width:0, Height:0 };
43956
+ if (item.Name)
43957
+ {
43958
+ newItem.NameWidth=this.Canvas.measureText(item.Name).width;
43959
+ newItem.Name=item.Name;
43960
+ if (maxNameWidth<item.NameWidth) maxNameWidth=newItem.NameWidth;
43961
+ if (IFrameSplitOperator.IsNumber(item.Space)) newItem.Space=item.Space;
43962
+ if (item.NameColor) newItem.NameColor=item.NameColor;
43963
+ else newItem.NameColor=defaultOption.Color;
43964
+ }
43965
+
43966
+ if (item.Text)
43967
+ {
43968
+ newItem.TextWidth=this.Canvas.measureText(item.Text).width;
43969
+ newItem.Text=item.Text;
43970
+ if (maxTextWidth<item.TextWidth) maxTextWidth=newItem.TextWidth;
43971
+ if (item.TextColor) newItem.TextColor=item.TextColor;
43972
+ else newItem.TextColor=defaultOption.Color;
43973
+ }
43974
+
43975
+
43976
+ CopyMarginConfig(newItem.Margin, item.Margin);
43977
+
43978
+ if (IFrameSplitOperator.IsNumber(item.YOffset)) newItem.YOffset=item.YOffset;
43979
+
43980
+ newItem.Width=newItem.NameWidth+newItem.TextWidth;
43981
+ newItem.Width+=newItem.Margin.Left+newItem.Margin.Right+newItem.Space;
43982
+ newItem.Height=(lineHeight+newItem.Margin.Top+newItem.Margin.Bottom);
43983
+
43984
+ result.AryData.push(newItem);
43985
+ result.Height+=newItem.Height;
43986
+ if (result.Width<newItem.Width) result.Width=newItem.Width;
43987
+ }
43988
+
43989
+ return result;
43990
+ }
43991
+
43992
+ }
43993
+
43994
+ function ChartDrawNumber_Fix()
43995
+ {
43996
+ this.newMethod=ChartDrawText_Fix; //派生
43997
+ this.newMethod();
43998
+ delete this.newMethod;
43999
+
44000
+ this.ClassName='ChartDrawNumber_Fix'; //类名
44001
+ this.TextFont=g_JSChartResource.DRAWNUMBER_FIX.Font;
44002
+
44003
+ this.BuildCacheData=function(kData, data)
44004
+ {
44005
+ var mapData=new Map();
44006
+ this.MapCache=mapData;
44007
+ if (!kData || !IFrameSplitOperator.IsNonEmptyArray(kData.Data)) return;
44008
+ if (!data || !IFrameSplitOperator.IsNonEmptyArray(data.Value) || !IFrameSplitOperator.IsNonEmptyArray(data.Text)) return;
44009
+
44010
+ for(var i=0;i<kData.Data.length;++i)
44011
+ {
44012
+ var value=data.Value[i];
44013
+ var text=data.Text[i];
44014
+ if (!text) continue;
44015
+
44016
+ var kItem=kData.Data[i];
44017
+ var item={ Value:value, Text:text, Date:kItem.Date, Time:kItem.Time };
44018
+ var key=this.BuildKey(item);
44019
+
44020
+ mapData.set(key,item);
44021
+ }
44022
+ }
44023
+
44024
+ this.ReloadResource=function(resource)
44025
+ {
44026
+ this.TextFont=g_JSChartResource.DRAWNUMBER_FIX.Font;
44027
+ }
44028
+ }
44029
+
43719
44030
 
43720
44031
  function ChartTradeIcon()
43721
44032
  {
@@ -43851,7 +44162,8 @@ function ChartDrawText()
43851
44162
 
43852
44163
  this.ClassName='ChartDrawText'; //类名
43853
44164
  this.Color="rgb(255,193,37)"; //线段颜色
43854
- this.TextFont="14px 微软雅黑"; //线段宽度
44165
+ this.Font; //固定字体
44166
+ this.TextFont="14px 微软雅黑"; //输出使用的字体
43855
44167
  this.TextBaseline="middle";
43856
44168
  this.TextAlign='left';
43857
44169
  this.Text
@@ -43882,6 +44194,12 @@ function ChartDrawText()
43882
44194
  }
43883
44195
  }
43884
44196
 
44197
+ this.GetMaxMin=function()
44198
+ {
44199
+ var range={ Min:null, Max:null };
44200
+ return range;
44201
+ }
44202
+
43885
44203
  this.Draw=function()
43886
44204
  {
43887
44205
  if (!this.IsShow || this.ChartFrame.IsMinSize || !this.IsVisible) return;
@@ -43920,8 +44238,9 @@ function ChartDrawText()
43920
44238
  var isArrayText=Array.isArray(this.Text);
43921
44239
  var drawTextInfo={ Text:{ Color:this.Color, Align:this.TextAlign, Baseline:this.TextBaseline }, Font:{ } };
43922
44240
 
43923
-
43924
- if (this.FixedFontSize>0) //固定字体大小模式
44241
+ if (this.Font)
44242
+ this.TextFont=this.Font;
44243
+ else if (this.FixedFontSize>0) //固定字体大小模式
43925
44244
  this.TextFont=`${this.FixedFontSize}px ${this.TextSize.FontName}`;
43926
44245
  else //动态字体大小
43927
44246
  this.TextFont=this.GetDynamicFont(dataWidth,distanceWidth,this.TextSize.Max,this.TextSize.Min,this.TextSize.Zoom,this.TextSize.FontName);
@@ -52771,6 +53090,7 @@ function KLineTooltipPaint()
52771
53090
  this.ExtendLineWidth=2;
52772
53091
 
52773
53092
  this.Font=[g_JSChartResource.TooltipPaint.TitleFont];
53093
+
52774
53094
 
52775
53095
  this.HQChart;
52776
53096
  this.KLineTitlePaint;
@@ -52890,6 +53210,8 @@ function KLineTooltipPaint()
52890
53210
  lineWidth+=textWidth;
52891
53211
  }
52892
53212
 
53213
+ if (IFrameSplitOperator.IsNumber(item.Space)) lineWidth+=item.Space;
53214
+
52893
53215
  if (maxLineWidth<lineWidth) maxLineWidth=lineWidth;
52894
53216
 
52895
53217
  height+=this.LineHeight;
@@ -53081,20 +53403,33 @@ function KLineTooltipPaint()
53081
53403
  {
53082
53404
  var item=titleData.AryText[i];
53083
53405
 
53406
+ var titleWidth=0;
53084
53407
  if (item.Title)
53085
53408
  {
53086
53409
  this.Canvas.textAlign="left";
53087
53410
  this.Canvas.fillStyle=item.TitleColor;
53088
53411
  this.Canvas.fillText(item.Title,left,top);
53412
+ var titleWidth=this.Canvas.measureText(item.Title).width+2;
53089
53413
  }
53090
53414
 
53091
53415
  if (item.Text)
53092
53416
  {
53093
- this.Canvas.textAlign="right";
53094
- this.Canvas.fillStyle=item.Color;
53095
- this.Canvas.fillText(item.Text,right,top);
53417
+ if (item.TextAlign==1) //1=左对齐 0=右对齐
53418
+ {
53419
+ var yText=left+titleWidth+2;
53420
+ if (IFrameSplitOperator.IsNumber(item.Space)) yText+=item.Space; //标题和数据内容间距
53421
+ this.Canvas.textAlign="left";
53422
+ this.Canvas.fillStyle=item.Color;
53423
+ this.Canvas.fillText(item.Text,yText,top);
53424
+ }
53425
+ else
53426
+ {
53427
+ this.Canvas.textAlign="right";
53428
+ this.Canvas.fillStyle=item.Color;
53429
+ this.Canvas.fillText(item.Text,right,top);
53430
+ }
53096
53431
  }
53097
-
53432
+
53098
53433
  top+=this.LineHeight+this.LineSpace;
53099
53434
  }
53100
53435
 
@@ -57262,6 +57597,8 @@ function LatestPointFlashPaint()
57262
57597
  this.ClassName='LatestPointFlashPaint';
57263
57598
  this.HQChart;
57264
57599
 
57600
+ this.FlashType=0; //0=数据更新了闪烁, 1=一直显示
57601
+ //闪烁
57265
57602
  this.Status=0;
57266
57603
  this.UpdateTime=new Date();
57267
57604
  this.FlashCount=0; //闪烁次数
@@ -57286,6 +57623,7 @@ function LatestPointFlashPaint()
57286
57623
  if (option)
57287
57624
  {
57288
57625
  if (IFrameSplitOperator.IsNumber(option.Frequency)) this.Frequency=option.Frequency;
57626
+ if (IFrameSplitOperator.IsNumber(option.FlashType)) this.FlashType=option.FlashType;
57289
57627
  }
57290
57628
  }
57291
57629
 
@@ -57320,18 +57658,32 @@ function LatestPointFlashPaint()
57320
57658
  if (!this.HQChart) return;
57321
57659
  this.HQChart.ClearCanvas(this.FlashCanvas);
57322
57660
 
57323
- if (this.FlashCount<=0) return;
57324
- if (this.IsStatusChange())
57661
+ if (this.FlashType===1)
57662
+ {
57663
+
57664
+ }
57665
+ else
57325
57666
  {
57326
- this.Status=(this.Status+1)%2;
57327
- --this.FlashCount;
57667
+ if (this.FlashCount<=0) return;
57668
+ if (this.IsStatusChange())
57669
+ {
57670
+ this.Status=(this.Status+1)%2;
57671
+ --this.FlashCount;
57672
+ }
57673
+ if (this.Status==0) return;
57328
57674
  }
57675
+
57676
+
57329
57677
 
57330
- if (this.Status==0) return;
57331
57678
  if (!this.HQChart.GlobalOption || !this.HQChart.GlobalOption.LatestPoint) return;
57332
57679
  var point=this.HQChart.GlobalOption.LatestPoint;
57333
57680
  if (!IFrameSplitOperator.IsNumber(point.X) || !IFrameSplitOperator.IsNumber(point.Y)) return;
57334
57681
 
57682
+ this.DrawPoint(point);
57683
+ }
57684
+
57685
+ this.DrawPoint=function(point)
57686
+ {
57335
57687
  if (this.Style==1) this.GetChartColor();
57336
57688
 
57337
57689
  this.FlashCanvas.fillStyle=this.BGColor;
@@ -82465,7 +82817,7 @@ function JSChartResource()
82465
82817
  //虚线配置
82466
82818
  this.DOTLINE=
82467
82819
  {
82468
- LineDash:[3,5] //虚线配置
82820
+ LineDash:[2*GetDevicePixelRatio(),2*GetDevicePixelRatio()] //虚线配置
82469
82821
  }
82470
82822
 
82471
82823
  this.DRAWSL=
@@ -89721,7 +90073,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
89721
90073
  this.ClearCustomKLine();
89722
90074
  this.ClearKLineCaluate();
89723
90075
  this.UnlockCorssCursor();
89724
-
90076
+ this.ClearDrawStatusData();
89725
90077
 
89726
90078
  var kLineDrawType=this.GetKLineDrawType();
89727
90079
  if (kLineDrawType==10 || kLineDrawType==11 || kLineDrawType==12 || kLineDrawType==16) isDataTypeChange=true;
@@ -91126,7 +91478,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
91126
91478
  this.UnlockCorssCursor();
91127
91479
  this.Frame.ClearYCoordinateMaxMin();
91128
91480
  this.ClosePopMinuteChart();
91129
-
91481
+ this.ClearDrawStatusData();
91130
91482
 
91131
91483
  this.Symbol=symbol;
91132
91484
  if (!symbol)
@@ -97740,6 +98092,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
97740
98092
  this.ClearStockCache();
97741
98093
  this.UnlockCorssCursor();
97742
98094
  this.Frame.ClearYCoordinateMaxMin();
98095
+ this.ClearDrawStatusData();
97743
98096
 
97744
98097
 
97745
98098
  if (option)
@@ -97908,6 +98261,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
97908
98261
  this.ClearStockCache();
97909
98262
  this.UnlockCorssCursor();
97910
98263
  this.Frame.ClearYCoordinateMaxMin();
98264
+ this.ClearDrawStatusData();
97911
98265
 
97912
98266
  if (option && option.PageInfo)
97913
98267
  {
@@ -115161,22 +115515,50 @@ function JSAlgorithm(errorHandler,symbolData)
115161
115515
  this.FILTERX=function(data, n, node)
115162
115516
  {
115163
115517
  var result=[];
115164
- for(let i=0,j=0; i<data.length; ++i)
115518
+ if (IFrameSplitOperator.IsNumber(n))
115165
115519
  {
115166
- if (data[i])
115520
+ for(var i=data.length-1, j=0; i>=0; --i)
115167
115521
  {
115168
- result[i]=1;
115169
- for(j=0;j<n && i-j-1>=0;++j)
115522
+ if (data[i])
115170
115523
  {
115171
- result[i-j-1]=0;
115524
+ result[i]=1;
115525
+ for(j=0;j<n && i-j-1>=0;++j)
115526
+ {
115527
+ result[i-j-1]=0;
115528
+ }
115529
+ i-=n;
115530
+ }
115531
+ else
115532
+ {
115533
+ result[i]=0;
115172
115534
  }
115173
- i+=n;
115174
115535
  }
115175
- else
115536
+ }
115537
+ else if (Array.isArray(n))
115538
+ {
115539
+ for(var i=data.length-1, j=0; i>=0; --i)
115176
115540
  {
115177
- result[i]=0;
115541
+ if (data[i])
115542
+ {
115543
+ result[i]=1;
115544
+ if (!IFrameSplitOperator.IsNumber(n[i])) continue;
115545
+ var period=parseInt(n[i]);
115546
+ if (period<=0) continue;
115547
+
115548
+ for(j=0;j<period && i-j-1>=0;++j)
115549
+ {
115550
+ result[i-j-1]=0;
115551
+ }
115552
+
115553
+ i-=period;
115554
+ }
115555
+ else
115556
+ {
115557
+ result[i]=0;
115558
+ }
115178
115559
  }
115179
115560
  }
115561
+
115180
115562
 
115181
115563
  return result;
115182
115564
  }
@@ -119614,6 +119996,7 @@ function JSDraw(errorHandler,symbolData)
119614
119996
  return result;
119615
119997
  }
119616
119998
 
119999
+ //只有条件==1 才显示文字
119617
120000
  this.DRAWTEXT=function(condition,price,text)
119618
120001
  {
119619
120002
  let drawData=[];
@@ -119631,11 +120014,11 @@ function JSDraw(errorHandler,symbolData)
119631
120014
  isFixedPosition=true;
119632
120015
  }
119633
120016
 
119634
- for(var i in condition)
120017
+ for(var i=0;i<condition.length;++i)
119635
120018
  {
119636
120019
  drawData[i]=null;
119637
120020
 
119638
- if (isNaN(condition[i]) || !condition[i]) continue;
120021
+ if (condition[i]!==1) continue;
119639
120022
 
119640
120023
  if (IsNumber || isFixedPosition)
119641
120024
  {
@@ -119647,7 +120030,7 @@ function JSDraw(errorHandler,symbolData)
119647
120030
  }
119648
120031
  }
119649
120032
  }
119650
- else if (this.IsNumber(condition) && condition)
120033
+ else if (this.IsNumber(condition) && condition===1)
119651
120034
  {
119652
120035
  var IsNumber=this.IsNumber(price);
119653
120036
  var isFixedPosition=false;
@@ -119673,20 +120056,21 @@ function JSDraw(errorHandler,symbolData)
119673
120056
  return result;
119674
120057
  }
119675
120058
 
120059
+ //1.固定位置显示文字;2.在指标排序中显示字符串栏目.
120060
+ //用法:DRAWTEXT_FIX(COND,X,Y,TYPE,TEXT),COND中一般需要加ISLASTBAR,当COND条件满足时,在当前指标窗口内(X,Y)位置书写文字TEXT,X,Y为书写点在窗口中相对于左上角的百分比,TYPE:0为左对齐,1为右对齐,2=居中.
120061
+ //例如:DRAWTEXT_FIX(ISLASTBAR AND CLOSE/OPEN>1.08,0.5,0.5,0,'大阳线')表示最后一个交易日实体阳线大于8%时在窗口中间位置显示'大阳线'字样.若文字中含有&,则进行折行.最多只能显示250个字符
119676
120062
  this.DRAWTEXT_FIX=function(condition,x,y,type,text)
119677
120063
  {
119678
120064
  var drawData={ Value:[], Text:[] };
119679
120065
  var result={DrawData:drawData, DrawType:'DRAWTEXT_FIX', Text:null, Position:{ X:x, Y:y, Type:type } };
119680
- if (condition.length<=0) return result;
119681
-
120066
+
119682
120067
  if (Array.isArray(condition))
119683
120068
  {
119684
-
119685
- for(var i in condition)
120069
+ for(var i=0; i<condition.length; ++i)
119686
120070
  {
119687
120071
  drawData.Text[i]=null;
119688
120072
  drawData.Value[i]=0;
119689
- if (isNaN(condition[i]) || !condition[i]) continue;
120073
+ if (condition[i]!==1) continue;
119690
120074
 
119691
120075
  drawData.Value[i]=1;
119692
120076
  drawData.Text[i]=text;
@@ -119694,7 +120078,7 @@ function JSDraw(errorHandler,symbolData)
119694
120078
  }
119695
120079
  else
119696
120080
  {
119697
- if(condition)
120081
+ if(condition===1)
119698
120082
  {
119699
120083
  for(var i=0;i<this.SymbolData.Data.Data.length;++i)
119700
120084
  {
@@ -119835,6 +120219,17 @@ function JSDraw(errorHandler,symbolData)
119835
120219
  let bSecondPont=false;
119836
120220
  let lineCache={Start:{ },End:{ }, List:new Array()};
119837
120221
 
120222
+ function CopyLineData(aryDest, arySrc)
120223
+ {
120224
+ if (!IFrameSplitOperator.IsNonEmptyArray(arySrc)) return;
120225
+
120226
+ for(var j=0; j<arySrc.length; ++j)
120227
+ {
120228
+ var item=arySrc[j];
120229
+ aryDest[item.ID]=item.Value;
120230
+ }
120231
+ }
120232
+
119838
120233
  for(let i=0;i<count;++i)
119839
120234
  {
119840
120235
  drawData[i]=null;
@@ -119861,6 +120256,16 @@ function JSDraw(errorHandler,symbolData)
119861
120256
  {
119862
120257
  bSecondPont=true;
119863
120258
  lineCache.End={ID:i, Value:data2[i]}; //第2个点
120259
+
120260
+ if (condition[i])
120261
+ {
120262
+ var lineData=this.CalculateDrawLine(lineCache); //计算2个点的线上 其他点的数值
120263
+ CopyLineData(drawData,lineData);
120264
+
120265
+ bFirstPoint=true;
120266
+ bSecondPont=false;
120267
+ lineCache.Start={ID:i, Value:data[i]}; //第1个点
120268
+ }
119864
120269
  }
119865
120270
  }
119866
120271
  else if (bFirstPoint==true && bSecondPont==true)
@@ -119872,13 +120277,8 @@ function JSDraw(errorHandler,symbolData)
119872
120277
  }
119873
120278
  else if (condition[i]) //条件1满足
119874
120279
  {
119875
- let lineData=this.CalculateDrawLine(lineCache); //计算2个点的线上 其他点的数值
119876
-
119877
- for(let j in lineData)
119878
- {
119879
- let item=lineData[j];
119880
- drawData[item.ID]=item.Value;
119881
- }
120280
+ var lineData=this.CalculateDrawLine(lineCache); //计算2个点的线上 其他点的数值
120281
+ CopyLineData(drawData,lineData);
119882
120282
 
119883
120283
  if (expand==1) this.CalculateDrawDataExtendLine(drawData, lineCache.Start.ID-2);//右延长线
119884
120284
 
@@ -119895,12 +120295,9 @@ function JSDraw(errorHandler,symbolData)
119895
120295
  //最后一组线
119896
120296
  if (bFirstPoint==true && bSecondPont==true)
119897
120297
  {
119898
- let lineData=this.CalculateDrawLine(lineCache);
119899
- for(let j in lineData)
119900
- {
119901
- let item=lineData[j];
119902
- drawData[item.ID]=item.Value;
119903
- }
120298
+ var lineData=this.CalculateDrawLine(lineCache);
120299
+ CopyLineData(drawData,lineData);
120300
+
119904
120301
  }
119905
120302
  }
119906
120303
 
@@ -120417,7 +120814,13 @@ function JSDraw(errorHandler,symbolData)
120417
120814
  {
120418
120815
  if (!numberData) return null;
120419
120816
 
120420
- if (numberData.DataType==1) return numberData.SingleValue;
120817
+ if (numberData.DataType==1)
120818
+ {
120819
+ var value=numberData.SingleValue;
120820
+ if (IFrameSplitOperator.IsNumber(value)) return value.toFixed(decimal);
120821
+ else if (value) return value.toString();
120822
+ else return null;
120823
+ }
120421
120824
 
120422
120825
  if (!IFrameSplitOperator.IsNonEmptyArray(numberData.ArrayValue)) return null;
120423
120826
 
@@ -120433,10 +120836,10 @@ function JSDraw(errorHandler,symbolData)
120433
120836
 
120434
120837
  /*
120435
120838
  固定位置显示数字.
120436
- 用法: DRAWNUMBER_FIX(COND,X,Y,TYPE,NUMBER),当COND条件满足时,在当前指标窗口内(X,Y)位置书写数字NUMBER,X,Y为书写点在窗口中相对于左上角的百分比,TYPE:0为左对齐,1为右对齐.
120839
+ 用法: DRAWNUMBER_FIX(COND,X,Y,TYPE,NUMBER,decimal=2),当COND条件满足时,在当前指标窗口内(X,Y)位置书写数字NUMBER,X,Y为书写点在窗口中相对于左上角的百分比,TYPE:0为左对齐,1为右对齐 2=居中
120437
120840
  例如: DRAWNUMBER_FIX(CURRBARSCOUNT=1 AND CLOSE/OPEN>1.08,0.5,0.5,0,C)表示最后一个交易日实体阳线大于8%时在窗口中间位置显示收盘价.
120438
120841
  */
120439
- this.DRAWNUMBER_FIX=function(condition,x,y,align,data)
120842
+ this.DRAWNUMBER_FIX=function(condition,x,y,align,data, decimal=2)
120440
120843
  {
120441
120844
  var drawData={ Value:[], Text:[], };
120442
120845
  var result={ DrawData:drawData, DrawType:'DRAWNUMBER_FIX', Position:{ X:x, Y:y, Type:align } };
@@ -120444,15 +120847,15 @@ function JSDraw(errorHandler,symbolData)
120444
120847
 
120445
120848
  if (Array.isArray(condition))
120446
120849
  {
120447
- for(var i in condition)
120850
+ for(var i=0; i<condition.length; ++i)
120448
120851
  {
120449
120852
  drawData.Text[i]=null;
120450
120853
  drawData.Value[i]=null;
120451
- if (!condition[i]) continue;
120854
+ if (condition[i]!==1) continue;
120452
120855
 
120453
120856
  if (isNumber)
120454
120857
  {
120455
- drawData.Text[i]=this.RemoveZero(data.toFixed(2));
120858
+ drawData.Text[i]=this.RemoveZero(data.toFixed(decimal));
120456
120859
  drawData.Value[i]=data;
120457
120860
  }
120458
120861
  else
@@ -120460,14 +120863,14 @@ function JSDraw(errorHandler,symbolData)
120460
120863
  if (i>=data.length || !IFrameSplitOperator.IsNumber(data[i])) continue;
120461
120864
 
120462
120865
  var item=data[i];
120463
- drawData.Text[i]=this.RemoveZero(item.toFixed(2));
120866
+ drawData.Text[i]=this.RemoveZero(item.toFixed(decimal));
120464
120867
  drawData.Value[i]=item;
120465
120868
  }
120466
120869
  }
120467
120870
  }
120468
120871
  else
120469
120872
  {
120470
- if(!condition)
120873
+ if(condition!==1)
120471
120874
  {
120472
120875
 
120473
120876
  }
@@ -120477,7 +120880,7 @@ function JSDraw(errorHandler,symbolData)
120477
120880
  {
120478
120881
  if (isNumber)
120479
120882
  {
120480
- drawData.Text[i]=this.RemoveZero(data.toFixed(2));
120883
+ drawData.Text[i]=this.RemoveZero(data.toFixed(decimal));
120481
120884
  drawData.Value[i]=data;
120482
120885
  }
120483
120886
  else
@@ -120485,7 +120888,7 @@ function JSDraw(errorHandler,symbolData)
120485
120888
  if (i>=data.length || !IFrameSplitOperator.IsNumber(data[i])) continue;
120486
120889
 
120487
120890
  var item=data[i];
120488
- drawData.Text[i]=this.RemoveZero(item.toFixed(2));
120891
+ drawData.Text[i]=this.RemoveZero(item.toFixed(decimal));
120489
120892
  drawData.Value[i]=item;
120490
120893
  }
120491
120894
  }
@@ -120803,6 +121206,12 @@ function JSDraw(errorHandler,symbolData)
120803
121206
  return rgba;
120804
121207
  }
120805
121208
 
121209
+ //设置字体
121210
+ this.CSSFONT=function(strFont)
121211
+ {
121212
+ return strFont;
121213
+ }
121214
+
120806
121215
  this.UPCOLOR=function(color)
120807
121216
  {
120808
121217
  return color;
@@ -127848,6 +128257,7 @@ function JSExecute(ast,option)
127848
128257
  let xOffset=null, yOffset=null;
127849
128258
  var klineType=null;
127850
128259
  var lineDash=null;
128260
+ var font=null;
127851
128261
  for(let j=0; j<item.Expression.Expression.length; ++j)
127852
128262
  {
127853
128263
  let itemExpression=item.Expression.Expression[j];
@@ -127964,6 +128374,10 @@ function JSExecute(ast,option)
127964
128374
  {
127965
128375
  downColor=itemExpression.Out;
127966
128376
  }
128377
+ else if (itemExpression.Callee.Name=="CSSFONT")
128378
+ {
128379
+ font=itemExpression.Out;
128380
+ }
127967
128381
  else if (itemExpression.Callee.Name=="STICKTYPE")
127968
128382
  {
127969
128383
  stickType=itemExpression.Out;
@@ -128166,6 +128580,7 @@ function JSExecute(ast,option)
128166
128580
  if (drawAlign>=0) outVar.DrawAlign=drawAlign;
128167
128581
  if (drawVAlign>=0) outVar.DrawVAlign=drawVAlign;
128168
128582
  if (fontSize>0) outVar.DrawFontSize=fontSize;
128583
+ if (font) outVar.Font=font;
128169
128584
  if (bgConfig) outVar.Background=bgConfig;
128170
128585
  if (vLineConfig) outVar.VerticalLine=vLineConfig;
128171
128586
  if (IFrameSplitOperator.IsNumber(xOffset)) outVar.XOffset=xOffset;
@@ -128647,7 +129062,7 @@ function JSExecute(ast,option)
128647
129062
  node.Out=node.Draw.DrawData.Value;
128648
129063
  break;
128649
129064
  case "DRAWNUMBER_FIX":
128650
- node.Draw=this.Draw.DRAWNUMBER_FIX(args[0],args[1],args[2],args[3],args[4]);
129065
+ node.Draw=this.Draw.DRAWNUMBER_FIX(args[0],args[1],args[2],args[3],args[4], args[5]);
128651
129066
  node.Out=node.Draw.DrawData.Value;
128652
129067
  break;
128653
129068
  case "DRAWCHANNEL":
@@ -128666,6 +129081,9 @@ function JSExecute(ast,option)
128666
129081
  case "DOWNCOLOR":
128667
129082
  node.Out=this.Draw.DOWNCOLOR(args[0]);
128668
129083
  break;
129084
+ case "CSSFONT":
129085
+ node.Out=this.Draw.CSSFONT(args[0]);
129086
+ break;
128669
129087
  case "STICKTYPE": //柱子类型
128670
129088
  node.Out=this.Draw.STICKTYPE(args[0]);
128671
129089
  break;
@@ -131380,6 +131798,7 @@ function ScriptIndex(name,script,args,option)
131380
131798
  }
131381
131799
 
131382
131800
  if (varItem.DrawFontSize>0) chartText.FixedFontSize=varItem.DrawFontSize;
131801
+ if (varItem.Font) chartText.Font=varItem.Font;
131383
131802
  if (varItem.Background) chartText.TextBG=varItem.Background;
131384
131803
  if (varItem.VerticalLine) chartText.VerticalLine=varItem.VerticalLine;
131385
131804
 
@@ -131535,6 +131954,12 @@ function ScriptIndex(name,script,args,option)
131535
131954
  let width=parseInt(varItem.LineWidth.replace("LINETHICK",""));
131536
131955
  if (!isNaN(width) && width>0) line.LineWidth=width;
131537
131956
  }
131957
+
131958
+ if (varItem.IsDotLine)
131959
+ {
131960
+ line.IsDotLine=true; //虚线
131961
+ line.LineDash=g_JSChartResource.DOTLINE.LineDash.slice();
131962
+ }
131538
131963
 
131539
131964
  let titleIndex=windowIndex+1;
131540
131965
  line.Data.Data=varItem.Draw.DrawData;
@@ -132114,6 +132539,102 @@ function ScriptIndex(name,script,args,option)
132114
132539
  hqChart.ChartPaint.push(chartText);
132115
132540
  }
132116
132541
 
132542
+ this.CreateDrawText_Fix=function(hqChart,windowIndex,varItem,id)
132543
+ {
132544
+ var chartText=new ChartDrawText_Fix();
132545
+ chartText.Canvas=hqChart.Canvas;
132546
+ chartText.Name=varItem.Name;
132547
+ chartText.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;
132548
+ chartText.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;
132549
+ chartText.ReloadResource();
132550
+ chartText.HQChart=hqChart;
132551
+
132552
+ if (varItem.Draw.Position)
132553
+ {
132554
+ var item=varItem.Draw.Position;
132555
+ chartText.PtPercentage={ X:item.X, Y:item.Y }; //坐标
132556
+ // TYPE:0为左对齐,1为右对齐 2=居中
132557
+ if (item.Type===0) chartText.TextAlign="left";
132558
+ else if (item.Type===1) chartText.TextAlign="right";
132559
+ else if (item.Type===2) chartText.TextAlign="center";
132560
+ }
132561
+
132562
+ //字体
132563
+ if (varItem.DrawFontSize>0) chartText.TextFont=`${varItem.DrawFontSize*GetDevicePixelRatio()}px 微软雅黑`; //临时用下吧
132564
+ if (varItem.Font) chartText.TextFont=varItem.Font;
132565
+
132566
+ //颜色
132567
+ if (varItem.Color) chartText.Color=this.GetColor(varItem.Color);
132568
+ else chartText.Color=this.GetDefaultColor(id);
132569
+
132570
+ if (varItem.DrawVAlign>=0) //上下对齐
132571
+ {
132572
+ if (varItem.DrawVAlign==0) chartText.TextBaseline='top';
132573
+ else if (varItem.DrawVAlign==1) chartText.TextBaseline='middle';
132574
+ else if (varItem.DrawVAlign==2) chartText.TextBaseline='bottom';
132575
+ }
132576
+
132577
+ if (varItem.DrawAlign>=0) // 左右对齐
132578
+ {
132579
+ if (varItem.DrawAlign==0) chartText.TextAlign="left";
132580
+ else if (varItem.DrawAlign==1) chartText.TextAlign="center";
132581
+ else if (varItem.DrawAlign==2) chartText.TextAlign='right';
132582
+ }
132583
+
132584
+ chartText.BuildCacheData(hqChart.GetKData(),varItem.Draw.DrawData);
132585
+
132586
+ this.SetChartIndexName(chartText);
132587
+ hqChart.ChartPaint.push(chartText);
132588
+ }
132589
+
132590
+ this.CreateDrawNumber_Fix=function(hqChart,windowIndex,varItem,id)
132591
+ {
132592
+ var chartText=new ChartDrawNumber_Fix();
132593
+ chartText.Canvas=hqChart.Canvas;
132594
+ chartText.Name=varItem.Name;
132595
+ chartText.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;
132596
+ chartText.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;
132597
+ chartText.ReloadResource();
132598
+ chartText.HQChart=hqChart;
132599
+
132600
+ if (varItem.Draw.Position)
132601
+ {
132602
+ var item=varItem.Draw.Position;
132603
+ chartText.PtPercentage={ X:item.X, Y:item.Y }; //坐标
132604
+ // TYPE:0为左对齐,1为右对齐 2=居中
132605
+ if (item.Type===0) chartText.TextAlign="left";
132606
+ else if (item.Type===1) chartText.TextAlign="right";
132607
+ else if (item.Type===2) chartText.TextAlign="center";
132608
+ }
132609
+
132610
+ //字体
132611
+ if (varItem.DrawFontSize>0) chartText.TextFont=`${varItem.DrawFontSize*GetDevicePixelRatio()}px 微软雅黑`; //临时用下吧
132612
+ if (varItem.Font) chartText.TextFont=varItem.Font;
132613
+
132614
+ //颜色
132615
+ if (varItem.Color) chartText.Color=this.GetColor(varItem.Color);
132616
+ else chartText.Color=this.GetDefaultColor(id);
132617
+
132618
+ if (varItem.DrawVAlign>=0) //上下对齐
132619
+ {
132620
+ if (varItem.DrawVAlign==0) chartText.TextBaseline='top';
132621
+ else if (varItem.DrawVAlign==1) chartText.TextBaseline='middle';
132622
+ else if (varItem.DrawVAlign==2) chartText.TextBaseline='bottom';
132623
+ }
132624
+
132625
+ if (varItem.DrawAlign>=0) // 左右对齐
132626
+ {
132627
+ if (varItem.DrawAlign==0) chartText.TextAlign="left";
132628
+ else if (varItem.DrawAlign==1) chartText.TextAlign="center";
132629
+ else if (varItem.DrawAlign==2) chartText.TextAlign='right';
132630
+ }
132631
+
132632
+ chartText.BuildCacheData(hqChart.GetKData(),varItem.Draw.DrawData);
132633
+
132634
+ this.SetChartIndexName(chartText);
132635
+ hqChart.ChartPaint.push(chartText);
132636
+ }
132637
+
132117
132638
  this.CreateDrawText=function(hqChart,windowIndex,varItem,id)
132118
132639
  {
132119
132640
  let chartText=new ChartSingleText();
@@ -132930,8 +133451,10 @@ function ScriptIndex(name,script,args,option)
132930
133451
  this.CreateDrawNumber(hqChart,windowIndex,item,i);
132931
133452
  break;
132932
133453
  case "DRAWNUMBER_FIX":
133454
+ this.CreateDrawNumber_Fix(hqChart,windowIndex,item,i);
133455
+ break;
132933
133456
  case 'DRAWTEXT_FIX':
132934
- this.CreateNumberText(hqChart,windowIndex,item,i);
133457
+ this.CreateDrawText_Fix(hqChart,windowIndex,item,i);
132935
133458
  break;
132936
133459
  case 'DRAWICON':
132937
133460
  this.CreateIcon(hqChart,windowIndex,item,i);
@@ -133323,9 +133846,13 @@ function OverlayScriptIndex(name,script,args,option)
133323
133846
  this.CreateBackgroud(hqChart,windowIndex,item,i);
133324
133847
  break;
133325
133848
  case 'DRAWNUMBER':
133849
+ this.CreateNumberText(hqChart,windowIndex,item,i);
133850
+ break;
133326
133851
  case "DRAWNUMBER_FIX":
133852
+ this.CreateDrawNumber_Fix(hqChart,windowIndex,item,i);
133853
+ break;
133327
133854
  case 'DRAWTEXT_FIX':
133328
- this.CreateNumberText(hqChart,windowIndex,item,i);
133855
+ this.CreateDrawText_Fix(hqChart,windowIndex,item,i);
133329
133856
  break;
133330
133857
  case 'DRAWICON':
133331
133858
  this.CreateIcon(hqChart,windowIndex,item,i);
@@ -133667,6 +134194,7 @@ function OverlayScriptIndex(name,script,args,option)
133667
134194
  }
133668
134195
 
133669
134196
  if (varItem.DrawFontSize>0) chartText.FixedFontSize=varItem.DrawFontSize;
134197
+ if (varItem.Font) chartText.Font=varItem.Font;
133670
134198
  if (varItem.Background) chartText.TextBG=varItem.Background;
133671
134199
  if (varItem.VerticalLine) chartText.VerticalLine=varItem.VerticalLine;
133672
134200
  if (IFrameSplitOperator.IsNumber(varItem.XOffset)) chartText.ShowOffset.X=varItem.XOffset;
@@ -133865,6 +134393,12 @@ function OverlayScriptIndex(name,script,args,option)
133865
134393
  let width=parseInt(varItem.LineWidth.replace("LINETHICK",""));
133866
134394
  if (!isNaN(width) && width>0) chart.LineWidth=width;
133867
134395
  }
134396
+
134397
+ if (varItem.IsDotLine)
134398
+ {
134399
+ chart.IsDotLine=true; //虚线
134400
+ chart.LineDash=g_JSChartResource.DOTLINE.LineDash.slice();
134401
+ }
133868
134402
 
133869
134403
  let titleIndex=windowIndex+1;
133870
134404
  chart.Data.Data=varItem.Draw.DrawData;
@@ -134034,6 +134568,110 @@ function OverlayScriptIndex(name,script,args,option)
134034
134568
  frame.ChartPaint.push(chart);
134035
134569
  }
134036
134570
 
134571
+ this.CreateDrawText_Fix=function(hqChart,windowIndex,varItem,id)
134572
+ {
134573
+ var overlayIndex=this.OverlayIndex;
134574
+ var frame=overlayIndex.Frame;
134575
+ var chart=new ChartDrawText_Fix();
134576
+ chart.Canvas=hqChart.Canvas;
134577
+
134578
+ chart.Name=varItem.Name;
134579
+ chart.ChartBorder=frame.Frame.ChartBorder;
134580
+ chart.ChartFrame=frame.Frame;
134581
+ chart.Identify=overlayIndex.Identify;
134582
+ chart.ReloadResource();
134583
+ chart.HQChart=hqChart;
134584
+
134585
+ if (varItem.Draw.Position)
134586
+ {
134587
+ var item=varItem.Draw.Position;
134588
+ chart.PtPercentage={ X:item.X, Y:item.Y }; //坐标
134589
+ // TYPE:0为左对齐,1为右对齐 2=居中
134590
+ if (item.Type===0) chart.TextAlign="left";
134591
+ else if (item.Type===1) chart.TextAlign="right";
134592
+ else if (item.Type===2) chart.TextAlign="center";
134593
+ }
134594
+
134595
+ //字体
134596
+ if (varItem.DrawFontSize>0) chart.TextFont=`${varItem.DrawFontSize*GetDevicePixelRatio()}px 微软雅黑`; //临时用下吧
134597
+ if (varItem.Font) chart.TextFont=varItem.Font;
134598
+
134599
+ //颜色
134600
+ if (varItem.Color) chart.Color=this.GetColor(varItem.Color);
134601
+ else chart.Color=this.GetDefaultColor(id);
134602
+
134603
+ if (varItem.DrawVAlign>=0) //上下对齐
134604
+ {
134605
+ if (varItem.DrawVAlign==0) chart.TextBaseline='top';
134606
+ else if (varItem.DrawVAlign==1) chart.TextBaseline='middle';
134607
+ else if (varItem.DrawVAlign==2) chart.TextBaseline='bottom';
134608
+ }
134609
+
134610
+ if (varItem.DrawAlign>=0) // 左右对齐
134611
+ {
134612
+ if (varItem.DrawAlign==0) chart.TextAlign="left";
134613
+ else if (varItem.DrawAlign==1) chart.TextAlign="center";
134614
+ else if (varItem.DrawAlign==2) chart.TextAlign='right';
134615
+ }
134616
+
134617
+ chart.BuildCacheData(hqChart.GetKData(),varItem.Draw.DrawData);
134618
+
134619
+ this.SetChartIndexName(chart);
134620
+ frame.ChartPaint.push(chart);
134621
+ }
134622
+
134623
+ this.CreateDrawNumber_Fix=function(hqChart,windowIndex,varItem,id)
134624
+ {
134625
+ var overlayIndex=this.OverlayIndex;
134626
+ var frame=overlayIndex.Frame;
134627
+ var chart=new ChartDrawNumber_Fix();
134628
+ chart.Canvas=hqChart.Canvas;
134629
+
134630
+ chart.Name=varItem.Name;
134631
+ chart.ChartBorder=frame.Frame.ChartBorder;
134632
+ chart.ChartFrame=frame.Frame;
134633
+ chart.Identify=overlayIndex.Identify;
134634
+ chart.ReloadResource();
134635
+ chart.HQChart=hqChart;
134636
+
134637
+ if (varItem.Draw.Position)
134638
+ {
134639
+ var item=varItem.Draw.Position;
134640
+ chart.PtPercentage={ X:item.X, Y:item.Y }; //坐标
134641
+ // TYPE:0为左对齐,1为右对齐 2=居中
134642
+ if (item.Type===0) chart.TextAlign="left";
134643
+ else if (item.Type===1) chart.TextAlign="right";
134644
+ else if (item.Type===2) chart.TextAlign="center";
134645
+ }
134646
+
134647
+ //字体
134648
+ if (varItem.DrawFontSize>0) chart.TextFont=`${varItem.DrawFontSize*GetDevicePixelRatio()}px 微软雅黑`; //临时用下吧
134649
+ if (varItem.Font) chart.TextFont=varItem.Font;
134650
+
134651
+ //颜色
134652
+ if (varItem.Color) chart.Color=this.GetColor(varItem.Color);
134653
+ else chart.Color=this.GetDefaultColor(id);
134654
+
134655
+ if (varItem.DrawVAlign>=0) //上下对齐
134656
+ {
134657
+ if (varItem.DrawVAlign==0) chart.TextBaseline='top';
134658
+ else if (varItem.DrawVAlign==1) chart.TextBaseline='middle';
134659
+ else if (varItem.DrawVAlign==2) chart.TextBaseline='bottom';
134660
+ }
134661
+
134662
+ if (varItem.DrawAlign>=0) // 左右对齐
134663
+ {
134664
+ if (varItem.DrawAlign==0) chart.TextAlign="left";
134665
+ else if (varItem.DrawAlign==1) chart.TextAlign="center";
134666
+ else if (varItem.DrawAlign==2) chart.TextAlign='right';
134667
+ }
134668
+
134669
+ chart.BuildCacheData(hqChart.GetKData(),varItem.Draw.DrawData);
134670
+
134671
+ this.SetChartIndexName(chart);
134672
+ frame.ChartPaint.push(chart);
134673
+ }
134674
+
134037
134675
  this.CreateTextLine=function(hqChart,windowIndex,varItem,id)
134038
134676
  {
134039
134677
  var overlayIndex=this.OverlayIndex;
@@ -154293,7 +154931,7 @@ function ScrollBarBGChart()
154293
154931
 
154294
154932
 
154295
154933
 
154296
- var HQCHART_VERSION="1.1.15257";
154934
+ var HQCHART_VERSION="1.1.15291";
154297
154935
 
154298
154936
  function PrintHQChartVersion()
154299
154937
  {