hqchart 1.1.14072 → 1.1.14079

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.
@@ -128643,6 +128643,18 @@ function JSReportChartContainer(uielement)
128643
128643
  if (IFrameSplitOperator.IsString(item[208])) stock.ReserveString8=item[208];
128644
128644
  if (IFrameSplitOperator.IsString(item[209])) stock.ReserveString9=item[209];
128645
128645
  if (IFrameSplitOperator.IsString(item[210])) stock.ReserveString10=item[210];
128646
+
128647
+ //10个进度条 301-350 { Value:, BGColor: }
128648
+ if (IFrameSplitOperator.IsNumber(item[301]) || IFrameSplitOperator.IsObject(item[301])) stock.ReserveProgressBar1=item[301];
128649
+ if (IFrameSplitOperator.IsNumber(item[302]) || IFrameSplitOperator.IsObject(item[302])) stock.ReserveProgressBar2=item[302];
128650
+ if (IFrameSplitOperator.IsNumber(item[303]) || IFrameSplitOperator.IsObject(item[303])) stock.ReserveProgressBar3=item[303];
128651
+ if (IFrameSplitOperator.IsNumber(item[304]) || IFrameSplitOperator.IsObject(item[304])) stock.ReserveProgressBar4=item[304];
128652
+ if (IFrameSplitOperator.IsNumber(item[305]) || IFrameSplitOperator.IsObject(item[305])) stock.ReserveProgressBar5=item[305];
128653
+ if (IFrameSplitOperator.IsNumber(item[306]) || IFrameSplitOperator.IsObject(item[306])) stock.ReserveProgressBar6=item[306];
128654
+ if (IFrameSplitOperator.IsNumber(item[307]) || IFrameSplitOperator.IsObject(item[307])) stock.ReserveProgressBar7=item[307];
128655
+ if (IFrameSplitOperator.IsNumber(item[308]) || IFrameSplitOperator.IsObject(item[308])) stock.ReserveProgressBar8=item[308];
128656
+ if (IFrameSplitOperator.IsNumber(item[309]) || IFrameSplitOperator.IsObject(item[309])) stock.ReserveProgressBar9=item[309];
128657
+ if (IFrameSplitOperator.IsNumber(item[310]) || IFrameSplitOperator.IsObject(item[310])) stock.ReserveProgressBar10=item[310];
128646
128658
  }
128647
128659
 
128648
128660
 
@@ -131287,8 +131299,22 @@ var REPORT_COLUMN_ID=
131287
131299
  RESERVE_STRING8_ID:308,
131288
131300
  RESERVE_STRING9_ID:309,
131289
131301
  RESERVE_STRING10_ID:310,
131302
+
131303
+ //预留进度条类型 10个 401-450
131304
+ RESERVE_PROGRESS_BAR1_ID:401, //ReserveProgressBar1:
131305
+ RESERVE_PROGRESS_BAR2_ID:402,
131306
+ RESERVE_PROGRESS_BAR3_ID:403,
131307
+ RESERVE_PROGRESS_BAR4_ID:404,
131308
+ RESERVE_PROGRESS_BAR5_ID:405,
131309
+ RESERVE_PROGRESS_BAR6_ID:406,
131310
+ RESERVE_PROGRESS_BAR7_ID:407,
131311
+ RESERVE_PROGRESS_BAR8_ID:408,
131312
+ RESERVE_PROGRESS_BAR9_ID:409,
131313
+ RESERVE_PROGRESS_BAR10_ID:410,
131314
+
131290
131315
  }
131291
131316
 
131317
+
131292
131318
  //数据对应字段名对照表
