hqchart 1.1.13928 → 1.1.13933

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.
@@ -589,6 +589,12 @@ function GetBlackStyle()
589
589
  Text:"rgb(245,245,245)", //默认文本
590
590
  },
591
591
 
592
+ NameSymbolV2:
593
+ {
594
+ Name:{ Size:14, Name:"微软雅黑", Color: "rgb(250,250,250)"},
595
+ Symbol:{ Size:12, Name:"微软雅黑", Color: "rgb(190, 190, 190)"},
596
+ },
597
+
592
598
  CloseLine:
593
599
  {
594
600
  CloseColor:"rgb(30,144,255)",
@@ -5646,7 +5646,8 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
5646
5646
  if (option.EnableModifyDrawDialogV2===true) chart.InitalModifyDrawDialog();
5647
5647
 
5648
5648
  //K线tooltip
5649
- if (option.EnableTooltipDialog===true) chart.InitalTooltipDialog();
5649
+ if (option.TooltipDialog && option.TooltipDialog.Enable)
5650
+ chart.InitalTooltipDialog(option.TooltipDialog);
5650
5651
 
5651
5652
  //注册事件
5652
5653
  if (option.EventCallback)
@@ -6728,6 +6729,8 @@ var JSCHART_MENU_ID=
6728
6729
  CMD_REPORT_COLUMN_DEL_ID:62, //报价列表 删除列
6729
6730
  CMD_REPORT_COLUMN_MOVE_ID:63, //报价列表 列移动
6730
6731
  CMD_REPORT_COLUMN_FILTER_ID:64, //报价列表 筛选
6732
+
6733
+ CMD_DIALOG_TOOLTIP_ATTRIBUTE:65, //修改K线信息框属性 Ary:[{ Enable:, Style:}, ]
6731
6734
  }
6732
6735
 
6733
6736
 
@@ -6976,12 +6979,12 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
6976
6979
  this.DialogDrawTool.Create();
6977
6980
  }
6978
6981
 
6979
- this.InitalTooltipDialog=function()
6982
+ this.InitalTooltipDialog=function(option)
6980
6983
  {
6981
6984
  if (this.DialogTooltip) return;
6982
6985
 
6983
6986
  this.DialogTooltip=new JSDialogTooltip();
6984
- this.DialogTooltip.Inital(this);
6987
+ this.DialogTooltip.Inital(this, option);
6985
6988
  this.DialogTooltip.Create();
6986
6989
  }
6987
6990
 
@@ -7055,6 +7058,14 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7055
7058
  this.DialogTooltip.Close();
7056
7059
  }
7057
7060
 
7061
+ this.DestroyTooltipDialog=function()
7062
+ {
7063
+ if (!this.DialogTooltip) return;
7064
+
7065
+ this.DialogTooltip.Destroy();
7066
+ this.DialogTooltip=null;
7067
+ }
7068
+
7058
7069
 
7059
7070
 
7060
7071
  //obj={ Element:, Canvas: }
@@ -7106,12 +7117,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7106
7117
  {
7107
7118
  this.IsDestroy=true;
7108
7119
  this.StopAutoUpdate();
7109
-
7110
- if (this.DialogTooltip)
7111
- {
7112
- this.DialogTooltip.Destroy();
7113
- this.DialogTooltip=null;
7114
- }
7120
+ this.DestroyTooltipDialog();
7115
7121
  }
7116
7122
 
7117
7123
  this.ChartDestory=this.ChartDestroy; //老版本写错了,需要兼容下
@@ -13688,6 +13694,20 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
13688
13694
  klineChart.InfoPosition=param;
13689
13695
  this.Draw();
13690
13696
  break;
13697
+ case JSCHART_MENU_ID.CMD_DIALOG_TOOLTIP_ATTRIBUTE:
13698
+ if (!aryArgs[0]) return false;
13699
+ var option=aryArgs[0];
13700
+ if (!IFrameSplitOperator.IsBool(option.Enable)) return false;
13701
+ if (option.Enable===false)
13702
+ {
13703
+ this.DestroyTooltipDialog();
13704
+ }
13705
+ else
13706
+ {
13707
+ this.DestroyTooltipDialog();
13708
+ this.InitalTooltipDialog(option);
13709
+ }
13710
+ break;
13691
13711
  }
13692
13712
  }
13693
13713
 
@@ -73439,7 +73459,8 @@ function JSChartResource()
73439
73459
  Font:{ Size:15, Name:"微软雅黑"},
73440
73460
  BarMergin:{ Top:2, Left:3, Right:3, Bottom:2 },//单元格字体
73441
73461
  NameFont:{ Size:14, Name:"微软雅黑" },
73442
- SymbolFont:{ Size:12, Name:"微软雅黑" }
73462
+ SymbolFont:{ Size:12, Name:"微软雅黑" },
73463
+
73443
73464
  },
73444
73465
 
73445
73466
  //固定行
@@ -73454,6 +73475,13 @@ function JSChartResource()
73454
73475
  Mergin:{ Top:1, Bottom:1,Left:0, Right:0 },
73455
73476
  },
73456
73477
 
73478
+
73479
+ NameSymbolV2:
73480
+ {
73481
+ Name:{ Size:14, Name:"微软雅黑", Color: "rgb(60,60,60)"},
73482
+ Symbol:{ Size:10, Name:"微软雅黑", Color: "rgb(105 105 105)"},
73483
+ },
73484
+
73457
73485
  //涨停 跌停背景色
73458
73486
  LimitColor:
73459
73487
  {
@@ -74610,6 +74638,26 @@ function JSChartResource()
74610
74638
  }
74611
74639
  }
74612
74640
 
74641
+ if (item.NameSymbolV2)
74642
+ {
74643
+ var nameSymbol=item.NameSymbolV2;
74644
+ if (nameSymbol.Name)
74645
+ {
74646
+ var subItem=nameSymbol.Name;
74647
+ if (IFrameSplitOperator.IsNumber(subItem.Size)) this.Report.NameSymbolV2.Name.Size=subItem.Size;
74648
+ if (subItem.Name) this.Report.NameSymbolV2.Name.Name=subItem.Name;
74649
+ if (subItem.Color) this.Report.NameSymbolV2.Name.Color=subItem.Color;
74650
+ }
74651
+
74652
+ if (nameSymbol.Symbol)
74653
+ {
74654
+ var subItem=nameSymbol.Symbol;
74655
+ if (IFrameSplitOperator.IsNumber(subItem.Size)) this.Report.NameSymbolV2.Symbol.Size=subItem.Size;
74656
+ if (subItem.Name) this.Report.NameSymbolV2.Symbol.Name=subItem.Name;
74657
+ if (subItem.Color) this.Report.NameSymbolV2.Symbol.Color=subItem.Color;
74658
+ }
74659
+ }
74660
+
74613
74661
  if (item.Tab)
74614
74662
  {
74615
74663
  var tab=item.Tab;
@@ -81633,6 +81681,15 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
81633
81681
  { Name:"样式2", Data:{ ID:JSCHART_MENU_ID.CMD_CHANGE_DRAG_RECT_SHOW_MODE_ID, Args:[1]}, Checked:1==this.ChartDragSelectRect.ShowMode },
81634
81682
  { Name:"样式3", Data:{ ID:JSCHART_MENU_ID.CMD_CHANGE_DRAG_RECT_SHOW_MODE_ID, Args:[2]}, Checked:2==this.ChartDragSelectRect.ShowMode },
81635
81683
  ]
81684
+ },
81685
+ {
81686
+ Name:"K线浮动框",
81687
+ SubMenu:
81688
+ [
81689
+ { Name:"禁用", Data:{ ID:JSCHART_MENU_ID.CMD_DIALOG_TOOLTIP_ATTRIBUTE, Args:[{Enable:false}]}, Checked:!this.DialogTooltip },
81690
+ { Name:"样式1", Data:{ ID:JSCHART_MENU_ID.CMD_DIALOG_TOOLTIP_ATTRIBUTE, Args:[{Enable:true, Style:0}]}, Checked:(this.DialogTooltip && this.DialogTooltip.Style===0) },
81691
+ { Name:"样式2", Data:{ ID:JSCHART_MENU_ID.CMD_DIALOG_TOOLTIP_ATTRIBUTE, Args:[{Enable:true, Style:1}]}, Checked:(this.DialogTooltip && this.DialogTooltip.Style===1) },
81692
+ ]
81636
81693
  }
81637
81694
  ]
81638
81695
  }
@@ -85305,6 +85362,15 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
85305
85362
  ]
85306
85363
  },
85307
85364
 
85365
+ {
85366
+ Name:"K线浮动框",
85367
+ SubMenu:
85368
+ [
85369
+ { Name:"禁用", Data:{ ID:JSCHART_MENU_ID.CMD_DIALOG_TOOLTIP_ATTRIBUTE, Args:[{Enable:false}]}, Checked:!this.DialogTooltip },
85370
+ { Name:"样式1", Data:{ ID:JSCHART_MENU_ID.CMD_DIALOG_TOOLTIP_ATTRIBUTE, Args:[{Enable:true, Style:0}]}, Checked:(this.DialogTooltip && this.DialogTooltip.Style===0) },
85371
+ { Name:"样式2", Data:{ ID:JSCHART_MENU_ID.CMD_DIALOG_TOOLTIP_ATTRIBUTE, Args:[{Enable:true, Style:1}]}, Checked:(this.DialogTooltip && this.DialogTooltip.Style===1) },
85372
+ ]
85373
+ }
85308
85374
 
85309
85375
  ]
85310
85376
  }
@@ -125610,6 +125676,12 @@ function GetBlackStyle()
125610
125676
  Text:"rgb(245,245,245)", //默认文本
125611
125677
  },
125612
125678
 
125679
+ NameSymbolV2:
125680
+ {
125681
+ Name:{ Size:14, Name:"微软雅黑", Color: "rgb(250,250,250)"},
125682
+ Symbol:{ Size:12, Name:"微软雅黑", Color: "rgb(190, 190, 190)"},
125683
+ },
125684
+
125613
125685
  CloseLine:
125614
125686
  {
125615
125687
  CloseColor:"rgb(30,144,255)",
@@ -131246,7 +131318,8 @@ var REPORT_COLUMN_ID=
131246
131318
  RISING_SPEED_10M_ID:63,
131247
131319
  RISING_SPEED_15M_ID:64,
131248
131320
 
131249
- SYMBOL_NAME_ID:99,
131321
+ SYMBOL_NAME_V2_ID:98, //单行
131322
+ SYMBOL_NAME_ID:99, //两行
131250
131323
 
131251
131324
  CUSTOM_STRING_TEXT_ID:100, //自定义字符串文本
131252
131325
  CUSTOM_NUMBER_TEXT_ID:101, //自定义数值型
@@ -131447,6 +131520,9 @@ function ChartReport()
131447
131520
  this.ItemSymbolFontConfig={Size:g_JSChartResource.Report.Item.SymbolFont.Size, Name:g_JSChartResource.Report.Item.SymbolFont.Name};
131448
131521
  this.ItemNameFontConfg={Size:g_JSChartResource.Report.Item.NameFont.Size, Name:g_JSChartResource.Report.Item.NameFont.Name};
131449
131522
 
131523
+ //名称+代码
131524
+ this.NameSymbolV2Config=CloneData(g_JSChartResource.Report.NameSymbolV2);
131525
+
131450
131526
  //缓存
131451
131527
  this.HeaderFont=12*GetDevicePixelRatio() +"px 微软雅黑";
131452
131528
  this.SortFont=null,
@@ -131455,6 +131531,7 @@ function ChartReport()
131455
131531
  this.ItemSymbolFont=12*GetDevicePixelRatio() +"px 微软雅黑";
131456
131532
  this.ItemNameFont=15*GetDevicePixelRatio() +"px 微软雅黑";
131457
131533
  this.ItemNameHeight=0;
131534
+ this.NameSymbolFont={ Symbol:null, Name:null };
131458
131535
  this.RowCount=0; //一屏显示行数
131459
131536
  this.HeaderHeight=0; //表头高度
131460
131537
  this.FixedRowHeight=0; //固定行高度
@@ -131599,6 +131676,8 @@ function ChartReport()
131599
131676
  if (item.TextColor) colItem.TextColor=item.TextColor;
131600
131677
  if (item.HeaderColor) colItem.HeaderColor=item.HeaderColor;
131601
131678
  if (item.MaxText) colItem.MaxText=item.MaxText;
131679
+ if (item.MaxText2) colItem.MaxText=item.MaxText2;
131680
+ if (IFrameSplitOperator.IsNumber(item.Space)) colItem.Space=item.Space;
131602
131681
  if (item.ID) colItem.ID=item.ID;
131603
131682
  if (item.FullColBGColor) colItem.FullColBGColor=item.FullColBGColor; //整列背景色
131604
131683
  if (item.HeaderBGColor) colItem.HeaderBGColor=item.HeaderBGColor; //表头背景色
@@ -131759,6 +131838,7 @@ function ChartReport()
131759
131838
  { Type:REPORT_COLUMN_ID.NAME_ID, Title:"名称", TextAlign:"left", Width:null, TextColor:g_JSChartResource.Report.FieldColor.Name, MaxText:"擎擎擎擎0" },
131760
131839
  { Type:REPORT_COLUMN_ID.NAME_EX_ID, Title:"名称", TextAlign:"left", Width:null, TextColor:g_JSChartResource.Report.FieldColor.Name, MaxText:"擎擎擎擎擎擎" },
131761
131840
  { Type:REPORT_COLUMN_ID.SYMBOL_NAME_ID, Title:"股票名称", TextAlign:"left", Width:null, TextColor:g_JSChartResource.Report.FieldColor.Name, MaxText:"擎擎擎擎0"},
131841
+ { Type:REPORT_COLUMN_ID.SYMBOL_NAME_V2_ID, Title:"名称/代码", TextAlign:"left", Width:null, TextColor:g_JSChartResource.Report.NameSymbolV2.Name.Color, MaxText:"擎擎擎擎*", MaxText2:"999999", Space:5, TextColor2:g_JSChartResource.Report.NameSymbolV2.Symbol.Color },
131762
131842
 
131763
131843
  { Type:REPORT_COLUMN_ID.INCREASE_ID, Title:"涨幅%", TextAlign:"right", Width:null, MaxText:"-888.88" },
131764
131844
  { Type:REPORT_COLUMN_ID.PRICE_ID, Title:"现价", TextAlign:"right", Width:null, MaxText:"88888.88" },
@@ -131952,6 +132032,9 @@ function ChartReport()
131952
132032
  this.ItemSymbolFont=`${this.ItemSymbolFontConfig.Size*pixelRatio}px ${ this.ItemSymbolFontConfig.Name}`;
131953
132033
  this.ItemNameFont=`${this.ItemNameFontConfg.Size*pixelRatio}px ${ this.ItemNameFontConfg.Name}`;
131954
132034
 
132035
+ this.NameSymbolFont.Symbol=`${this.NameSymbolV2Config.Symbol.Size*pixelRatio}px ${this.NameSymbolV2Config.Symbol.Name}`;
132036
+ this.NameSymbolFont.Name=`${this.ItemSymbolFontConfig.Name.Size*pixelRatio}px ${this.NameSymbolV2Config.Name.Name}`;
132037
+
131955
132038
  this.RowHeight=this.GetFontHeight(this.ItemFont,"擎")+ this.ItemMergin.Top+ this.ItemMergin.Bottom;
131956
132039
  this.FixedRowHeight=this.GetFontHeight(this.ItemFixedFont,"擎")+ this.ItemMergin.Top+ this.ItemMergin.Bottom;
131957
132040
  this.SortFont=`${this.SortConfig.Size*pixelRatio}px ${ this.SortConfig.Family}`;
@@ -131981,6 +132064,25 @@ function ChartReport()
131981
132064
  if (rowHeight>this.RowHeight) this.RowHeight=rowHeight;
131982
132065
  if (rowHeight>this.FixedRowHeight) this.FixedRowHeight=rowHeight;
131983
132066
  }
132067
+ else if (item.Type==REPORT_COLUMN_ID.SYMBOL_NAME_V2_ID) //单行显示
132068
+ {
132069
+ this.Canvas.font==this.NameSymbolFont.Name;
132070
+ var nameWidth=this.Canvas.measureText(item.MaxText).width;
132071
+ var nameHeight=this.GetFontHeight(this.ItemNameFont,"擎");
132072
+
132073
+
132074
+ this.Canvas.font==this.NameSymbolFont.Symbol;
132075
+ var symbolWidth=this.Canvas.measureText(item.MaxText2).width;
132076
+ var symboHeight=this.GetFontHeight(this.ItemSymbolFont,"擎");
132077
+
132078
+ this.ItemNameHeight=Math.abs(nameHeight,symboHeight);
132079
+
132080
+ var space=2;
132081
+ if (IFrameSplitOperator.IsNumber(item.Space)) space=item.Space;
132082
+ itemWidth=nameWidth+symbolWidth+space;
132083
+
132084
+ item.Width=itemWidth+4+this.ItemMergin.Left+this.ItemMergin.Right;
132085
+ }
131984
132086
  else
131985
132087
  {
131986
132088
  if (IFrameSplitOperator.IsNumber(item.FixedWidth)) itemWidth=item.FixedWidth;
@@ -132575,6 +132677,11 @@ function ChartReport()
132575
132677
 
132576
132678
  this.FormatDrawInfo(column, stock, drawInfo, data);
132577
132679
  }
132680
+ else if (column.Type==REPORT_COLUMN_ID.SYMBOL_NAME_V2_ID)
132681
+ {
132682
+ this.DrawSymbolNameV2(data, column, left, top, rowType);
132683
+ this.FormatDrawInfo(column, stock, drawInfo, data);
132684
+ }
132578
132685
  else if (column.Type==REPORT_COLUMN_ID.NAME_ID)
132579
132686
  {
132580
132687
  if (stock && stock.Name)
@@ -133025,6 +133132,72 @@ function ChartReport()
133025
133132
  this.Canvas.font=this.ItemFont; //还原字体
133026
133133
  }
133027
133134
 
133135
+ this.DrawSymbolNameV2=function(data, column, left, top, rowType)
133136
+ {
133137
+ var stock=data.Stock;
133138
+ var symbol=data.Symbol;
133139
+ var name;
133140
+ if (stock)
133141
+ {
133142
+ symbol=stock.Symbol;
133143
+ name=stock.Name;
133144
+ }
133145
+
133146
+ if (!symbol && !name) return;
133147
+
133148
+ var y=top+this.ItemMergin.Top+this.ItemNameHeight;
133149
+ var textLeft=left+this.ItemMergin.Left;
133150
+ var x=textLeft;
133151
+ var width=column.Width-this.ItemMergin.Left-this.ItemMergin.Right;
133152
+ var textAlign=column.TextAlign;
133153
+ if (textAlign=='center')
133154
+ {
133155
+ x=textLeft+width/2;
133156
+ this.Canvas.textAlign="center";
133157
+ }
133158
+ else if (textAlign=='right')
133159
+ {
133160
+ x=textLeft+width-2;
133161
+ this.Canvas.textAlign="right";
133162
+ }
133163
+ else
133164
+ {
133165
+ x+=2;
133166
+ this.Canvas.textAlign="left";
133167
+ }
133168
+
133169
+ this.Canvas.textBaseline="bottom";
133170
+
133171
+ var textColor=column.TextColor;
133172
+ var text=name;
133173
+ if (text)
133174
+ {
133175
+ this.Canvas.fillStyle=textColor;
133176
+ this.Canvas.font=this.NameSymbolFont.Name;
133177
+ text=this.TextEllipsis(text, width, column.MaxText);
133178
+ if (text)
133179
+ {
133180
+ this.Canvas.fillText(text,x,y);
133181
+ var textWidth=this.Canvas.measureText(text).width;
133182
+ var space=2;
133183
+ if (IFrameSplitOperator.IsNumber(column.Space)) space=column.Space;
133184
+ x+=(textWidth+space);
133185
+ }
133186
+
133187
+ }
133188
+
133189
+ var textColor=column.TextColor2;
133190
+ text=symbol;
133191
+ if (text)
133192
+ {
133193
+ this.Canvas.font=this.NameSymbolFont.Symbol;
133194
+ this.Canvas.fillStyle=textColor;
133195
+ this.Canvas.fillText(text,x,y);
133196
+ }
133197
+
133198
+ this.Canvas.font=this.ItemFont; //还原字体
133199
+ }
133200
+
133028
133201
  this.DrawLimitPriceBorder=function(value, stock, left, top, itemWidth)
133029
133202
  {
133030
133203
  if (!IFrameSplitOperator.IsNumber(value) || !stock) return;
@@ -138867,7 +139040,7 @@ function ScrollBarBGChart()
138867
139040
 
138868
139041
 
138869
139042
 
138870
- var HQCHART_VERSION="1.1.13927";
139043
+ var HQCHART_VERSION="1.1.13932";
138871
139044
 
138872
139045
  function PrintHQChartVersion()
138873
139046
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.13927";
8
+ var HQCHART_VERSION="1.1.13932";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {