hqchart 1.1.15273 → 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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hqchart",
3
- "version": "1.1.15273",
3
+ "version": "1.1.15292",
4
4
  "description": "HQChart - H5, 微信小程序 沪深/港股/数字货币/期货/美股 K线图(kline),走势图,缩放,拖拽,十字光标,画图工具,截图,筹码图. 分析家语法,通达信语法,(麦语法),第3方数据对接",
5
5
  "main": "lib/main.js",
6
6
  "scripts": {
@@ -9841,6 +9841,17 @@ function JSDraw(errorHandler,symbolData)
9841
9841
  let bSecondPont=false;
9842
9842
  let lineCache={Start:{ },End:{ }, List:new Array()};
9843
9843
 
9844
+ function CopyLineData(aryDest, arySrc)
9845
+ {
9846
+ if (!IFrameSplitOperator.IsNonEmptyArray(arySrc)) return;
9847
+
9848
+ for(var j=0; j<arySrc.length; ++j)
9849
+ {
9850
+ var item=arySrc[j];
9851
+ aryDest[item.ID]=item.Value;
9852
+ }
9853
+ }
9854
+
9844
9855
  for(let i=0;i<count;++i)
9845
9856
  {
9846
9857
  drawData[i]=null;
@@ -9867,6 +9878,16 @@ function JSDraw(errorHandler,symbolData)
9867
9878
  {
9868
9879
  bSecondPont=true;
9869
9880
  lineCache.End={ID:i, Value:data2[i]}; //第2个点
9881
+
9882
+ if (condition[i])
9883
+ {
9884
+ var lineData=this.CalculateDrawLine(lineCache); //计算2个点的线上 其他点的数值
9885
+ CopyLineData(drawData,lineData);
9886
+
9887
+ bFirstPoint=true;
9888
+ bSecondPont=false;
9889
+ lineCache.Start={ID:i, Value:data[i]}; //第1个点
9890
+ }
9870
9891
  }
9871
9892
  }
9872
9893
  else if (bFirstPoint==true && bSecondPont==true)
@@ -9878,13 +9899,8 @@ function JSDraw(errorHandler,symbolData)
9878
9899
  }
9879
9900
  else if (condition[i]) //条件1满足
9880
9901
  {
9881
- let lineData=this.CalculateDrawLine(lineCache); //计算2个点的线上 其他点的数值
9882
-
9883
- for(let j in lineData)
9884
- {
9885
- let item=lineData[j];
9886
- drawData[item.ID]=item.Value;
9887
- }
9902
+ var lineData=this.CalculateDrawLine(lineCache); //计算2个点的线上 其他点的数值
9903
+ CopyLineData(drawData,lineData);
9888
9904
 
9889
9905
  if (expand==1) this.CalculateDrawDataExtendLine(drawData, lineCache.Start.ID-2);//右延长线
9890
9906
 
@@ -9901,12 +9917,9 @@ function JSDraw(errorHandler,symbolData)
9901
9917
  //最后一组线
9902
9918
  if (bFirstPoint==true && bSecondPont==true)
9903
9919
  {
9904
- let lineData=this.CalculateDrawLine(lineCache);
9905
- for(let j in lineData)
9906
- {
9907
- let item=lineData[j];
9908
- drawData[item.ID]=item.Value;
9909
- }
9920
+ var lineData=this.CalculateDrawLine(lineCache);
9921
+ CopyLineData(drawData,lineData);
9922
+
9910
9923
  }
9911
9924
  }
9912
9925
 
@@ -10423,7 +10436,13 @@ function JSDraw(errorHandler,symbolData)
10423
10436
  {
10424
10437
  if (!numberData) return null;
10425
10438
 
10426
- if (numberData.DataType==1) return numberData.SingleValue;
10439
+ if (numberData.DataType==1)
10440
+ {
10441
+ var value=numberData.SingleValue;
10442
+ if (IFrameSplitOperator.IsNumber(value)) return value.toFixed(decimal);
10443
+ else if (value) return value.toString();
10444
+ else return null;
10445
+ }
10427
10446
 
10428
10447
  if (!IFrameSplitOperator.IsNonEmptyArray(numberData.ArrayValue)) return null;
10429
10448
 
@@ -10809,6 +10828,12 @@ function JSDraw(errorHandler,symbolData)
10809
10828
  return rgba;
10810
10829
  }
10811
10830
 
10831
+ //设置字体
10832
+ this.CSSFONT=function(strFont)
10833
+ {
10834
+ return strFont;
10835
+ }
10836
+
10812
10837
  this.UPCOLOR=function(color)
10813
10838
  {
10814
10839
  return color;
@@ -17854,6 +17879,7 @@ function JSExecute(ast,option)
17854
17879
  let xOffset=null, yOffset=null;
17855
17880
  var klineType=null;
17856
17881
  var lineDash=null;
17882
+ var font=null;
17857
17883
  for(let j=0; j<item.Expression.Expression.length; ++j)
17858
17884
  {
17859
17885
  let itemExpression=item.Expression.Expression[j];
@@ -17970,6 +17996,10 @@ function JSExecute(ast,option)
17970
17996
  {
17971
17997
  downColor=itemExpression.Out;
17972
17998
  }
17999
+ else if (itemExpression.Callee.Name=="CSSFONT")
18000
+ {
18001
+ font=itemExpression.Out;
18002
+ }
17973
18003
  else if (itemExpression.Callee.Name=="STICKTYPE")
17974
18004
  {
17975
18005
  stickType=itemExpression.Out;
@@ -18172,6 +18202,7 @@ function JSExecute(ast,option)
18172
18202
  if (drawAlign>=0) outVar.DrawAlign=drawAlign;
18173
18203
  if (drawVAlign>=0) outVar.DrawVAlign=drawVAlign;
18174
18204
  if (fontSize>0) outVar.DrawFontSize=fontSize;
18205
+ if (font) outVar.Font=font;
18175
18206
  if (bgConfig) outVar.Background=bgConfig;
18176
18207
  if (vLineConfig) outVar.VerticalLine=vLineConfig;
18177
18208
  if (IFrameSplitOperator.IsNumber(xOffset)) outVar.XOffset=xOffset;
@@ -18672,6 +18703,9 @@ function JSExecute(ast,option)
18672
18703
  case "DOWNCOLOR":
18673
18704
  node.Out=this.Draw.DOWNCOLOR(args[0]);
18674
18705
  break;
18706
+ case "CSSFONT":
18707
+ node.Out=this.Draw.CSSFONT(args[0]);
18708
+ break;
18675
18709
  case "STICKTYPE": //柱子类型
18676
18710
  node.Out=this.Draw.STICKTYPE(args[0]);
18677
18711
  break;
@@ -21386,6 +21420,7 @@ function ScriptIndex(name,script,args,option)
21386
21420
  }
21387
21421
 
21388
21422
  if (varItem.DrawFontSize>0) chartText.FixedFontSize=varItem.DrawFontSize;
21423
+ if (varItem.Font) chartText.Font=varItem.Font;
21389
21424
  if (varItem.Background) chartText.TextBG=varItem.Background;
21390
21425
  if (varItem.VerticalLine) chartText.VerticalLine=varItem.VerticalLine;
21391
21426
 
@@ -21541,6 +21576,12 @@ function ScriptIndex(name,script,args,option)
21541
21576
  let width=parseInt(varItem.LineWidth.replace("LINETHICK",""));
21542
21577
  if (!isNaN(width) && width>0) line.LineWidth=width;
21543
21578
  }
21579
+
21580
+ if (varItem.IsDotLine)
21581
+ {
21582
+ line.IsDotLine=true; //虚线
21583
+ line.LineDash=g_JSChartResource.DOTLINE.LineDash.slice();
21584
+ }
21544
21585
 
21545
21586
  let titleIndex=windowIndex+1;
21546
21587
  line.Data.Data=varItem.Draw.DrawData;
@@ -23775,6 +23816,7 @@ function OverlayScriptIndex(name,script,args,option)
23775
23816
  }
23776
23817
 
23777
23818
  if (varItem.DrawFontSize>0) chartText.FixedFontSize=varItem.DrawFontSize;
23819
+ if (varItem.Font) chartText.Font=varItem.Font;
23778
23820
  if (varItem.Background) chartText.TextBG=varItem.Background;
23779
23821
  if (varItem.VerticalLine) chartText.VerticalLine=varItem.VerticalLine;
23780
23822
  if (IFrameSplitOperator.IsNumber(varItem.XOffset)) chartText.ShowOffset.X=varItem.XOffset;
@@ -23973,6 +24015,12 @@ function OverlayScriptIndex(name,script,args,option)
23973
24015
  let width=parseInt(varItem.LineWidth.replace("LINETHICK",""));
23974
24016
  if (!isNaN(width) && width>0) chart.LineWidth=width;
23975
24017
  }
24018
+
24019
+ if (varItem.IsDotLine)
24020
+ {
24021
+ chart.IsDotLine=true; //虚线
24022
+ chart.LineDash=g_JSChartResource.DOTLINE.LineDash.slice();
24023
+ }
23976
24024
 
23977
24025
  let titleIndex=windowIndex+1;
23978
24026
  chart.Data.Data=varItem.Draw.DrawData;
@@ -40066,7 +40066,8 @@ function ChartDrawText()
40066
40066
 
40067
40067
  this.ClassName='ChartDrawText'; //类名
40068
40068
  this.Color="rgb(255,193,37)"; //线段颜色
40069
- this.TextFont="14px 微软雅黑"; //线段宽度
40069
+ this.Font; //固定字体
40070
+ this.TextFont="14px 微软雅黑"; //输出使用的字体
40070
40071
  this.TextBaseline="middle";
40071
40072
  this.TextAlign='left';
40072
40073
  this.Text
@@ -40141,8 +40142,9 @@ function ChartDrawText()
40141
40142
  var isArrayText=Array.isArray(this.Text);
40142
40143
  var drawTextInfo={ Text:{ Color:this.Color, Align:this.TextAlign, Baseline:this.TextBaseline }, Font:{ } };
40143
40144
 
40144
-
40145
- if (this.FixedFontSize>0) //固定字体大小模式
40145
+ if (this.Font)
40146
+ this.TextFont=this.Font;
40147
+ else if (this.FixedFontSize>0) //固定字体大小模式
40146
40148
  this.TextFont=`${this.FixedFontSize}px ${this.TextSize.FontName}`;
40147
40149
  else //动态字体大小
40148
40150
  this.TextFont=this.GetDynamicFont(dataWidth,distanceWidth,this.TextSize.Max,this.TextSize.Min,this.TextSize.Zoom,this.TextSize.FontName);
@@ -48992,6 +48994,7 @@ function KLineTooltipPaint()
48992
48994
  this.ExtendLineWidth=2;
48993
48995
 
48994
48996
  this.Font=[g_JSChartResource.TooltipPaint.TitleFont];
48997
+
48995
48998
 
48996
48999
  this.HQChart;
48997
49000
  this.KLineTitlePaint;
@@ -49111,6 +49114,8 @@ function KLineTooltipPaint()
49111
49114
  lineWidth+=textWidth;
49112
49115
  }
49113
49116
 
49117
+ if (IFrameSplitOperator.IsNumber(item.Space)) lineWidth+=item.Space;
49118
+
49114
49119
  if (maxLineWidth<lineWidth) maxLineWidth=lineWidth;
49115
49120
 
49116
49121
  height+=this.LineHeight;
@@ -49302,20 +49307,33 @@ function KLineTooltipPaint()
49302
49307
  {
49303
49308
  var item=titleData.AryText[i];
49304
49309
 
49310
+ var titleWidth=0;
49305
49311
  if (item.Title)
49306
49312
  {
49307
49313
  this.Canvas.textAlign="left";
49308
49314
  this.Canvas.fillStyle=item.TitleColor;
49309
49315
  this.Canvas.fillText(item.Title,left,top);
49316
+ var titleWidth=this.Canvas.measureText(item.Title).width+2;
49310
49317
  }
49311
49318
 
49312
49319
  if (item.Text)
49313
49320
  {
49314
- this.Canvas.textAlign="right";
49315
- this.Canvas.fillStyle=item.Color;
49316
- this.Canvas.fillText(item.Text,right,top);
49321
+ if (item.TextAlign==1) //1=左对齐 0=右对齐
49322
+ {
49323
+ var yText=left+titleWidth+2;
49324
+ if (IFrameSplitOperator.IsNumber(item.Space)) yText+=item.Space; //标题和数据内容间距
49325
+ this.Canvas.textAlign="left";
49326
+ this.Canvas.fillStyle=item.Color;
49327
+ this.Canvas.fillText(item.Text,yText,top);
49328
+ }
49329
+ else
49330
+ {
49331
+ this.Canvas.textAlign="right";
49332
+ this.Canvas.fillStyle=item.Color;
49333
+ this.Canvas.fillText(item.Text,right,top);
49334
+ }
49317
49335
  }
49318
-
49336
+
49319
49337
  top+=this.LineHeight+this.LineSpace;
49320
49338
  }
49321
49339
 
@@ -53483,6 +53501,8 @@ function LatestPointFlashPaint()
53483
53501
  this.ClassName='LatestPointFlashPaint';
53484
53502
  this.HQChart;
53485
53503
 
53504
+ this.FlashType=0; //0=数据更新了闪烁, 1=一直显示
53505
+ //闪烁
53486
53506
  this.Status=0;
53487
53507
  this.UpdateTime=new Date();
53488
53508
  this.FlashCount=0; //闪烁次数
@@ -53507,6 +53527,7 @@ function LatestPointFlashPaint()
53507
53527
  if (option)
53508
53528
  {
53509
53529
  if (IFrameSplitOperator.IsNumber(option.Frequency)) this.Frequency=option.Frequency;
53530
+ if (IFrameSplitOperator.IsNumber(option.FlashType)) this.FlashType=option.FlashType;
53510
53531
  }
53511
53532
  }
53512
53533
 
@@ -53541,18 +53562,32 @@ function LatestPointFlashPaint()
53541
53562
  if (!this.HQChart) return;
53542
53563
  this.HQChart.ClearCanvas(this.FlashCanvas);
53543
53564
 
53544
- if (this.FlashCount<=0) return;
53545
- if (this.IsStatusChange())
53565
+ if (this.FlashType===1)
53566
+ {
53567
+
53568
+ }
53569
+ else
53546
53570
  {
53547
- this.Status=(this.Status+1)%2;
53548
- --this.FlashCount;
53571
+ if (this.FlashCount<=0) return;
53572
+ if (this.IsStatusChange())
53573
+ {
53574
+ this.Status=(this.Status+1)%2;
53575
+ --this.FlashCount;
53576
+ }
53577
+ if (this.Status==0) return;
53549
53578
  }
53579
+
53580
+
53550
53581
 
53551
- if (this.Status==0) return;
53552
53582
  if (!this.HQChart.GlobalOption || !this.HQChart.GlobalOption.LatestPoint) return;
53553
53583
  var point=this.HQChart.GlobalOption.LatestPoint;
53554
53584
  if (!IFrameSplitOperator.IsNumber(point.X) || !IFrameSplitOperator.IsNumber(point.Y)) return;
53555
53585
 
53586
+ this.DrawPoint(point);
53587
+ }
53588
+
53589
+ this.DrawPoint=function(point)
53590
+ {
53556
53591
  if (this.Style==1) this.GetChartColor();
53557
53592
 
53558
53593
  this.FlashCanvas.fillStyle=this.BGColor;
@@ -78686,7 +78721,7 @@ function JSChartResource()
78686
78721
  //虚线配置
78687
78722
  this.DOTLINE=
78688
78723
  {
78689
- LineDash:[3,5] //虚线配置
78724
+ LineDash:[2*GetDevicePixelRatio(),2*GetDevicePixelRatio()] //虚线配置
78690
78725
  }
78691
78726
 
78692
78727
  this.DRAWSL=
@@ -110,7 +110,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
110
110
  'DRAWTEXT':FUNCTION_NAME,'STICKLINE':FUNCTION_NAME,'DRAWBAND':FUNCTION_NAME,'DRAWKLINE':FUNCTION_NAME,
111
111
  'PLOYLINE':FUNCTION_NAME,'POLYLINE':FUNCTION_NAME,'DRAWNUMBER':FUNCTION_NAME,'DRAWICON':FUNCTION_NAME,'SUPERDRAWTEXT':FUNCTION_NAME,
112
112
  "DRAWTEXTREL":FUNCTION_NAME,"DRAWTEXTABS":FUNCTION_NAME,"DRAWGBK":FUNCTION_NAME,"FILLRGN":FUNCTION_NAME,"FLOATRGN":FUNCTION_NAME,
113
- "HORLINE":FUNCTION_NAME,
113
+ "HORLINE":FUNCTION_NAME,"DRAWNUMBER_FIX":FUNCTION_NAME,"DRAWTEXT_FIX":FUNCTION_NAME,
114
114
 
115
115
 
116
116
  //个股行情数据
@@ -44162,7 +44162,8 @@ function ChartDrawText()
44162
44162
 
44163
44163
  this.ClassName='ChartDrawText'; //类名
44164
44164
  this.Color="rgb(255,193,37)"; //线段颜色
44165
- this.TextFont="14px 微软雅黑"; //线段宽度
44165
+ this.Font; //固定字体
44166
+ this.TextFont="14px 微软雅黑"; //输出使用的字体
44166
44167
  this.TextBaseline="middle";
44167
44168
  this.TextAlign='left';
44168
44169
  this.Text
@@ -44237,8 +44238,9 @@ function ChartDrawText()
44237
44238
  var isArrayText=Array.isArray(this.Text);
44238
44239
  var drawTextInfo={ Text:{ Color:this.Color, Align:this.TextAlign, Baseline:this.TextBaseline }, Font:{ } };
44239
44240
 
44240
-
44241
- if (this.FixedFontSize>0) //固定字体大小模式
44241
+ if (this.Font)
44242
+ this.TextFont=this.Font;
44243
+ else if (this.FixedFontSize>0) //固定字体大小模式
44242
44244
  this.TextFont=`${this.FixedFontSize}px ${this.TextSize.FontName}`;
44243
44245
  else //动态字体大小
44244
44246
  this.TextFont=this.GetDynamicFont(dataWidth,distanceWidth,this.TextSize.Max,this.TextSize.Min,this.TextSize.Zoom,this.TextSize.FontName);
@@ -53088,6 +53090,7 @@ function KLineTooltipPaint()
53088
53090
  this.ExtendLineWidth=2;
53089
53091
 
53090
53092
  this.Font=[g_JSChartResource.TooltipPaint.TitleFont];
53093
+
53091
53094
 
53092
53095
  this.HQChart;
53093
53096
  this.KLineTitlePaint;
@@ -53207,6 +53210,8 @@ function KLineTooltipPaint()
53207
53210
  lineWidth+=textWidth;
53208
53211
  }
53209
53212
 
53213
+ if (IFrameSplitOperator.IsNumber(item.Space)) lineWidth+=item.Space;
53214
+
53210
53215
  if (maxLineWidth<lineWidth) maxLineWidth=lineWidth;
53211
53216
 
53212
53217
  height+=this.LineHeight;
@@ -53398,20 +53403,33 @@ function KLineTooltipPaint()
53398
53403
  {
53399
53404
  var item=titleData.AryText[i];
53400
53405
 
53406
+ var titleWidth=0;
53401
53407
  if (item.Title)
53402
53408
  {
53403
53409
  this.Canvas.textAlign="left";
53404
53410
  this.Canvas.fillStyle=item.TitleColor;
53405
53411
  this.Canvas.fillText(item.Title,left,top);
53412
+ var titleWidth=this.Canvas.measureText(item.Title).width+2;
53406
53413
  }
53407
53414
 
53408
53415
  if (item.Text)
53409
53416
  {
53410
- this.Canvas.textAlign="right";
53411
- this.Canvas.fillStyle=item.Color;
53412
- 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
+ }
53413
53431
  }
53414
-
53432
+
53415
53433
  top+=this.LineHeight+this.LineSpace;
53416
53434
  }
53417
53435
 
@@ -57579,6 +57597,8 @@ function LatestPointFlashPaint()
57579
57597
  this.ClassName='LatestPointFlashPaint';
57580
57598
  this.HQChart;
57581
57599
 
57600
+ this.FlashType=0; //0=数据更新了闪烁, 1=一直显示
57601
+ //闪烁
57582
57602
  this.Status=0;
57583
57603
  this.UpdateTime=new Date();
57584
57604
  this.FlashCount=0; //闪烁次数
@@ -57603,6 +57623,7 @@ function LatestPointFlashPaint()
57603
57623
  if (option)
57604
57624
  {
57605
57625
  if (IFrameSplitOperator.IsNumber(option.Frequency)) this.Frequency=option.Frequency;
57626
+ if (IFrameSplitOperator.IsNumber(option.FlashType)) this.FlashType=option.FlashType;
57606
57627
  }
57607
57628
  }
57608
57629
 
@@ -57637,18 +57658,32 @@ function LatestPointFlashPaint()
57637
57658
  if (!this.HQChart) return;
57638
57659
  this.HQChart.ClearCanvas(this.FlashCanvas);
57639
57660
 
57640
- if (this.FlashCount<=0) return;
57641
- if (this.IsStatusChange())
57661
+ if (this.FlashType===1)
57642
57662
  {
57643
- this.Status=(this.Status+1)%2;
57644
- --this.FlashCount;
57663
+
57645
57664
  }
57665
+ else
57666
+ {
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;
57674
+ }
57675
+
57676
+
57646
57677
 
57647
- if (this.Status==0) return;
57648
57678
  if (!this.HQChart.GlobalOption || !this.HQChart.GlobalOption.LatestPoint) return;
57649
57679
  var point=this.HQChart.GlobalOption.LatestPoint;
57650
57680
  if (!IFrameSplitOperator.IsNumber(point.X) || !IFrameSplitOperator.IsNumber(point.Y)) return;
57651
57681
 
57682
+ this.DrawPoint(point);
57683
+ }
57684
+
57685
+ this.DrawPoint=function(point)
57686
+ {
57652
57687
  if (this.Style==1) this.GetChartColor();
57653
57688
 
57654
57689
  this.FlashCanvas.fillStyle=this.BGColor;
@@ -82782,7 +82817,7 @@ function JSChartResource()
82782
82817
  //虚线配置
82783
82818
  this.DOTLINE=
82784
82819
  {
82785
- LineDash:[3,5] //虚线配置
82820
+ LineDash:[2*GetDevicePixelRatio(),2*GetDevicePixelRatio()] //虚线配置
82786
82821
  }
82787
82822
 
82788
82823
  this.DRAWSL=
@@ -120184,6 +120219,17 @@ function JSDraw(errorHandler,symbolData)
120184
120219
  let bSecondPont=false;
120185
120220
  let lineCache={Start:{ },End:{ }, List:new Array()};
120186
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
+
120187
120233
  for(let i=0;i<count;++i)
120188
120234
  {
120189
120235
  drawData[i]=null;
@@ -120210,6 +120256,16 @@ function JSDraw(errorHandler,symbolData)
120210
120256
  {
120211
120257
  bSecondPont=true;
120212
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
+ }
120213
120269
  }
120214
120270
  }
120215
120271
  else if (bFirstPoint==true && bSecondPont==true)
@@ -120221,13 +120277,8 @@ function JSDraw(errorHandler,symbolData)
120221
120277
  }
120222
120278
  else if (condition[i]) //条件1满足
120223
120279
  {
120224
- let lineData=this.CalculateDrawLine(lineCache); //计算2个点的线上 其他点的数值
120225
-
120226
- for(let j in lineData)
120227
- {
120228
- let item=lineData[j];
120229
- drawData[item.ID]=item.Value;
120230
- }
120280
+ var lineData=this.CalculateDrawLine(lineCache); //计算2个点的线上 其他点的数值
120281
+ CopyLineData(drawData,lineData);
120231
120282
 
120232
120283
  if (expand==1) this.CalculateDrawDataExtendLine(drawData, lineCache.Start.ID-2);//右延长线
120233
120284
 
@@ -120244,12 +120295,9 @@ function JSDraw(errorHandler,symbolData)
120244
120295
  //最后一组线
120245
120296
  if (bFirstPoint==true && bSecondPont==true)
120246
120297
  {
120247
- let lineData=this.CalculateDrawLine(lineCache);
120248
- for(let j in lineData)
120249
- {
120250
- let item=lineData[j];
120251
- drawData[item.ID]=item.Value;
120252
- }
120298
+ var lineData=this.CalculateDrawLine(lineCache);
120299
+ CopyLineData(drawData,lineData);
120300
+
120253
120301
  }
120254
120302
  }
120255
120303
 
@@ -120766,7 +120814,13 @@ function JSDraw(errorHandler,symbolData)
120766
120814
  {
120767
120815
  if (!numberData) return null;
120768
120816
 
120769
- 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
+ }
120770
120824
 
120771
120825
  if (!IFrameSplitOperator.IsNonEmptyArray(numberData.ArrayValue)) return null;
120772
120826
 
@@ -121152,6 +121206,12 @@ function JSDraw(errorHandler,symbolData)
121152
121206
  return rgba;
121153
121207
  }
121154
121208
 
121209
+ //设置字体
121210
+ this.CSSFONT=function(strFont)
121211
+ {
121212
+ return strFont;
121213
+ }
121214
+
121155
121215
  this.UPCOLOR=function(color)