131293
131319
  var MAP_COLUMN_FIELD=new Map([
131294
131320
  [REPORT_COLUMN_ID.SYMBOL_ID, "Symbol"],
@@ -131359,6 +131385,17 @@ var MAP_COLUMN_FIELD=new Map([
131359
131385
  [REPORT_COLUMN_ID.RESERVE_STRING8_ID,"ReserveString8"],
131360
131386
  [REPORT_COLUMN_ID.RESERVE_STRING9_ID,"ReserveString9"],
131361
131387
  [REPORT_COLUMN_ID.RESERVE_STRING10_ID,"ReserveString10"],
131388
+
131389
+ [REPORT_COLUMN_ID.RESERVE_PROGRESS_BAR1_ID,"ReserveProgressBar1"],
131390
+ [REPORT_COLUMN_ID.RESERVE_PROGRESS_BAR2_ID,"ReserveProgressBar2"],
131391
+ [REPORT_COLUMN_ID.RESERVE_PROGRESS_BAR3_ID,"ReserveProgressBar3"],
131392
+ [REPORT_COLUMN_ID.RESERVE_PROGRESS_BAR4_ID,"ReserveProgressBar4"],
131393
+ [REPORT_COLUMN_ID.RESERVE_PROGRESS_BAR5_ID,"ReserveProgressBar5"],
131394
+ [REPORT_COLUMN_ID.RESERVE_PROGRESS_BAR6_ID,"ReserveProgressBar6"],
131395
+ [REPORT_COLUMN_ID.RESERVE_PROGRESS_BAR7_ID,"ReserveProgressBar7"],
131396
+ [REPORT_COLUMN_ID.RESERVE_PROGRESS_BAR8_ID,"ReserveProgressBar8"],
131397
+ [REPORT_COLUMN_ID.RESERVE_PROGRESS_BAR9_ID,"ReserveProgressBar9"],
131398
+ [REPORT_COLUMN_ID.RESERVE_PROGRESS_BAR10_ID,"ReserveProgressBar10"],
131362
131399
  ]);
131363
131400
 
131364
131401
  function ChartReport()
@@ -131443,14 +131480,14 @@ function ChartReport()
131443
131480
  Left:g_JSChartResource.Report.Item.Mergin.Left,
131444
131481
  Right:g_JSChartResource.Report.Item.Mergin.Right,
131445
131482
  Top:g_JSChartResource.Report.Item.Mergin.Top,
131446
- Bottom:g_JSChartResource.Report.Item.Mergin.Bottom
131483
+ Bottom:g_JSChartResource.Report.Item.Mergin.Bottom,
131447
131484
  };
131448
131485
  this.BarMergin=
131449
131486
  {
131450
131487
  Top:g_JSChartResource.Report.Item.BarMergin.Top,
131451
131488
  Left:g_JSChartResource.Report.Item.BarMergin.Left,
131452
131489
  Right:g_JSChartResource.Report.Item.BarMergin.Right,
131453
- Bottom:g_JSChartResource.Report.Item.BarMergin.Bottom
131490
+ Bottom:g_JSChartResource.Report.Item.BarMergin.Bottom,
131454
131491
  };
131455
131492
 
131456
131493
  this.LimitDrawType=0; //0=绘制边框 1=背景色
@@ -131507,15 +131544,21 @@ function ChartReport()
131507
131544
  this.HeaderFont=12*GetDevicePixelRatio() +"px 微软雅黑";
131508
131545
  this.SortFont=null,
131509
131546
  this.ItemFont=15*GetDevicePixelRatio() +"px 微软雅黑";
131547
+ this.ItemFontHeight=0;
131548
+
131510
131549
  this.ItemFixedFont=15*GetDevicePixelRatio() +"px 微软雅黑";
131550
+
131511
131551
  this.ItemSymbolFont=12*GetDevicePixelRatio() +"px 微软雅黑";
131512
131552
  this.ItemNameFont=15*GetDevicePixelRatio() +"px 微软雅黑";
131513
131553
  this.ItemNameHeight=0;
131554
+ this.ItemSymbolHeight=0;
131555
+
131514
131556
  this.NameSymbolFont={ Symbol:null, Name:null };
131515
131557
  this.RowCount=0; //一屏显示行数
131516
131558
  this.HeaderHeight=0; //表头高度
131517
131559
  this.FixedRowHeight=0; //固定行高度
131518
131560
  this.RowHeight=0; //行高度
131561
+ this.ItemTextLines=1; //单元格输出行数
131519
131562
  this.BottomToolbarHeight=0; //底部工具条高度
131520
131563
  this.IsShowAllColumn=false; //是否已显示所有列
131521
131564
  this.DevicePixelRatio=GetDevicePixelRatio(); //分辨率
@@ -131734,6 +131777,11 @@ function ChartReport()
131734
131777
  if (item.ProgressBar) colItem.ProgressBar=CloneData(item.ProgressBar);
131735
131778
  else colItem.ProgressBar=this.ProgressBarConfig;
131736
131779
  }
131780
+ else if (this.IsReserveProgressBarColumn(item.Type))
131781
+ {
131782
+ if (item.ProgressBar) colItem.ProgressBar=CloneData(item.ProgressBar);
131783
+ else colItem.ProgressBar=this.ProgressBarConfig;
131784
+ }
131737
131785
  else if (item.Type==REPORT_COLUMN_ID.CUSTOM_LINK_ID)
131738
131786
  {
131739
131787
  if (!IFrameSplitOperator.IsNumber(item.DataIndex) && !IFrameSplitOperator.IsNumber(item.BlockIndex)) continue;
@@ -131907,6 +131955,19 @@ function ChartReport()
131907
131955
  { Type:REPORT_COLUMN_ID.RESERVE_STRING8_ID, Title:"文字8", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"擎擎擎擎擎擎" },
131908
131956
  { Type:REPORT_COLUMN_ID.RESERVE_STRING9_ID, Title:"文字9", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"擎擎擎擎擎擎" },
131909
131957
  { Type:REPORT_COLUMN_ID.RESERVE_STRING10_ID, Title:"文字10", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"擎擎擎擎擎擎" },
131958
+
131959
+
131960
+ { Type:REPORT_COLUMN_ID.RESERVE_PROGRESS_BAR1_ID, Title:"进度条1", TextAlign:"center", FixedWidth:100*GetDevicePixelRatio() },
131961
+ { Type:REPORT_COLUMN_ID.RESERVE_PROGRESS_BAR2_ID, Title:"进度条2", TextAlign:"center", FixedWidth:100*GetDevicePixelRatio() },
131962
+ { Type:REPORT_COLUMN_ID.RESERVE_PROGRESS_BAR3_ID, Title:"进度条3", TextAlign:"center", FixedWidth:100*GetDevicePixelRatio() },
131963
+ { Type:REPORT_COLUMN_ID.RESERVE_PROGRESS_BAR4_ID, Title:"进度条4", TextAlign:"center", FixedWidth:100*GetDevicePixelRatio() },
131964
+ { Type:REPORT_COLUMN_ID.RESERVE_PROGRESS_BAR5_ID, Title:"进度条5", TextAlign:"center", FixedWidth:100*GetDevicePixelRatio() },
131965
+ { Type:REPORT_COLUMN_ID.RESERVE_PROGRESS_BAR6_ID, Title:"进度条6", TextAlign:"center", FixedWidth:100*GetDevicePixelRatio() },
131966
+ { Type:REPORT_COLUMN_ID.RESERVE_PROGRESS_BAR7_ID, Title:"进度条7", TextAlign:"center", FixedWidth:100*GetDevicePixelRatio() },
131967
+ { Type:REPORT_COLUMN_ID.RESERVE_PROGRESS_BAR8_ID, Title:"进度条8", TextAlign:"center", FixedWidth:100*GetDevicePixelRatio() },
131968
+ { Type:REPORT_COLUMN_ID.RESERVE_PROGRESS_BAR9_ID, Title:"进度条9", TextAlign:"center", FixedWidth:100*GetDevicePixelRatio() },
131969
+ { Type:REPORT_COLUMN_ID.RESERVE_PROGRESS_BAR10_ID, Title:"进度条10", TextAlign:"center", FixedWidth:100*GetDevicePixelRatio() },
131970
+
131910
131971
  ];
131911
131972
 
131912
131973
  for(var i=0;i<DEFAULT_COLUMN.length;++i)
@@ -132040,7 +132101,9 @@ function ChartReport()
132040
132101
  this.NameSymbolFont.Symbol=`${this.NameSymbolV2Config.Symbol.Size*pixelRatio}px ${this.NameSymbolV2Config.Symbol.Name}`;
132041
132102
  this.NameSymbolFont.Name=`${this.ItemSymbolFontConfig.Name.Size*pixelRatio}px ${this.NameSymbolV2Config.Name.Name}`;
132042
132103
 
132043
- this.RowHeight=this.GetFontHeight(this.ItemFont,"擎")+ this.ItemMergin.Top+ this.ItemMergin.Bottom;
132104
+ this.ItemFontHeight=this.GetFontHeight(this.ItemFont,"擎");
132105
+ this.RowHeight=this.ItemFontHeight+ this.ItemMergin.Top+ this.ItemMergin.Bottom;
132106
+ this.ItemTextLines=1;
132044
132107
  this.FixedRowHeight=this.GetFontHeight(this.ItemFixedFont,"擎")+ this.ItemMergin.Top+ this.ItemMergin.Bottom;
132045
132108
  this.SortFont=`${this.SortConfig.Size*pixelRatio}px ${ this.SortConfig.Family}`;
132046
132109
 
@@ -132059,6 +132122,7 @@ function ChartReport()
132059
132122
  this.Canvas.font=this.ItemSymbolFont;
132060
132123
  var symbolWidth=this.Canvas.measureText(item.MaxText).width;
132061
132124
  var symboHeight=this.GetFontHeight(this.ItemSymbolFont,"擎");
132125
+ this.ItemSymbolHeight=symboHeight;
132062
132126
 
132063
132127
  this.Canvas.font=this.ItemFont;
132064
132128
 
@@ -132066,6 +132130,7 @@ function ChartReport()
132066
132130
  item.Width=itemWidth+4+this.ItemMergin.Left+this.ItemMergin.Right;
132067
132131
 
132068
132132
  var rowHeight=nameHeight+symboHeight+this.ItemMergin.Top+ this.ItemMergin.Bottom;
132133
+ this.ItemTextLines=2;
132069
132134
  if (rowHeight>this.RowHeight) this.RowHeight=rowHeight;
132070
132135
  if (rowHeight>this.FixedRowHeight) this.FixedRowHeight=rowHeight;
132071
132136
  }
@@ -132971,6 +133036,10 @@ function ChartReport()
132971
133036
  {
132972
133037
  this.FormatReserveString(column, stock, drawInfo);
132973
133038
  }
133039
+ else if (this.IsReserveProgressBarColumn(column.Type))
133040
+ {
133041
+ this.FormatReserveProgressBar(column, stock, drawInfo);
133042
+ }
132974
133043
 
132975
133044
 
132976
133045
  //拖拽行颜色
@@ -132993,7 +133062,7 @@ function ChartReport()
132993
133062
  {
132994
133063
  this.DrawButton(drawInfo, left, top, itemWidth);
132995
133064
  }
132996
- else if (column.Type==REPORT_COLUMN_ID.CUSTOM_PROGRESS_ID)
133065
+ else if (column.Type==REPORT_COLUMN_ID.CUSTOM_PROGRESS_ID || this.IsReserveProgressBarColumn(column.Type))
132997
133066
  {
132998
133067
  this.DrawProgressBar(drawInfo, left, top, itemWidth);
132999
133068
  }
@@ -133039,6 +133108,18 @@ function ChartReport()
133039
133108
  }
133040
133109
  }
133041
133110
 
133111
+ this.IsReserveProgressBarColumn=function(value)
133112
+ {
133113
+ var ARARY_TYPE=
133114
+ [
133115
+ REPORT_COLUMN_ID.RESERVE_PROGRESS_BAR1_ID, REPORT_COLUMN_ID.RESERVE_PROGRESS_BAR2_ID,REPORT_COLUMN_ID.RESERVE_PROGRESS_BAR3_ID,
133116
+ REPORT_COLUMN_ID.RESERVE_PROGRESS_BAR4_ID,REPORT_COLUMN_ID.RESERVE_PROGRESS_BAR5_ID,REPORT_COLUMN_ID.RESERVE_PROGRESS_BAR6_ID,REPORT_COLUMN_ID.RESERVE_PROGRESS_BAR7_ID,
133117
+ REPORT_COLUMN_ID.RESERVE_PROGRESS_BAR8_ID,REPORT_COLUMN_ID.RESERVE_PROGRESS_BAR9_ID,REPORT_COLUMN_ID.RESERVE_PROGRESS_BAR10_ID
133118
+ ];
133119
+
133120
+ return ARARY_TYPE.includes(value);
133121
+ }
133122
+
133042
133123
  this.DrawCustomText=function(drawInfo, column, left, top, cellWidth)
133043
133124
  {
133044
133125
  if (!drawInfo.Text) return;
@@ -133139,7 +133220,7 @@ function ChartReport()
133139
133220
  var text=name;
133140
133221
  if (text)
133141
133222
  {
133142
- this.Canvas.textBaseline="ideographic";
133223
+ this.Canvas.textBaseline="bottom";
133143
133224
  this.Canvas.fillStyle=textColor;
133144
133225
  this.Canvas.font=this.ItemNameFont;
133145
133226
  text=this.TextEllipsis(text, width, column.MaxText);
@@ -133149,10 +133230,10 @@ function ChartReport()
133149
133230
  text=symbol;
133150
133231
  if (text)
133151
133232
  {
133152
- this.Canvas.textBaseline="top";
133233
+ this.Canvas.textBaseline="bottom";
133153
133234
  this.Canvas.font=this.ItemSymbolFont;
133154
133235
  this.Canvas.fillStyle=textColor;
133155
- this.Canvas.fillText(text,x,y);
133236
+ this.Canvas.fillText(text,x,y+this.ItemSymbolHeight);
133156
133237
  }
133157
133238
 
133158
133239
  this.Canvas.font=this.ItemFont; //还原字体
@@ -133459,6 +133540,32 @@ function ChartReport()
133459
133540
  }
133460
133541
  }
133461
133542
 
133543
+ this.FormatReserveProgressBar=function(column, data, drawInfo)
133544
+ {
133545
+ var fieldName=MAP_COLUMN_FIELD.get(column.Type);
133546
+ if (!fieldName) return;
133547
+ var item=data[fieldName];
133548
+ if (IFrameSplitOperator.IsNumber(item))
133549
+ {
133550
+ drawInfo.ProgressBar=column.ProgressBar;
133551
+ drawInfo.Enable=true;
133552
+ drawInfo.Value=item; //占比
133553
+ drawInfo.Data={ Value:item };
133554
+ }
133555
+ else if (IFrameSplitOperator.IsObject(item))
133556
+ {
133557
+ if (item.Title) drawInfo.Text=item.Title;
133558
+ drawInfo.ProgressBar=column.ProgressBar;
133559
+ drawInfo.Enable=true;
133560
+ drawInfo.Value=item.Value; //占比
133561
+ drawInfo.Data=item;
133562
+ if (IFrameSplitOperator.IsBool(item.Enable)) drawInfo.Enable=item.Enable;
133563
+ if (item.TextColor) drawInfo.TextColor=item.TextColor;
133564
+ if (item.BarColor) drawInfo.BarColor=item.BarColor;
133565
+ if (item.BGColor) drawInfo.BGColor=item.BGColor;
133566
+ }
133567
+ }
133568
+
133462
133569
  this.FormaTimeDrawInfo=function(column, stock, drawInfo, data)
133463
133570
  {
133464
133571
  if (!IFrameSplitOperator.IsNumber(stock.Time)) return;
@@ -133639,7 +133746,17 @@ function ChartReport()
133639
133746
 
133640
133747
  this.Canvas.textBaseline="bottom";
133641
133748
  this.Canvas.fillStyle=textColor;
133642
- this.Canvas.fillText(text,x,top+this.RowHeight-this.ItemMergin.Bottom);
133749
+
133750
+ if (this.ItemTextLines>1) //多行模式要上下居中
133751
+ {
133752
+ var yOffset=(this.RowHeight-this.ItemMergin.Bottom-this.ItemMergin.Top-this.ItemFontHeight)/2;
133753
+ var yBottom=top+this.RowHeight-this.ItemMergin.Bottom-yOffset;
133754
+ this.Canvas.fillText(text,x,yBottom);
133755
+ }
133756
+ else
133757
+ {
133758
+ this.Canvas.fillText(text,x,top+this.RowHeight-this.ItemMergin.Bottom);
133759
+ }
133643
133760
 
133644
133761
  if (bClip) this.Canvas.restore();
133645
133762
  }
@@ -147276,13 +147393,15 @@ function JSDialogSearchIndex()
147276
147393
  {
147277
147394
  this.HQChart.ChangeIndex(this.OpData.WindowIndex, indexItem.ID );
147278
147395
  }
147279
- else if (indexItem.Type==1) //自定义通达性
147396
+ else if (indexItem.Type==1) //自定义脚本指标
147280
147397
  {
147281
-
147398
+ var indexData={ ID:indexItem.ID, Name:indexItem.Name, Script:indexItem.Script, Args:indexItem.Args };
147399
+ this.HQChart.ChangeScriptIndex(this.OpData.WindowIndex, indexData);
147282
147400
  }
147283
147401
  else if (indexItem.Type==2) //api指标
147284
147402
  {
147285
-
147403
+ var indedData={ API: { ID:indexItem.ID, Name:indexItem.Name, Args:indexItem.Args, Url:'local'} };
147404
+ this.HQChart.ChangeAPIIndex(this.OpData.WindowIndex, indedData);
147286
147405
  }
147287
147406
  }
147288
147407
  else if (this.OpData.OpType==2)
@@ -147295,13 +147414,15 @@ function JSDialogSearchIndex()
147295
147414
  var obj={ WindowIndex:this.OpData.WindowIndex, IndexName:indexItem.ID };
147296
147415
  this.HQChart.AddOverlayIndex(obj);
147297
147416
  }
147298
- else if (indexItem.Type==1) //自定义通达性
147417
+ else if (indexItem.Type==1) //自定义脚本指标
147299
147418
  {
147300
-
147419
+ var obj={ WindowIndex:this.OpData.WindowIndex, IndexName:indexItem.ID, Name:indexItem.Name, Script:indexItem.Script, Args:indexItem.Args };
147420
+ this.HQChart.AddOverlayIndex(obj);
147301
147421
  }
147302
147422
  else if (indexItem.Type==2) //api指标
147303
147423
  {
147304
-
147424
+ var obj={ WindowIndex:this.OpData.WindowIndex, API: { ID:indexItem.ID, Name:indexItem.Name, Args:indexItem.Args, Url:'local'} };
147425
+ this.HQChart.AddOverlayIndex(obj);
147305
147426
  }
147306
147427
  }
147307
147428
 
@@ -147574,7 +147695,18 @@ JSDialogSearchIndex.GetDefaultIndexData=function()
147574
147695
  {Name:"VR 成交量变异率", ID:"VR", Type:0},
147575
147696
  {Name:"WAD 威廉多空力度线", ID:"WAD", Type:0}
147576
147697
  ]
147698
+ },
147699
+
147700
+ /*
147701
+ {
147702
+ Group:{ ID:"自定义", Name:"自定义"} ,
147703
+ AryIndex:
147704
+ [
147705
+ { Name:"收盘线(后台指标)", ID:"CLOSE_LINE", Type:2, Args:null },
147706
+ { Name:"高低均价(自定义脚本)", ID:"HIGH_LOW_AV", Type:1, Args:null , Script:"均价:(H+L)/2;高:H;低:L;", Args:[ { Name:'N', Value:20}, { Name:'M', Value:6}]},
147707
+ ]
147577
147708
  }
147709
+ */
147578
147710
  ]
147579
147711
 
147580
147712
  }
@@ -147706,7 +147838,7 @@ function HQChartScriptWorker()
147706
147838
 
147707
147839
 
147708
147840
 
147709
- var HQCHART_VERSION="1.1.14071";
147841
+ var HQCHART_VERSION="1.1.14078";
147710
147842
 
147711
147843
  function PrintHQChartVersion()
147712
147844
  {