hqchart 1.1.13928 → 1.1.13944

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.
@@ -5690,7 +5690,8 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
5690
5690
  if (option.EnableModifyDrawDialogV2===true) chart.InitalModifyDrawDialog();
5691
5691
 
5692
5692
  //K线tooltip
5693
- if (option.EnableTooltipDialog===true) chart.InitalTooltipDialog();
5693
+ if (option.TooltipDialog && option.TooltipDialog.Enable)
5694
+ chart.InitalTooltipDialog(option.TooltipDialog);
5694
5695
 
5695
5696
  //注册事件
5696
5697
  if (option.EventCallback)
@@ -6772,6 +6773,8 @@ var JSCHART_MENU_ID=
6772
6773
  CMD_REPORT_COLUMN_DEL_ID:62, //报价列表 删除列
6773
6774
  CMD_REPORT_COLUMN_MOVE_ID:63, //报价列表 列移动
6774
6775
  CMD_REPORT_COLUMN_FILTER_ID:64, //报价列表 筛选
6776
+
6777
+ CMD_DIALOG_TOOLTIP_ATTRIBUTE:65, //修改K线信息框属性 Ary:[{ Enable:, Style:}, ]
6775
6778
  }
6776
6779
 
6777
6780
 
@@ -7020,12 +7023,12 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7020
7023
  this.DialogDrawTool.Create();
7021
7024
  }
7022
7025
 
7023
- this.InitalTooltipDialog=function()
7026
+ this.InitalTooltipDialog=function(option)
7024
7027
  {
7025
7028
  if (this.DialogTooltip) return;
7026
7029
 
7027
7030
  this.DialogTooltip=new JSDialogTooltip();
7028
- this.DialogTooltip.Inital(this);
7031
+ this.DialogTooltip.Inital(this, option);
7029
7032
  this.DialogTooltip.Create();
7030
7033
  }
7031
7034
 
@@ -7099,6 +7102,14 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7099
7102
  this.DialogTooltip.Close();
7100
7103
  }
7101
7104
 
7105
+ this.DestroyTooltipDialog=function()
7106
+ {
7107
+ if (!this.DialogTooltip) return;
7108
+
7109
+ this.DialogTooltip.Destroy();
7110
+ this.DialogTooltip=null;
7111
+ }
7112
+
7102
7113
 
7103
7114
 
7104
7115
  //obj={ Element:, Canvas: }
@@ -7150,12 +7161,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7150
7161
  {
7151
7162
  this.IsDestroy=true;
7152
7163
  this.StopAutoUpdate();
7153
-
7154
- if (this.DialogTooltip)
7155
- {
7156
- this.DialogTooltip.Destroy();
7157
- this.DialogTooltip=null;
7158
- }
7164
+ this.DestroyTooltipDialog();
7159
7165
  }
7160
7166
 
7161
7167
  this.ChartDestory=this.ChartDestroy; //老版本写错了,需要兼容下
@@ -13732,6 +13738,20 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
13732
13738
  klineChart.InfoPosition=param;
13733
13739
  this.Draw();
13734
13740
  break;
13741
+ case JSCHART_MENU_ID.CMD_DIALOG_TOOLTIP_ATTRIBUTE:
13742
+ if (!aryArgs[0]) return false;
13743
+ var option=aryArgs[0];
13744
+ if (!IFrameSplitOperator.IsBool(option.Enable)) return false;
13745
+ if (option.Enable===false)
13746
+ {
13747
+ this.DestroyTooltipDialog();
13748
+ }
13749
+ else
13750
+ {
13751
+ this.DestroyTooltipDialog();
13752
+ this.InitalTooltipDialog(option);
13753
+ }
13754
+ break;
13735
13755
  }
13736
13756
  }
13737
13757
 
@@ -54770,6 +54790,7 @@ function ChartCorssCursor()
54770
54790
  this.XRangeBGColor=g_JSChartResource.CorssCursorXRangeBGColor;
54771
54791
  this.TextHeight=20; //文本字体高度
54772
54792
  this.LastPoint;
54793
+ this.LastValue; //{ Y:{ Value:, Extend: } }
54773
54794
  this.CursorIndex;
54774
54795
  this.IsOnlyDrawKLine=false; //是否只能画在K线上 (手机端)
54775
54796
  this.IsOnlyDrawMinute=false; //是否只能画在走势图价格线上
@@ -55001,6 +55022,7 @@ function ChartCorssCursor()
55001
55022
  {
55002
55023
  this.Status=0;
55003
55024
  this.RightButton.Rect=null;
55025
+ this.LastValue=null;
55004
55026
 
55005
55027
  if (!this.LastPoint) return;
55006
55028
 
@@ -55153,6 +55175,8 @@ function ChartCorssCursor()
55153
55175
  var yValue=this.Frame.GetYData(y,yValueExtend);
55154
55176
  if ( (this.IsOnlyDrawMinute || this.IsShowClose) && this.Close != null) yValue=this.Close;
55155
55177
 
55178
+ this.LastValue={ Y:{ Value:yValue, Extend:yValueExtend }}; //缓存十字光标对应的数值
55179
+
55156
55180
  //this.StringFormatX.Value=xValue;
55157
55181
  this.StringFormatX.Value=this.CursorIndex;
55158
55182
  this.StringFormatX.Point={X:x, Y:y};
@@ -73483,7 +73507,8 @@ function JSChartResource()
73483
73507
  Font:{ Size:15, Name:"微软雅黑"},
73484
73508
  BarMergin:{ Top:2, Left:3, Right:3, Bottom:2 },//单元格字体
73485
73509
  NameFont:{ Size:14, Name:"微软雅黑" },
73486
- SymbolFont:{ Size:12, Name:"微软雅黑" }
73510
+ SymbolFont:{ Size:12, Name:"微软雅黑" },
73511
+
73487
73512
  },
73488
73513
 
73489
73514
  //固定行
@@ -73498,6 +73523,13 @@ function JSChartResource()
73498
73523
  Mergin:{ Top:1, Bottom:1,Left:0, Right:0 },
73499
73524
  },
73500
73525
 