121156
121216
  {
121157
121217
  return color;
@@ -128197,6 +128257,7 @@ function JSExecute(ast,option)
128197
128257
  let xOffset=null, yOffset=null;
128198
128258
  var klineType=null;
128199
128259
  var lineDash=null;
128260
+ var font=null;
128200
128261
  for(let j=0; j<item.Expression.Expression.length; ++j)
128201
128262
  {
128202
128263
  let itemExpression=item.Expression.Expression[j];
@@ -128313,6 +128374,10 @@ function JSExecute(ast,option)
128313
128374
  {
128314
128375
  downColor=itemExpression.Out;
128315
128376
  }
128377
+ else if (itemExpression.Callee.Name=="CSSFONT")
128378
+ {
128379
+ font=itemExpression.Out;
128380
+ }
128316
128381
  else if (itemExpression.Callee.Name=="STICKTYPE")
128317
128382
  {
128318
128383
  stickType=itemExpression.Out;
@@ -128515,6 +128580,7 @@ function JSExecute(ast,option)
128515
128580
  if (drawAlign>=0) outVar.DrawAlign=drawAlign;
128516
128581
  if (drawVAlign>=0) outVar.DrawVAlign=drawVAlign;
128517
128582
  if (fontSize>0) outVar.DrawFontSize=fontSize;
128583
+ if (font) outVar.Font=font;
128518
128584
  if (bgConfig) outVar.Background=bgConfig;
128519
128585
  if (vLineConfig) outVar.VerticalLine=vLineConfig;
128520
128586
  if (IFrameSplitOperator.IsNumber(xOffset)) outVar.XOffset=xOffset;
@@ -129015,6 +129081,9 @@ function JSExecute(ast,option)
129015
129081
  case "DOWNCOLOR":
129016
129082
  node.Out=this.Draw.DOWNCOLOR(args[0]);
129017
129083
  break;
129084
+ case "CSSFONT":
129085
+ node.Out=this.Draw.CSSFONT(args[0]);
129086
+ break;
129018
129087
  case "STICKTYPE": //柱子类型
129019
129088
  node.Out=this.Draw.STICKTYPE(args[0]);
129020
129089
  break;
@@ -131729,6 +131798,7 @@ function ScriptIndex(name,script,args,option)
131729
131798
  }
131730
131799
 
131731
131800
  if (varItem.DrawFontSize>0) chartText.FixedFontSize=varItem.DrawFontSize;
131801
+ if (varItem.Font) chartText.Font=varItem.Font;
131732
131802
  if (varItem.Background) chartText.TextBG=varItem.Background;
131733
131803
  if (varItem.VerticalLine) chartText.VerticalLine=varItem.VerticalLine;
131734
131804
 
@@ -131884,6 +131954,12 @@ function ScriptIndex(name,script,args,option)
131884
131954
  let width=parseInt(varItem.LineWidth.replace("LINETHICK",""));
131885
131955
  if (!isNaN(width) && width>0) line.LineWidth=width;
131886
131956
  }
131957
+
131958
+ if (varItem.IsDotLine)
131959
+ {
131960
+ line.IsDotLine=true; //虚线
131961
+ line.LineDash=g_JSChartResource.DOTLINE.LineDash.slice();
131962
+ }
131887
131963
 
131888
131964
  let titleIndex=windowIndex+1;
131889
131965
  line.Data.Data=varItem.Draw.DrawData;
@@ -134118,6 +134194,7 @@ function OverlayScriptIndex(name,script,args,option)
134118
134194
  }
134119
134195
 
134120
134196
  if (varItem.DrawFontSize>0) chartText.FixedFontSize=varItem.DrawFontSize;
134197
+ if (varItem.Font) chartText.Font=varItem.Font;
134121
134198
  if (varItem.Background) chartText.TextBG=varItem.Background;
134122
134199
  if (varItem.VerticalLine) chartText.VerticalLine=varItem.VerticalLine;
134123
134200
  if (IFrameSplitOperator.IsNumber(varItem.XOffset)) chartText.ShowOffset.X=varItem.XOffset;
@@ -134316,6 +134393,12 @@ function OverlayScriptIndex(name,script,args,option)
134316
134393
  let width=parseInt(varItem.LineWidth.replace("LINETHICK",""));
134317
134394
  if (!isNaN(width) && width>0) chart.LineWidth=width;
134318
134395
  }
134396
+
134397
+ if (varItem.IsDotLine)
134398
+ {
134399
+ chart.IsDotLine=true; //虚线
134400
+ chart.LineDash=g_JSChartResource.DOTLINE.LineDash.slice();
134401
+ }
134319
134402
 
134320
134403
  let titleIndex=windowIndex+1;
134321
134404
  chart.Data.Data=varItem.Draw.DrawData;
@@ -154848,7 +154931,7 @@ function ScrollBarBGChart()
154848
154931
 
154849
154932
 
154850
154933
 
154851
- var HQCHART_VERSION="1.1.15272";
154934
+ var HQCHART_VERSION="1.1.15291";
154852
154935
 
154853
154936
  function PrintHQChartVersion()
154854
154937
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.15272";
8
+ var HQCHART_VERSION="1.1.15291";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {