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.
@@ -44206,7 +44206,8 @@ function ChartDrawText()
44206
44206
 
44207
44207
  this.ClassName='ChartDrawText'; //类名
44208
44208
  this.Color="rgb(255,193,37)"; //线段颜色
44209
- this.TextFont="14px 微软雅黑"; //线段宽度
44209
+ this.Font; //固定字体
44210
+ this.TextFont="14px 微软雅黑"; //输出使用的字体
44210
44211
  this.TextBaseline="middle";
44211
44212
  this.TextAlign='left';
44212
44213
  this.Text
@@ -44281,8 +44282,9 @@ function ChartDrawText()
44281
44282
  var isArrayText=Array.isArray(this.Text);
44282
44283
  var drawTextInfo={ Text:{ Color:this.Color, Align:this.TextAlign, Baseline:this.TextBaseline }, Font:{ } };
44283
44284
 
44284
-
44285
- if (this.FixedFontSize>0) //固定字体大小模式
44285
+ if (this.Font)
44286
+ this.TextFont=this.Font;
44287
+ else if (this.FixedFontSize>0) //固定字体大小模式
44286
44288
  this.TextFont=`${this.FixedFontSize}px ${this.TextSize.FontName}`;
44287
44289
  else //动态字体大小
44288
44290
  this.TextFont=this.GetDynamicFont(dataWidth,distanceWidth,this.TextSize.Max,this.TextSize.Min,this.TextSize.Zoom,this.TextSize.FontName);
@@ -53132,6 +53134,7 @@ function KLineTooltipPaint()
53132
53134
  this.ExtendLineWidth=2;
53133
53135
 
53134
53136
  this.Font=[g_JSChartResource.TooltipPaint.TitleFont];
53137
+
53135
53138
 
53136
53139
  this.HQChart;
53137
53140
  this.KLineTitlePaint;
@@ -53251,6 +53254,8 @@ function KLineTooltipPaint()
53251
53254
  lineWidth+=textWidth;
53252
53255
  }
53253
53256
 
53257
+ if (IFrameSplitOperator.IsNumber(item.Space)) lineWidth+=item.Space;
53258
+
53254
53259
  if (maxLineWidth<lineWidth) maxLineWidth=lineWidth;
53255
53260
 
53256
53261
  height+=this.LineHeight;
@@ -53442,20 +53447,33 @@ function KLineTooltipPaint()
53442
53447
  {
53443
53448
  var item=titleData.AryText[i];
53444
53449
 
53450
+ var titleWidth=0;
53445
53451
  if (item.Title)
53446
53452
  {
53447
53453
  this.Canvas.textAlign="left";
53448
53454
  this.Canvas.fillStyle=item.TitleColor;
53449
53455
  this.Canvas.fillText(item.Title,left,top);
53456
+ var titleWidth=this.Canvas.measureText(item.Title).width+2;
53450
53457
  }
53451
53458
 
53452
53459
  if (item.Text)
53453
53460
  {
53454
- this.Canvas.textAlign="right";
53455
- this.Canvas.fillStyle=item.Color;
53456
- this.Canvas.fillText(item.Text,right,top);
53461
+ if (item.TextAlign==1) //1=左对齐 0=右对齐
53462
+ {
53463
+ var yText=left+titleWidth+2;
53464
+ if (IFrameSplitOperator.IsNumber(item.Space)) yText+=item.Space; //标题和数据内容间距
53465
+ this.Canvas.textAlign="left";
53466
+ this.Canvas.fillStyle=item.Color;
53467
+ this.Canvas.fillText(item.Text,yText,top);
53468
+ }
53469
+ else
53470
+ {
53471
+ this.Canvas.textAlign="right";
53472
+ this.Canvas.fillStyle=item.Color;
53473
+ this.Canvas.fillText(item.Text,right,top);
53474
+ }
53457
53475
  }
53458
-
53476
+
53459
53477
  top+=this.LineHeight+this.LineSpace;
53460
53478
  }
53461
53479
 
@@ -57623,6 +57641,8 @@ function LatestPointFlashPaint()
57623
57641
  this.ClassName='LatestPointFlashPaint';
57624
57642
  this.HQChart;
57625
57643
 
57644
+ this.FlashType=0; //0=数据更新了闪烁, 1=一直显示
57645
+ //闪烁
57626
57646
  this.Status=0;
57627
57647
  this.UpdateTime=new Date();
57628
57648
  this.FlashCount=0; //闪烁次数
@@ -57647,6 +57667,7 @@ function LatestPointFlashPaint()
57647
57667
  if (option)
57648
57668
  {
57649
57669
  if (IFrameSplitOperator.IsNumber(option.Frequency)) this.Frequency=option.Frequency;
57670
+ if (IFrameSplitOperator.IsNumber(option.FlashType)) this.FlashType=option.FlashType;
57650
57671
  }
57651
57672
  }
57652
57673
 
@@ -57681,18 +57702,32 @@ function LatestPointFlashPaint()
57681
57702
  if (!this.HQChart) return;
57682
57703
  this.HQChart.ClearCanvas(this.FlashCanvas);
57683
57704
 
57684
- if (this.FlashCount<=0) return;
57685
- if (this.IsStatusChange())
57705
+ if (this.FlashType===1)
57686
57706
  {
57687
- this.Status=(this.Status+1)%2;
57688
- --this.FlashCount;
57707
+
57689
57708
  }
57709
+ else
57710
+ {
57711
+ if (this.FlashCount<=0) return;
57712
+ if (this.IsStatusChange())
57713
+ {
57714
+ this.Status=(this.Status+1)%2;
57715
+ --this.FlashCount;
57716
+ }
57717
+ if (this.Status==0) return;
57718
+ }
57719
+
57720
+
57690
57721
 
57691
- if (this.Status==0) return;
57692
57722
  if (!this.HQChart.GlobalOption || !this.HQChart.GlobalOption.LatestPoint) return;
57693
57723
  var point=this.HQChart.GlobalOption.LatestPoint;
57694
57724
  if (!IFrameSplitOperator.IsNumber(point.X) || !IFrameSplitOperator.IsNumber(point.Y)) return;
57695
57725
 
57726
+ this.DrawPoint(point);
57727
+ }
57728
+
57729
+ this.DrawPoint=function(point)
57730
+ {
57696
57731
  if (this.Style==1) this.GetChartColor();
57697
57732
 
57698
57733
  this.FlashCanvas.fillStyle=this.BGColor;
@@ -82826,7 +82861,7 @@ function JSChartResource()
82826
82861
  //虚线配置
82827
82862
  this.DOTLINE=
82828
82863
  {
82829
- LineDash:[3,5] //虚线配置
82864
+ LineDash:[2*GetDevicePixelRatio(),2*GetDevicePixelRatio()] //虚线配置
82830
82865
  }
82831
82866
 
82832
82867
  this.DRAWSL=
@@ -120228,6 +120263,17 @@ function JSDraw(errorHandler,symbolData)
120228
120263
  let bSecondPont=false;
120229
120264
  let lineCache={Start:{ },End:{ }, List:new Array()};
120230
120265
 
120266
+ function CopyLineData(aryDest, arySrc)
120267
+ {
120268
+ if (!IFrameSplitOperator.IsNonEmptyArray(arySrc)) return;
120269
+
120270
+ for(var j=0; j<arySrc.length; ++j)
120271
+ {
120272
+ var item=arySrc[j];
120273
+ aryDest[item.ID]=item.Value;
120274
+ }
120275
+ }
120276
+
120231
120277
  for(let i=0;i<count;++i)
120232
120278
  {
120233
120279
  drawData[i]=null;
@@ -120254,6 +120300,16 @@ function JSDraw(errorHandler,symbolData)
120254
120300
  {
120255
120301
  bSecondPont=true;
120256
120302
  lineCache.End={ID:i, Value:data2[i]}; //第2个点
120303
+
120304
+ if (condition[i])
120305
+ {
120306
+ var lineData=this.CalculateDrawLine(lineCache); //计算2个点的线上 其他点的数值
120307
+ CopyLineData(drawData,lineData);
120308
+
120309
+ bFirstPoint=true;
120310
+ bSecondPont=false;
120311
+ lineCache.Start={ID:i, Value:data[i]}; //第1个点
120312
+ }
120257
120313
  }
120258
120314
  }
120259
120315
  else if (bFirstPoint==true && bSecondPont==true)
@@ -120265,13 +120321,8 @@ function JSDraw(errorHandler,symbolData)
120265
120321
  }
120266
120322
  else if (condition[i]) //条件1满足
120267
120323
  {
120268
- let lineData=this.CalculateDrawLine(lineCache); //计算2个点的线上 其他点的数值
120269
-
120270
- for(let j in lineData)
120271
- {
120272
- let item=lineData[j];
120273
- drawData[item.ID]=item.Value;
120274
- }
120324
+ var lineData=this.CalculateDrawLine(lineCache); //计算2个点的线上 其他点的数值
120325
+ CopyLineData(drawData,lineData);
120275
120326
 
120276
120327
  if (expand==1) this.CalculateDrawDataExtendLine(drawData, lineCache.Start.ID-2);//右延长线
120277
120328
 
@@ -120288,12 +120339,9 @@ function JSDraw(errorHandler,symbolData)
120288
120339
  //最后一组线
120289
120340
  if (bFirstPoint==true && bSecondPont==true)
120290
120341
  {
120291
- let lineData=this.CalculateDrawLine(lineCache);
120292
- for(let j in lineData)
120293
- {
120294
- let item=lineData[j];
120295
- drawData[item.ID]=item.Value;
120296
- }
120342
+ var lineData=this.CalculateDrawLine(lineCache);
120343
+ CopyLineData(drawData,lineData);
120344
+
120297
120345
  }
120298
120346
  }
120299
120347
 
@@ -120810,7 +120858,13 @@ function JSDraw(errorHandler,symbolData)
120810
120858
  {
120811
120859
  if (!numberData) return null;
120812
120860
 
120813
- if (numberData.DataType==1) return numberData.SingleValue;
120861
+ if (numberData.DataType==1)
120862
+ {
120863
+ var value=numberData.SingleValue;
120864
+ if (IFrameSplitOperator.IsNumber(value)) return value.toFixed(decimal);
120865
+ else if (value) return value.toString();
120866
+ else return null;
120867
+ }
120814
120868
 
120815
120869
  if (!IFrameSplitOperator.IsNonEmptyArray(numberData.ArrayValue)) return null;
120816
120870
 
@@ -121196,6 +121250,12 @@ function JSDraw(errorHandler,symbolData)
121196
121250
  return rgba;
121197
121251
  }
121198
121252
 
121253
+ //设置字体
121254
+ this.CSSFONT=function(strFont)
121255
+ {
121256
+ return strFont;
121257
+ }
121258
+
121199
121259
  this.UPCOLOR=function(color)
121200
121260
  {
121201
121261
  return color;
@@ -128241,6 +128301,7 @@ function JSExecute(ast,option)
128241
128301
  let xOffset=null, yOffset=null;
128242
128302
  var klineType=null;
128243
128303
  var lineDash=null;
128304
+ var font=null;
128244
128305
  for(let j=0; j<item.Expression.Expression.length; ++j)
128245
128306
  {
128246
128307
  let itemExpression=item.Expression.Expression[j];
@@ -128357,6 +128418,10 @@ function JSExecute(ast,option)
128357
128418
  {
128358
128419
  downColor=itemExpression.Out;
128359
128420
  }
128421
+ else if (itemExpression.Callee.Name=="CSSFONT")
128422
+ {
128423
+ font=itemExpression.Out;
128424
+ }
128360
128425
  else if (itemExpression.Callee.Name=="STICKTYPE")
128361
128426
  {
128362
128427
  stickType=itemExpression.Out;
@@ -128559,6 +128624,7 @@ function JSExecute(ast,option)
128559
128624
  if (drawAlign>=0) outVar.DrawAlign=drawAlign;
128560
128625
  if (drawVAlign>=0) outVar.DrawVAlign=drawVAlign;
128561
128626
  if (fontSize>0) outVar.DrawFontSize=fontSize;
128627
+ if (font) outVar.Font=font;
128562
128628
  if (bgConfig) outVar.Background=bgConfig;
128563
128629
  if (vLineConfig) outVar.VerticalLine=vLineConfig;
128564
128630
  if (IFrameSplitOperator.IsNumber(xOffset)) outVar.XOffset=xOffset;
@@ -129059,6 +129125,9 @@ function JSExecute(ast,option)
129059
129125
  case "DOWNCOLOR":
129060
129126
  node.Out=this.Draw.DOWNCOLOR(args[0]);
129061
129127
  break;
129128
+ case "CSSFONT":
129129
+ node.Out=this.Draw.CSSFONT(args[0]);
129130
+ break;
129062
129131
  case "STICKTYPE": //柱子类型
129063
129132
  node.Out=this.Draw.STICKTYPE(args[0]);
129064
129133
  break;
@@ -131773,6 +131842,7 @@ function ScriptIndex(name,script,args,option)
131773
131842
  }
131774
131843
 
131775
131844
  if (varItem.DrawFontSize>0) chartText.FixedFontSize=varItem.DrawFontSize;
131845
+ if (varItem.Font) chartText.Font=varItem.Font;
131776
131846
  if (varItem.Background) chartText.TextBG=varItem.Background;
131777
131847
  if (varItem.VerticalLine) chartText.VerticalLine=varItem.VerticalLine;
131778
131848
 
@@ -131928,6 +131998,12 @@ function ScriptIndex(name,script,args,option)
131928
131998
  let width=parseInt(varItem.LineWidth.replace("LINETHICK",""));
131929
131999
  if (!isNaN(width) && width>0) line.LineWidth=width;
131930
132000
  }
132001
+
132002
+ if (varItem.IsDotLine)
132003
+ {
132004
+ line.IsDotLine=true; //虚线
132005
+ line.LineDash=g_JSChartResource.DOTLINE.LineDash.slice();
132006
+ }
131931
132007
 
131932
132008
  let titleIndex=windowIndex+1;
131933
132009
  line.Data.Data=varItem.Draw.DrawData;
@@ -134162,6 +134238,7 @@ function OverlayScriptIndex(name,script,args,option)
134162
134238
  }
134163
134239
 
134164
134240
  if (varItem.DrawFontSize>0) chartText.FixedFontSize=varItem.DrawFontSize;
134241
+ if (varItem.Font) chartText.Font=varItem.Font;
134165
134242
  if (varItem.Background) chartText.TextBG=varItem.Background;
134166
134243
  if (varItem.VerticalLine) chartText.VerticalLine=varItem.VerticalLine;
134167
134244
  if (IFrameSplitOperator.IsNumber(varItem.XOffset)) chartText.ShowOffset.X=varItem.XOffset;
@@ -134360,6 +134437,12 @@ function OverlayScriptIndex(name,script,args,option)
134360
134437
  let width=parseInt(varItem.LineWidth.replace("LINETHICK",""));
134361
134438
  if (!isNaN(width) && width>0) chart.LineWidth=width;
134362
134439
  }
134440
+
134441
+ if (varItem.IsDotLine)
134442
+ {
134443
+ chart.IsDotLine=true; //虚线
134444
+ chart.LineDash=g_JSChartResource.DOTLINE.LineDash.slice();
134445
+ }
134363
134446
 
134364
134447
  let titleIndex=windowIndex+1;
134365
134448
  chart.Data.Data=varItem.Draw.DrawData;
@@ -166907,7 +166990,7 @@ function HQChartScriptWorker()
166907
166990
 
166908
166991
 
166909
166992
 
166910
- var HQCHART_VERSION="1.1.15272";
166993
+ var HQCHART_VERSION="1.1.15291";
166911
166994
 
166912
166995
  function PrintHQChartVersion()
166913
166996
  {