73526
+
73527
+ NameSymbolV2:
73528
+ {
73529
+ Name:{ Size:14, Name:"微软雅黑", Color: "rgb(60,60,60)"},
73530
+ Symbol:{ Size:10, Name:"微软雅黑", Color: "rgb(105 105 105)"},
73531
+ },
73532
+
73501
73533
  //涨停 跌停背景色
73502
73534
  LimitColor:
73503
73535
  {
@@ -74654,6 +74686,26 @@ function JSChartResource()
74654
74686
  }
74655
74687
  }
74656
74688
 
74689
+ if (item.NameSymbolV2)
74690
+ {
74691
+ var nameSymbol=item.NameSymbolV2;
74692
+ if (nameSymbol.Name)
74693
+ {
74694
+ var subItem=nameSymbol.Name;
74695
+ if (IFrameSplitOperator.IsNumber(subItem.Size)) this.Report.NameSymbolV2.Name.Size=subItem.Size;
74696
+ if (subItem.Name) this.Report.NameSymbolV2.Name.Name=subItem.Name;
74697
+ if (subItem.Color) this.Report.NameSymbolV2.Name.Color=subItem.Color;
74698
+ }
74699
+
74700
+ if (nameSymbol.Symbol)
74701
+ {
74702
+ var subItem=nameSymbol.Symbol;
74703
+ if (IFrameSplitOperator.IsNumber(subItem.Size)) this.Report.NameSymbolV2.Symbol.Size=subItem.Size;
74704
+ if (subItem.Name) this.Report.NameSymbolV2.Symbol.Name=subItem.Name;
74705
+ if (subItem.Color) this.Report.NameSymbolV2.Symbol.Color=subItem.Color;
74706
+ }
74707
+ }
74708
+
74657
74709
  if (item.Tab)
74658
74710
  {
74659
74711
  var tab=item.Tab;
@@ -75011,12 +75063,14 @@ function JSChartLocalization()
75011
75063
  ['DialogTooltip-Exchange', {CN:'换手率', EN:'Exchange', TC:'換手'}],
75012
75064
  ['DialogTooltip-Position', {CN:'持仓量', EN:'Position', TC:'持倉'}],
75013
75065
  ['DialogTooltip-Price', {CN:'价格', EN:'Price', TC:'價格'}],
75066
+ ['DialogTooltip-AvPrice', {CN:'均价', EN:'AVPrice:', TC:'均價'}],
75014
75067
  ['DialogTooltip-FClose', {CN:"结算价", EN:'Settlement', TC:'結算價'}],
75015
75068
  ['DialogTooltip-Amplitude', {CN:'振幅', EN:'amplitude', TC:'價格'}],
75016
75069
  ['DialogTooltip-AC-Price', {CN:'匹配价', EN:'Price', TC:'匹配價'}],
75017
75070
  ['DialogTooltip-AC-AvPrice', {CN:'匹配均价', EN:'AVPrice', TC:'匹配均價'}],
75018
75071
  ['DialogTooltip-AC-Increase', {CN:'竞价涨幅', EN:'Increase', TC:'競價漲幅'}],
75019
75072
  ['DialogTooltip-AC-Vol', {CN:'匹配量', EN:'Vol', TC:'匹配量'}],
75073
+ ['DialogTooltip-Value', {CN:'数值', EN:'Value', TC:'数值'}],
75020
75074
 
75021
75075
  //走势图PC tooltip
75022
75076
  ['PCTooltip-Date', {CN:'日期', EN:'Date', TC:"日期"}],
@@ -81677,6 +81731,15 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
81677
81731
  { Name:"样式2", Data:{ ID:JSCHART_MENU_ID.CMD_CHANGE_DRAG_RECT_SHOW_MODE_ID, Args:[1]}, Checked:1==this.ChartDragSelectRect.ShowMode },
81678
81732
  { Name:"样式3", Data:{ ID:JSCHART_MENU_ID.CMD_CHANGE_DRAG_RECT_SHOW_MODE_ID, Args:[2]}, Checked:2==this.ChartDragSelectRect.ShowMode },
81679
81733
  ]
81734
+ },
81735
+ {
81736
+ Name:"K线浮动框",
81737
+ SubMenu:
81738
+ [
81739
+ { Name:"禁用", Data:{ ID:JSCHART_MENU_ID.CMD_DIALOG_TOOLTIP_ATTRIBUTE, Args:[{Enable:false}]}, Checked:!this.DialogTooltip },
81740
+ { Name:"样式1", Data:{ ID:JSCHART_MENU_ID.CMD_DIALOG_TOOLTIP_ATTRIBUTE, Args:[{Enable:true, Style:0}]}, Checked:(this.DialogTooltip && this.DialogTooltip.Style===0) },
81741
+ { Name:"样式2", Data:{ ID:JSCHART_MENU_ID.CMD_DIALOG_TOOLTIP_ATTRIBUTE, Args:[{Enable:true, Style:1}]}, Checked:(this.DialogTooltip && this.DialogTooltip.Style===1) },
81742
+ ]
81680
81743
  }
81681
81744
  ]
81682
81745
  }
@@ -83332,6 +83395,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
83332
83395
  IsShowCorss:this.ChartCorssCursor.IsShowCorss, //是否显示十字线
83333
83396
  KItem:kItem,
83334
83397
  Symbol:this.Symbol, Name:this.Name,
83398
+ LastValue:this.ChartCorssCursor.LastValue,
83335
83399
  };
83336
83400
 
83337
83401
 
@@ -84798,11 +84862,38 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
84798
84862
  this.MouseDrag=drag;
84799
84863
  this.PhoneTouchInfo={ Start:{X:touches[0].clientX, Y:touches[0].clientY }, End:{ X:touches[0].clientX, Y:touches[0].clientY } };
84800
84864
  this.SelectChartDrawPicture=null;
84865
+
84866
+ var bStartTimer=true; //长按计时开始
84867
+ if (this.EnableClickModel)
84868
+ {
84869
+ if (this.ClickModel.IsShowCorssCursor==true) bStartTimer=false;
84870
+ else bStartTimer= true;
84871
+ }
84872
+
84873
+ if (bStartTimer)
84874
+ {
84875
+ this.StopDragTimer();
84876
+ this.DragTimer = setTimeout(()=>{
84877
+ this.IsPress=true;
84878
+ if (drag.Click.X == drag.LastMove.X && drag.Click.Y == drag.LastMove.Y) //手指没有移动,出现十字光标
84879
+ {
84880
+ this.MouseDrag = null;
84881
+ //移动十字光标
84882
+ var x = drag.Click.X;
84883
+ var y = drag.Click.Y;
84884
+ if (this.EnableClickModel===true) this.ClickModel.IsShowCorssCursor=true;
84885
+ self.MoveCorssCursor(drag.Click,e);//移动十字光标
84886
+ }
84801
84887
 
84802
- if (this.EnableScrollUpDown==false)
84803
- T_ShowCorssCursor(); //移动十字光标
84804
- else if (this.IsClickShowCorssCursor)
84805
- T_ShowCorssCursor();
84888
+ }, this.PressTime);
84889
+ }
84890
+ else if (!this.EnableClickModel)
84891
+ {
84892
+ if (this.EnableScrollUpDown==false)
84893
+ T_ShowCorssCursor(); //移动十字光标
84894
+ else if (this.IsClickShowCorssCursor)
84895
+ T_ShowCorssCursor();
84896
+ }
84806
84897
  }
84807
84898
 
84808
84899
  if (this.EnableZoomIndexWindow)
@@ -85349,6 +85440,15 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
85349
85440
  ]
85350
85441
  },
85351
85442
 
85443
+ {
85444
+ Name:"K线浮动框",
85445
+ SubMenu:
85446
+ [
85447
+ { Name:"禁用", Data:{ ID:JSCHART_MENU_ID.CMD_DIALOG_TOOLTIP_ATTRIBUTE, Args:[{Enable:false}]}, Checked:!this.DialogTooltip },
85448
+ { Name:"样式1", Data:{ ID:JSCHART_MENU_ID.CMD_DIALOG_TOOLTIP_ATTRIBUTE, Args:[{Enable:true, Style:0}]}, Checked:(this.DialogTooltip && this.DialogTooltip.Style===0) },
85449
+ { Name:"样式2", Data:{ ID:JSCHART_MENU_ID.CMD_DIALOG_TOOLTIP_ATTRIBUTE, Args:[{Enable:true, Style:1}]}, Checked:(this.DialogTooltip && this.DialogTooltip.Style===1) },
85450
+ ]
85451
+ }
85352
85452
 
85353
85453
  ]
85354
85454
  }
@@ -88507,6 +88607,15 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
88507
88607
 
88508
88608
  this.OnTouchFinished=function()
88509
88609
  {
88610
+ if (this.EnableClickModel===true)
88611
+ {
88612
+ if (this.ClickModel.IsShowCorssCursor==true && this.TouchDrawCount>0) return;
88613
+
88614
+ this.ClickModel.IsShowCorssCursor=false;
88615
+ this.DrawDynamicInfo();
88616
+ return;
88617
+ }
88618
+
88510
88619
  if (this.CorssCursorTouchEnd===true) //手势离开十字光标消失
88511
88620
  {
88512
88621
  this.DrawDynamicInfo();
@@ -89135,6 +89244,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
89135
89244
  IsShowCorss:this.ChartCorssCursor.IsShowCorss, //是否显示十字线
89136
89245
  MinItem:minuteItem,
89137
89246
  Symbol:this.Symbol, Name:this.Name,
89247
+ LastValue:this.ChartCorssCursor.LastValue,
89138
89248
  };
89139
89249
 
89140
89250
 
@@ -125654,6 +125764,12 @@ function GetBlackStyle()
125654
125764
  Text:"rgb(245,245,245)", //默认文本
125655
125765
  },
125656
125766
 
125767
+ NameSymbolV2:
125768
+ {
125769
+ Name:{ Size:14, Name:"微软雅黑", Color: "rgb(250,250,250)"},
125770
+ Symbol:{ Size:12, Name:"微软雅黑", Color: "rgb(190, 190, 190)"},
125771
+ },
125772
+
125657
125773
  CloseLine:
125658
125774
  {
125659
125775
  CloseColor:"rgb(30,144,255)",
@@ -131290,7 +131406,8 @@ var REPORT_COLUMN_ID=
131290
131406
  RISING_SPEED_10M_ID:63,
131291
131407
  RISING_SPEED_15M_ID:64,
131292
131408
 
131293
- SYMBOL_NAME_ID:99,
131409
+ SYMBOL_NAME_V2_ID:98, //单行
131410
+ SYMBOL_NAME_ID:99, //两行
131294
131411
 
131295
131412
  CUSTOM_STRING_TEXT_ID:100, //自定义字符串文本
131296
131413
  CUSTOM_NUMBER_TEXT_ID:101, //自定义数值型
@@ -131491,6 +131608,9 @@ function ChartReport()
131491
131608
  this.ItemSymbolFontConfig={Size:g_JSChartResource.Report.Item.SymbolFont.Size, Name:g_JSChartResource.Report.Item.SymbolFont.Name};
131492
131609
  this.ItemNameFontConfg={Size:g_JSChartResource.Report.Item.NameFont.Size, Name:g_JSChartResource.Report.Item.NameFont.Name};
131493
131610
 
131611
+ //名称+代码
131612
+ this.NameSymbolV2Config=CloneData(g_JSChartResource.Report.NameSymbolV2);
131613
+
131494
131614
  //缓存
131495
131615
  this.HeaderFont=12*GetDevicePixelRatio() +"px 微软雅黑";
131496
131616
  this.SortFont=null,
@@ -131499,6 +131619,7 @@ function ChartReport()
131499
131619
  this.ItemSymbolFont=12*GetDevicePixelRatio() +"px 微软雅黑";
131500
131620
  this.ItemNameFont=15*GetDevicePixelRatio() +"px 微软雅黑";
131501
131621
  this.ItemNameHeight=0;
131622
+ this.NameSymbolFont={ Symbol:null, Name:null };
131502
131623
  this.RowCount=0; //一屏显示行数
131503
131624
  this.HeaderHeight=0; //表头高度
131504
131625
  this.FixedRowHeight=0; //固定行高度
@@ -131643,6 +131764,8 @@ function ChartReport()
131643
131764
  if (item.TextColor) colItem.TextColor=item.TextColor;
131644
131765
  if (item.HeaderColor) colItem.HeaderColor=item.HeaderColor;
131645
131766
  if (item.MaxText) colItem.MaxText=item.MaxText;
131767
+ if (item.MaxText2) colItem.MaxText=item.MaxText2;
131768
+ if (IFrameSplitOperator.IsNumber(item.Space)) colItem.Space=item.Space;
131646
131769
  if (item.ID) colItem.ID=item.ID;
131647
131770
  if (item.FullColBGColor) colItem.FullColBGColor=item.FullColBGColor; //整列背景色
131648
131771
  if (item.HeaderBGColor) colItem.HeaderBGColor=item.HeaderBGColor; //表头背景色
@@ -131803,6 +131926,7 @@ function ChartReport()
131803
131926
  { Type:REPORT_COLUMN_ID.NAME_ID, Title:"名称", TextAlign:"left", Width:null, TextColor:g_JSChartResource.Report.FieldColor.Name, MaxText:"擎擎擎擎0" },
131804
131927
  { Type:REPORT_COLUMN_ID.NAME_EX_ID, Title:"名称", TextAlign:"left", Width:null, TextColor:g_JSChartResource.Report.FieldColor.Name, MaxText:"擎擎擎擎擎擎" },
131805
131928
  { Type:REPORT_COLUMN_ID.SYMBOL_NAME_ID, Title:"股票名称", TextAlign:"left", Width:null, TextColor:g_JSChartResource.Report.FieldColor.Name, MaxText:"擎擎擎擎0"},
131929
+ { 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 },
131806
131930
 
131807
131931
  { Type:REPORT_COLUMN_ID.INCREASE_ID, Title:"涨幅%", TextAlign:"right", Width:null, MaxText:"-888.88" },
131808
131932
  { Type:REPORT_COLUMN_ID.PRICE_ID, Title:"现价", TextAlign:"right", Width:null, MaxText:"88888.88" },
@@ -131996,6 +132120,9 @@ function ChartReport()
131996
132120
  this.ItemSymbolFont=`${this.ItemSymbolFontConfig.Size*pixelRatio}px ${ this.ItemSymbolFontConfig.Name}`;
131997
132121
  this.ItemNameFont=`${this.ItemNameFontConfg.Size*pixelRatio}px ${ this.ItemNameFontConfg.Name}`;
131998
132122
 
132123
+ this.NameSymbolFont.Symbol=`${this.NameSymbolV2Config.Symbol.Size*pixelRatio}px ${this.NameSymbolV2Config.Symbol.Name}`;
132124
+ this.NameSymbolFont.Name=`${this.ItemSymbolFontConfig.Name.Size*pixelRatio}px ${this.NameSymbolV2Config.Name.Name}`;
132125
+
131999
132126
  this.RowHeight=this.GetFontHeight(this.ItemFont,"擎")+ this.ItemMergin.Top+ this.ItemMergin.Bottom;
132000
132127
  this.FixedRowHeight=this.GetFontHeight(this.ItemFixedFont,"擎")+ this.ItemMergin.Top+ this.ItemMergin.Bottom;
132001
132128
  this.SortFont=`${this.SortConfig.Size*pixelRatio}px ${ this.SortConfig.Family}`;
@@ -132025,6 +132152,25 @@ function ChartReport()
132025
132152
  if (rowHeight>this.RowHeight) this.RowHeight=rowHeight;
132026
132153
  if (rowHeight>this.FixedRowHeight) this.FixedRowHeight=rowHeight;
132027
132154
  }
132155
+ else if (item.Type==REPORT_COLUMN_ID.SYMBOL_NAME_V2_ID) //单行显示
132156
+ {
132157
+ this.Canvas.font==this.NameSymbolFont.Name;
132158
+ var nameWidth=this.Canvas.measureText(item.MaxText).width;
132159
+ var nameHeight=this.GetFontHeight(this.ItemNameFont,"擎");
132160
+
132161
+
132162
+ this.Canvas.font==this.NameSymbolFont.Symbol;
132163
+ var symbolWidth=this.Canvas.measureText(item.MaxText2).width;
132164
+ var symboHeight=this.GetFontHeight(this.ItemSymbolFont,"擎");
132165
+
132166
+ this.ItemNameHeight=Math.abs(nameHeight,symboHeight);
132167
+
132168
+ var space=2;
132169
+ if (IFrameSplitOperator.IsNumber(item.Space)) space=item.Space;
132170
+ itemWidth=nameWidth+symbolWidth+space;
132171
+
132172
+ item.Width=itemWidth+4+this.ItemMergin.Left+this.ItemMergin.Right;
132173
+ }
132028
132174
  else
132029
132175
  {
132030
132176
  if (IFrameSplitOperator.IsNumber(item.FixedWidth)) itemWidth=item.FixedWidth;
@@ -132619,6 +132765,11 @@ function ChartReport()
132619
132765
 
132620
132766
  this.FormatDrawInfo(column, stock, drawInfo, data);
132621
132767
  }
132768
+ else if (column.Type==REPORT_COLUMN_ID.SYMBOL_NAME_V2_ID)
132769
+ {
132770
+ this.DrawSymbolNameV2(data, column, left, top, rowType);
132771
+ this.FormatDrawInfo(column, stock, drawInfo, data);
132772
+ }
132622
132773
  else if (column.Type==REPORT_COLUMN_ID.NAME_ID)
132623
132774
  {
132624
132775
  if (stock && stock.Name)
@@ -133069,6 +133220,72 @@ function ChartReport()
133069
133220
  this.Canvas.font=this.ItemFont; //还原字体
133070
133221
  }
133071
133222
 
133223
+ this.DrawSymbolNameV2=function(data, column, left, top, rowType)
133224
+ {
133225
+ var stock=data.Stock;
133226
+ var symbol=data.Symbol;
133227
+ var name;
133228
+ if (stock)
133229
+ {
133230
+ symbol=stock.Symbol;
133231
+ name=stock.Name;
133232
+ }
133233
+
133234
+ if (!symbol && !name) return;
133235
+
133236
+ var y=top+this.ItemMergin.Top+this.ItemNameHeight;
133237
+ var textLeft=left+this.ItemMergin.Left;
133238
+ var x=textLeft;
133239
+ var width=column.Width-this.ItemMergin.Left-this.ItemMergin.Right;
133240
+ var textAlign=column.TextAlign;
133241
+ if (textAlign=='center')
133242
+ {
133243
+ x=textLeft+width/2;
133244
+ this.Canvas.textAlign="center";
133245
+ }
133246
+ else if (textAlign=='right')
133247
+ {
133248
+ x=textLeft+width-2;
133249
+ this.Canvas.textAlign="right";
133250
+ }
133251
+ else
133252
+ {
133253
+ x+=2;
133254
+ this.Canvas.textAlign="left";
133255
+ }
133256
+
133257
+ this.Canvas.textBaseline="bottom";
133258
+
133259
+ var textColor=column.TextColor;
133260
+ var text=name;
133261
+ if (text)
133262
+ {
133263
+ this.Canvas.fillStyle=textColor;
133264
+ this.Canvas.font=this.NameSymbolFont.Name;
133265
+ text=this.TextEllipsis(text, width, column.MaxText);
133266
+ if (text)
133267
+ {
133268
+ this.Canvas.fillText(text,x,y);
133269
+ var textWidth=this.Canvas.measureText(text).width;
133270
+ var space=2;
133271
+ if (IFrameSplitOperator.IsNumber(column.Space)) space=column.Space;
133272
+ x+=(textWidth+space);
133273
+ }
133274
+
133275
+ }
133276
+
133277
+ var textColor=column.TextColor2;
133278
+ text=symbol;
133279
+ if (text)
133280
+ {
133281
+ this.Canvas.font=this.NameSymbolFont.Symbol;
133282
+ this.Canvas.fillStyle=textColor;
133283
+ this.Canvas.fillText(text,x,y);
133284
+ }
133285
+
133286
+ this.Canvas.font=this.ItemFont; //还原字体
133287
+ }
133288
+
133072
133289
  this.DrawLimitPriceBorder=function(value, stock, left, top, itemWidth)
133073
133290
  {
133074
133291
  if (!IFrameSplitOperator.IsNumber(value) || !stock) return;
@@ -143320,6 +143537,7 @@ function JSDialogTooltip()
143320
143537
  this.DivDialog=null;
143321
143538
  this.DragTitle=null;
143322
143539
  this.TitleBox=null; //{ DivTitle, DivName, DivName }
143540
+ this.Style=0; //0=一行一个, 1=2行一个
143323
143541
 
143324
143542
  this.HQChart=null;
143325
143543
 
@@ -143345,10 +143563,16 @@ function JSDialogTooltip()
143345
143563
 
143346
143564
  this.KItemCache=null;
143347
143565
  this.KItemCacheID=null;
143566
+ this.LastValueCache=null; //最后的鼠标位置对应的数值
143567
+ this.LastValueCacheID=null;
143348
143568
 
143349
- this.Inital=function(hqchart)
143569
+ this.Inital=function(hqchart, option)
143350
143570
  {
143351
- this.HQChart=hqchart;
143571
+ this.HQChart=hqchart;
143572
+ if (option)
143573
+ {
143574
+ if (IFrameSplitOperator.IsNumber(option.Style)) this.Style=option.Style;
143575
+ }
143352
143576
  }
143353
143577
 
143354
143578
  this.Destroy=function()
@@ -143411,36 +143635,78 @@ function JSDialogTooltip()
143411
143635
  table.appendChild(tbody);
143412
143636
 
143413
143637
  this.AryData=[];
143414
- for(var i=0;i<this.MaxRowCount;++i)
143638
+ if (this.Style==1)
143415
143639
  {
143416
- var rowItem={ Tr:null, TitleSpan:null, TextSpan:null };
143640
+ for(var i=0;i<this.MaxRowCount;++i)
143641
+ {
143642
+ var rowItem={ Tr:null, TitleSpan:null, TextSpan:null, Tr2:null };
143417
143643
 
143418
- var trDom=document.createElement("tr");
143419
- trDom.className='UMyChart_Tooltip_Group_Tr';
143420
- tbody.appendChild(trDom);
143421
- rowItem.Tr=trDom;
143644
+ var trDom=document.createElement("tr");
143645
+ trDom.className='UMyChart_Tooltip_Group_Tr';
143646
+ tbody.appendChild(trDom);
143647
+ rowItem.Tr=trDom;
143422
143648
 
143423
- var tdDom=document.createElement("td");
143424
- tdDom.className="UMyChart_Tooltip_Title_Td"; //标题
143425
- trDom.appendChild(tdDom);
143649
+ var tdDom=document.createElement("td");
143650
+ tdDom.className="UMyChart_Tooltip_Text_Sinlge_Td"; //标题
143651
+ trDom.appendChild(tdDom);
143426
143652
 
143427
- var spanDom=document.createElement("span");
143428
- spanDom.className='UMyChart_Tooltip_Title_Span';
143429
- spanDom.innerText='标题';
143430
- tdDom.appendChild(spanDom);
143431
- rowItem.TitleSpan=spanDom;
143653
+ var spanDom=document.createElement("span");
143654
+ spanDom.className='UMyChart_Tooltip_Title_Left_Span';
143655
+ spanDom.innerText='标题';
143656
+ tdDom.appendChild(spanDom);
143657
+ rowItem.TitleSpan=spanDom;
143432
143658
 
143433
- var tdDom=document.createElement("td");
143434
- tdDom.className="UMyChart_Tooltip_Text_Td"; //数值
143435
- trDom.appendChild(tdDom);
143659
+ var trDom=document.createElement("tr");
143660
+ trDom.className='UMyChart_Tooltip_Group_Tr';
143661
+ tbody.appendChild(trDom);
143662
+ rowItem.Tr2=trDom;
143436
143663
 
143437
- var spanDom=document.createElement("span");
143438
- spanDom.className='UMyChart_Tooltip_Text_Span';
143439
- spanDom.innerText='数值';
143440
- tdDom.appendChild(spanDom);
143441
- rowItem.TextSpan=spanDom;
143664
+ var tdDom=document.createElement("td");
143665
+ tdDom.className="UMyChart_Tooltip_Text_Sinlge_Td"; //数值
143666
+ trDom.appendChild(tdDom);
143442
143667
 
143443
- this.AryData.push(rowItem);
143668
+ var spanDom=document.createElement("span");
143669
+ spanDom.className='UMyChart_Tooltip_Text_Span';
143670
+ spanDom.innerText='数值';
143671
+ tdDom.appendChild(spanDom);
143672
+ rowItem.TextSpan=spanDom;
143673
+
143674
+ this.AryData.push(rowItem);
143675
+ }
143676
+ }
143677
+ else
143678
+ {
143679
+ for(var i=0;i<this.MaxRowCount;++i)
143680
+ {
143681
+ var rowItem={ Tr:null, TitleSpan:null, TextSpan:null };
143682
+
143683
+ var trDom=document.createElement("tr");
143684
+ trDom.className='UMyChart_Tooltip_Group_Tr';
143685
+ tbody.appendChild(trDom);
143686
+ rowItem.Tr=trDom;
143687
+
143688
+ var tdDom=document.createElement("td");
143689
+ tdDom.className="UMyChart_Tooltip_Title_Td"; //标题
143690
+ trDom.appendChild(tdDom);
143691
+
143692
+ var spanDom=document.createElement("span");
143693
+ spanDom.className='UMyChart_Tooltip_Title_Span';
143694
+ spanDom.innerText='标题';
143695
+ tdDom.appendChild(spanDom);
143696
+ rowItem.TitleSpan=spanDom;
143697
+
143698
+ var tdDom=document.createElement("td");
143699
+ tdDom.className="UMyChart_Tooltip_Text_Td"; //数值
143700
+ trDom.appendChild(tdDom);
143701
+
143702
+ var spanDom=document.createElement("span");
143703
+ spanDom.className='UMyChart_Tooltip_Text_Span';
143704
+ spanDom.innerText='数值';
143705
+ tdDom.appendChild(spanDom);
143706
+ rowItem.TextSpan=spanDom;
143707
+
143708
+ this.AryData.push(rowItem);
143709
+ }
143444
143710
  }
143445
143711
 
143446
143712
 
@@ -143463,10 +143729,23 @@ function JSDialogTooltip()
143463
143729
  if (this.HQChart.ClassName=='KLineChartContainer')
143464
143730
  {
143465
143731
  var strKItem=JSON.stringify(data.KItem);
143732
+ var strLastValue=JSON.stringify(data.LastValue);
143733
+ var bUpdata=false;
143466
143734
  if (this.KItemCacheID!=strKItem) //数据变动的才更新
143467
143735
  {
143468
143736
  this.KItemCache= JSON.parse(strKItem);
143469
143737
  this.KItemCacheID=strKItem;
143738
+ bUpdata=true;
143739
+ }
143740
+ if (data.LastValue && data.LastValue.Y && IFrameSplitOperator.IsNumber(data.LastValue.Y.Value) && this.LastValueCacheID!=strLastValue)
143741
+ {
143742
+ this.LastValueCache=JSON.parse(strLastValue);
143743
+ this.LastValueCacheID=strLastValue;
143744
+ bUpdata=true;
143745
+ }
143746
+
143747
+ if (bUpdata)
143748
+ {
143470
143749
  this.UpdateTableDOM();
143471
143750
  }
143472
143751
  else
@@ -143477,10 +143756,23 @@ function JSDialogTooltip()
143477
143756
  else if (this.HQChart.ClassName=='MinuteChartContainer')
143478
143757
  {
143479
143758
  var strKItem=JSON.stringify(data.MinItem);
143759
+ var strLastValue=JSON.stringify(data.LastValue);
143760
+ var bUpdata=false;
143480
143761
  if (this.KItemCacheID!=strKItem) //数据变动的才更新
143481
143762
  {
143482
143763
  this.KItemCache= JSON.parse(strKItem);
143483
143764
  this.KItemCacheID=strKItem;
143765
+ bUpdata=true;
143766
+ }
143767
+ if (data.LastValue && data.LastValue.Y && IFrameSplitOperator.IsNumber(data.LastValue.Y.Value) && this.LastValueCacheID!=strLastValue)
143768
+ {
143769
+ this.LastValueCache=JSON.parse(strLastValue);
143770
+ this.LastValueCacheID=strLastValue;
143771
+ bUpdata=true;
143772
+ }
143773
+
143774
+ if (bUpdata)
143775
+ {
143484
143776
  this.UpdateTableDOM();
143485
143777
  }
143486
143778
  }
@@ -143517,12 +143809,14 @@ function JSDialogTooltip()
143517
143809
  item.TextSpan.innerText=outItem.Text;
143518
143810
  item.TextSpan.style.color=outItem.Color;
143519
143811
  item.Tr.style.display="";
143812
+ if (item.Tr2) item.Tr2.style.display="";
143520
143813
  }
143521
143814
 
143522
143815
  for( ; index<this.MaxRowCount; ++index)
143523
143816
  {
143524
143817
  var item=this.AryData[index];
143525
143818
  item.Tr.style.display="none";
143819
+ if (item.Tr2) item.Tr2.style.display="none";
143526
143820
  }
143527
143821
  }
143528
143822
 
@@ -143604,6 +143898,9 @@ function JSDialogTooltip()
143604
143898
  {
143605
143899
  var defaultfloatPrecision=GetfloatPrecision(this.HQChart.Symbol);//价格小数位数
143606
143900
  var upperSymbol=this.HQChart.Symbol.toUpperCase();
143901
+ var priceFormat=0;
143902
+ if (this.Style==1) priceFormat=1;
143903
+
143607
143904
  //日期
143608
143905
  var dateItem=this.ForamtDate(data.Date,"YYYY/MM/DD/W",'DialogTooltip-Date' );
143609
143906
 
@@ -143614,18 +143911,45 @@ function JSDialogTooltip()
143614
143911
  var yClose=data.YClose; //昨收价|昨结算价
143615
143912
  var aryText=
143616
143913
  [
143617
- this.ForamtPrice(data.Open,yClose, defaultfloatPrecision,'DialogTooltip-Open'),
143618
- this.ForamtPrice(data.High,yClose, defaultfloatPrecision,'DialogTooltip-High'),
143619
- this.ForamtPrice(data.Low,yClose, defaultfloatPrecision,'DialogTooltip-Low'),
143620
- this.ForamtPrice(data.Close,yClose, defaultfloatPrecision,'DialogTooltip-Close'),
143914
+ this.ForamtPrice(data.Open,yClose, defaultfloatPrecision,'DialogTooltip-Open',priceFormat),
143915
+ this.ForamtPrice(data.High,yClose, defaultfloatPrecision,'DialogTooltip-High',priceFormat),
143916
+ this.ForamtPrice(data.Low,yClose, defaultfloatPrecision,'DialogTooltip-Low',priceFormat),
143917
+ this.ForamtPrice(data.Close,yClose, defaultfloatPrecision,'DialogTooltip-Close',priceFormat),
143621
143918
  this.FormatVol(data.Vol,'DialogTooltip-Vol' ),
143622
143919
  this.FormatAmount(data.Amount,'DialogTooltip-Amount' ),
143623
- this.FormatIncrease(data.Close,yClose,'DialogTooltip-Increase'),
143624
- this.FormatAmplitude(data.High,data.Low,yClose,'DialogTooltip-Amplitude'),
143920
+ this.FormatIncrease(data.Close,yClose,defaultfloatPrecision,'DialogTooltip-Increase',priceFormat),
143921
+ this.FormatAmplitude(data.High,data.Low,yClose,defaultfloatPrecision,'DialogTooltip-Amplitude',priceFormat),
143625
143922
  ];
143626
143923
 
143627
- if (timeItem) aryText.unshift(timeItem);
143628
- aryText.unshift(dateItem);
143924
+ if (this.LastValueCache && this.LastValueCache.Y)
143925
+ {
143926
+ var item=this.LastValueCache.Y;
143927
+ var rowItem=null;
143928
+ if (item.Extend.FrameID==0)
143929
+ {
143930
+ rowItem=this.ForamtPrice(item.Value,null, defaultfloatPrecision,'DialogTooltip-Value',2);
143931
+ }
143932
+ else
143933
+ {
143934
+ rowItem=this.ForamtValue(item.Value, 2,'DialogTooltip-Value');
143935
+ }
143936
+
143937
+ if (rowItem) aryText.unshift(rowItem);
143938
+ }
143939
+
143940
+ if (this.Style==1)
143941
+ {
143942
+ if (timeItem) aryText.unshift(timeItem);
143943
+ var dateItem=this.ForamtDate(data.Date,"YYYY/MM/DD",'DialogTooltip-Date' );
143944
+ aryText.unshift(dateItem);
143945
+ }
143946
+ else
143947
+ {
143948
+ if (timeItem) aryText.unshift(timeItem);
143949
+ aryText.unshift(dateItem);
143950
+ }
143951
+
143952
+
143629
143953
 
143630
143954
  //换手率
143631
143955
  if (MARKET_SUFFIX_NAME.IsSHSZStockA(upperSymbol) && data.FlowCapital>0)
@@ -143653,7 +143977,6 @@ function JSDialogTooltip()
143653
143977
  this.GetFormatMinuteTooltipText=function(data)
143654
143978
  {
143655
143979
  var defaultfloatPrecision=GetfloatPrecision(this.HQChart.Symbol);//价格小数位数
143656
-
143657
143980
  var aryText=[];
143658
143981
  if (data.Type==0) //连续交易
143659
143982
  {
@@ -143662,14 +143985,31 @@ function JSDialogTooltip()
143662
143985
 
143663
143986
  aryText=
143664
143987
  [
143665
- this.ForamtDate(item.Date,"YYYY/MM/DD/W",'DialogTooltip-Date' ),
143988
+ this.ForamtDate(item.Date,this.Style==1?"MM/DD/W":"YYYY/MM/DD/W",'DialogTooltip-Date' ),
143666
143989
  this.FormatTime(item.Time, null, "HH:MM", 'DialogTooltip-Time'),
143667
- this.ForamtPrice(item.Close,item.YClose, defaultfloatPrecision,'DialogTooltip-Price'),
143990
+ this.ForamtPrice(item.Close,item.YClose, defaultfloatPrecision,'DialogTooltip-Price', 1),
143991
+ this.ForamtPrice(item.AvPrice,item.YClose, defaultfloatPrecision,'DialogTooltip-AvPrice', 1),
143668
143992
  this.FormatRisefall(item.Close,item.YClose, defaultfloatPrecision,'DialogTooltip-Risefall'),
143669
- this.FormatIncrease(item.Close,item.YClose,'DialogTooltip-Increase'),
143993
+ this.FormatIncrease(item.Close,item.YClose,defaultfloatPrecision,'DialogTooltip-Increase', 1),
143670
143994
  this.FormatVol(item.Vol,'DialogTooltip-Vol' ),
143671
143995
  this.FormatAmount(item.Amount,'DialogTooltip-Amount' ),
143672
143996
  ];
143997
+
143998
+ if (this.LastValueCache && this.LastValueCache.Y)
143999
+ {
144000
+ var item=this.LastValueCache.Y;
144001
+ var rowItem=null;
144002
+ if (item.Extend.FrameID==0)
144003
+ {
144004
+ rowItem=this.ForamtPrice(item.Value,null, defaultfloatPrecision,'DialogTooltip-Value',2);
144005
+ }
144006
+ else
144007
+ {
144008
+ rowItem=this.ForamtValue(item.Value, 2,'DialogTooltip-Value');
144009
+ }
144010
+
144011
+ if (rowItem) aryText.splice(2,0,rowItem);
144012
+ }
143673
144013
  }
143674
144014
  else if (data.Type==1) //集合竞价
143675
144015
  {
@@ -143680,10 +144020,10 @@ function JSDialogTooltip()
143680
144020
  if (item.Ver===1) timeForamt="HH:MM"
143681
144021
  aryText=
143682
144022
  [
143683
- this.ForamtDate(item.Date,"YYYY/MM/DD/W",'DialogTooltip-Date' ),
144023
+ this.ForamtDate(item.Date,this.Style==1?"MM/DD/W":"YYYY/MM/DD/W",'DialogTooltip-Date' ),
143684
144024
  this.FormatTime(item.Time, null, timeForamt, 'DialogTooltip-Time'),
143685
- this.ForamtPrice(item.Price,item.YClose, defaultfloatPrecision,'DialogTooltip-AC-Price'),
143686
- this.FormatIncrease(item.Price,item.YClose,'DialogTooltip-AC-Increase'),
144025
+ this.ForamtPrice(item.Price,item.YClose, defaultfloatPrecision,'DialogTooltip-AC-Price',1),
144026
+ this.FormatIncrease(item.Price,item.YClose,defaultfloatPrecision,'DialogTooltip-AC-Increase',1),
143687
144027
  this.FormatVol(item.Vol[0],'DialogTooltip-AC-Vol' ),
143688
144028
  ];
143689
144029
  }
@@ -143752,8 +144092,8 @@ function JSDialogTooltip()
143752
144092
 
143753
144093
 
143754
144094
  /////////////////////////////////////////////////////////////////////////////////////////////
143755
- //数据格式化
143756
- this.ForamtPrice=function(price, yClose, defaultfloatPrecision, TitleID)
144095
+ //数据格式化 format=0 点差+涨幅 1=涨幅
144096
+ this.ForamtPrice=function(price, yClose, defaultfloatPrecision, TitleID, format)
143757
144097
  {
143758
144098
  var item=
143759
144099
  {
@@ -143764,12 +144104,44 @@ function JSDialogTooltip()
143764
144104
 
143765
144105
  if (!IFrameSplitOperator.IsNumber(price)) return item;
143766
144106
 
143767
- item.Text=price.toFixed(defaultfloatPrecision);
144107
+ if (format==2)
144108
+ {
144109
+ item.Text=price.toFixed(defaultfloatPrecision);
144110
+ item.Color=this.TitleColor;
144111
+ return item;
144112
+ }
144113
+
144114
+ if (IFrameSplitOperator.IsNumber(yClose) && format!=1)
144115
+ {
144116
+ var value=(price-yClose)/yClose*100;
144117
+ item.Text=`${price.toFixed(defaultfloatPrecision)}(${value.toFixed(2)}%)`;
144118
+ }
144119
+ else
144120
+ {
144121
+ item.Text=price.toFixed(defaultfloatPrecision);
144122
+ }
144123
+
144124
+
143768
144125
  item.Color=this.GetColor(price, yClose);
143769
144126
 
143770
144127
  return item;
143771
144128
  }
143772
144129
 
144130
+ this.ForamtValue=function(value, defaultfloatPrecision, TitleID)
144131
+ {
144132
+ var item=
144133
+ {
144134
+ Title:g_JSChartLocalization.GetText(TitleID,this.LanguageID),
144135
+ Text:'--',
144136
+ Color:this.TitleColor
144137
+ };
144138
+
144139
+ if (!IFrameSplitOperator.IsNumber(value)) return item;
144140
+
144141
+ item.Text=IFrameSplitOperator.FormatValueStringV2(value,defaultfloatPrecision,2,this.LanguageID);
144142
+ return item;
144143
+ }
144144
+
143773
144145
  this.FormatVol=function(vol, TitleID)
143774
144146
  {
143775
144147
  var item=
@@ -143802,7 +144174,7 @@ function JSDialogTooltip()
143802
144174
  return item;
143803
144175
  }
143804
144176
 
143805
- this.FormatIncrease=function(price, yClose, TitleID)
144177
+ this.FormatIncrease=function(price, yClose, defaultfloatPrecision, TitleID, fromat)
143806
144178
  {
143807
144179
  //涨幅
143808
144180
  var item=
@@ -143814,8 +144186,19 @@ function JSDialogTooltip()
143814
144186
 
143815
144187
  if (!IFrameSplitOperator.IsNumber(price) || !IFrameSplitOperator.IsNumber(yClose)) return item;
143816
144188
 
144189
+
144190
+
144191
+ var diffValue=price-yClose;
143817
144192
  var value=(price-yClose)/yClose;
143818
- item.Text=`${(value*100).toFixed(2)}%`;
144193
+ if (fromat==1)
144194
+ {
144195
+ item.Text=`${(value*100).toFixed(2)}%`;
144196
+ }
144197
+ else
144198
+ {
144199
+ item.Text=`${diffValue.toFixed(defaultfloatPrecision)}(${(value*100).toFixed(2)}%)`;
144200
+ }
144201
+
143819
144202
  item.Color=this.GetColor(value,0);
143820
144203
 
143821
144204
  return item;
@@ -143840,9 +144223,9 @@ function JSDialogTooltip()
143840
144223
  return item;
143841
144224
  }
143842
144225
 
143843
- this.FormatAmplitude=function(high, low, yClose, TitleID)
144226
+ this.FormatAmplitude=function(high, low, yClose, defaultfloatPrecision, TitleID, fromat)
143844
144227
  {
143845
- //涨幅
144228
+ //振幅
143846
144229
  var item=
143847
144230
  {
143848
144231
  Title:g_JSChartLocalization.GetText(TitleID,this.LanguageID),
@@ -143853,8 +144236,10 @@ function JSDialogTooltip()
143853
144236
 
143854
144237
  if (!IFrameSplitOperator.IsNumber(high) || !IFrameSplitOperator.IsNumber(low) || !IFrameSplitOperator.IsNumber(yClose)) return item;
143855
144238
 
144239
+ var diffValue=high-low;
143856
144240
  var value=(high-low)/yClose;
143857
- item.Text=`${(value*100).toFixed(2)}%`;
144241
+ if (fromat==1) item.Text=`${(value*100).toFixed(2)}%`;
144242
+ else item.Text=`${diffValue.toFixed(defaultfloatPrecision)}(${(value*100).toFixed(2)}%)`;
143858
144243
  item.Color=this.GetColor(value,0);
143859
144244
 
143860
144245
  return item;
@@ -144078,7 +144463,7 @@ function HQChartScriptWorker()
144078
144463
 
144079
144464
 
144080
144465
 
144081
- var HQCHART_VERSION="1.1.13927";
144466
+ var HQCHART_VERSION="1.1.13943";
144082
144467
 
144083
144468
  function PrintHQChartVersion()
144084
144469
  {