hqchart 1.1.13911 → 1.1.13915

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.
@@ -4942,6 +4942,7 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
4942
4942
 
4943
4943
  if (IFrameSplitOperator.IsNumber(item.HPenType)) chart.ChartCorssCursor.HPenType=item.HPenType;
4944
4944
  if (IFrameSplitOperator.IsNumber(item.VPenType)) chart.ChartCorssCursor.VPenType=item.VPenType;
4945
+ if (IFrameSplitOperator.IsBool(item.EnableKeyboard)) chart.ChartCorssCursor.EnableKeyboard=item.EnableKeyboard;
4945
4946
  }
4946
4947
 
4947
4948
  if (option.MinuteInfo) chart.CreateMinuteInfo(option.MinuteInfo);
@@ -9424,6 +9425,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9424
9425
 
9425
9426
  this.DrawDrawPictureXYCoordinate(); //绘制画图工具 X,Y轴刻度信息
9426
9427
 
9428
+ var bDrawDialogTooltip=false;
9427
9429
  var ptPosition=null; //鼠标位置 null 无效 -1 在外面 >=0 对应的指标窗口中ID
9428
9430
  if (this.LastPoint.X!=null || this.LastPoint.Y!=null)
9429
9431
  {
@@ -9468,7 +9470,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9468
9470
  this.ChartCorssCursor.Canvas=this.Canvas;
9469
9471
  }
9470
9472
 
9471
- this.DrawTooltipDialog();
9473
+ bDrawDialogTooltip=true;
9472
9474
  }
9473
9475
 
9474
9476
  ptPosition=this.Frame.PtInFrame(this.LastPoint.X, this.LastPoint.Y);
@@ -9549,6 +9551,9 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9549
9551
  var frame=this.LastMouseStatus.MouseOnToolbar.Frame;
9550
9552
  if (frame && frame.DrawToolbarTooltip) frame.DrawToolbarTooltip(this.LastMouseStatus.MouseOnToolbar);
9551
9553
  }
9554
+
9555
+
9556
+ if (bDrawDialogTooltip) this.DrawTooltipDialog();
9552
9557
 
9553
9558
  //发送图形状态给外部
9554
9559
  if (this.mapEvent.has(JSCHART_EVENT_ID.CHART_STATUS))
@@ -9874,7 +9879,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9874
9879
  }
9875
9880
 
9876
9881
  this.DrawDrawPictureXYCoordinate();
9877
-
9882
+ var bDrawDialogTooltip=false;
9878
9883
  if (this.ChartCorssCursor)
9879
9884
  {
9880
9885
  this.ChartCorssCursor.LastPoint=this.LastPoint;
@@ -9919,7 +9924,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9919
9924
  this.ChartCorssCursor.Canvas=this.Canvas;
9920
9925
  }
9921
9926
 
9922
- this.DrawTooltipDialog();
9927
+ bDrawDialogTooltip=true;
9923
9928
  }
9924
9929
 
9925
9930
  var ptPosition=null; //鼠标位置 null 无效 -1 在外面 >=0 对应的指标窗口中ID
@@ -10014,6 +10019,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
10014
10019
 
10015
10020
  this.OffscreenToShowCanvas();
10016
10021
 
10022
+ if (bDrawDialogTooltip) this.DrawTooltipDialog();
10023
+
10017
10024
  ++this.TouchDrawCount;
10018
10025
  }
10019
10026
 
@@ -37000,7 +37007,8 @@ function ChartVolStick()
37000
37007
  this.ClassName='ChartVolStick';
37001
37008
 
37002
37009
  this.BarWidth; //固定宽度 目前只支持宽度为1
37003
- this.BarType; //柱子状态 1=实心 0=空心 2=涨实跌空 如果设置了这个属性, 属性KLineDrawType无效
37010
+ this.BarType; //柱子状态 1=实心 0=空心 2=涨实跌空 如果设置了这个属性, 属性KLineDrawType无效
37011
+ this.BarColorType=0; //0=柱子颜色跟K线走 1=正upcolor 负downcolor
37004
37012
  this.PtInChart=this.PtInBar;
37005
37013
  this.DrawSelectedStatus=this.DrawLinePoint;
37006
37014
 
@@ -37047,7 +37055,7 @@ function ChartVolStick()
37047
37055
  if (right>chartright) break;
37048
37056
 
37049
37057
  var y=this.ChartFrame.GetYFromData(value);
37050
- var barColor=this.GetBarColor(kItem);
37058
+ var barColor=this.GetBarColor(kItem,value);
37051
37059
  var bUp=barColor.IsUp;
37052
37060
 
37053
37061
 
@@ -37095,7 +37103,7 @@ function ChartVolStick()
37095
37103
  if (x>chartright) break;
37096
37104
 
37097
37105
  if (isMinute) barColor=this.GetMinuteBarColor(kItem,preKItem); //分时图颜色单独计算
37098
- else barColor=this.GetBarColor(kItem);
37106
+ else barColor=this.GetBarColor(kItem, value);
37099
37107
 
37100
37108
  this.Canvas.strokeStyle=barColor.Color;
37101
37109
 
@@ -37140,7 +37148,7 @@ function ChartVolStick()
37140
37148
  if (right>chartBottom) break;
37141
37149
 
37142
37150
  var y=this.ChartFrame.GetYFromData(value);
37143
- var barColor=this.GetBarColor(kItem);
37151
+ var barColor=this.GetBarColor(kItem, value);
37144
37152
  var bUp=barColor.IsUp;
37145
37153
 
37146
37154
  var height=ToFixedRect(y-yBottom); //高度调整为整数
@@ -37186,7 +37194,7 @@ function ChartVolStick()
37186
37194
  if (x>chartBottom) break;
37187
37195
 
37188
37196
  if (isMinute) barColor=this.GetMinuteBarColor(kItem,preKItem); //分时图颜色单独计算
37189
- else barColor=this.GetBarColor(kItem);
37197
+ else barColor=this.GetBarColor(kItem,value);
37190
37198
 
37191
37199
  var bUp=barColor.IsUp;
37192
37200
  this.Canvas.strokeStyle=barColor.Color;
@@ -37226,8 +37234,14 @@ function ChartVolStick()
37226
37234
  return range;
37227
37235
  }
37228
37236
 
37229
- this.GetBarColor=function(kItem)
37237
+ this.GetBarColor=function(kItem, value)
37230
37238
  {
37239
+ if (this.BarColorType===1) //更具正负决定柱子颜色
37240
+ {
37241
+ if (value>=0) return { Color:this.UpColor, IsUp:true }; //颜色, 是否是上涨
37242
+ else return { Color:this.DownColor, IsUp:false };
37243
+ }
37244
+
37231
37245
  if (kItem.Close>=kItem.Open) return { Color:this.UpColor, IsUp:true }; //颜色, 是否是上涨
37232
37246
  else return { Color:this.DownColor, IsUp:false };
37233
37247
  }
@@ -46221,7 +46235,7 @@ function KLineTooltipPaint()
46221
46235
  }
46222
46236
 
46223
46237
  if (this.HQChart.CurrentChartDrawPicture) return false; //画图工具操作的时候 不显示
46224
-
46238
+
46225
46239
  return true;
46226
46240
  }
46227
46241
 
@@ -47053,6 +47067,8 @@ function MinuteLeftTooltipPaint()
47053
47067
  var pt=this.HQChart.LastPoint;
47054
47068
  if (!pt) return false;
47055
47069
 
47070
+ if (this.HQChart.ChartCorssCursor && !this.HQChart.ChartCorssCursor.IsShowCorss) return false;
47071
+
47056
47072
  return this.HQChart.IsMouseOnClient(pt.X, pt.Y);
47057
47073
  }
47058
47074
 
@@ -74907,7 +74923,7 @@ function JSChartLocalization()
74907
74923
  ['DivTooltip-Amount', {CN:'金额:', EN:'Amount:', TC:'金額'}],
74908
74924
  ['DivTooltip-Exchange', {CN:'换手:', EN:'Exchange:', TC:'換手'}],
74909
74925
  ['DivTooltip-Position', {CN:'持仓:', EN:'Position:', TC:'持倉'}],
74910
- ['DivTooltip-Price', {CN:'价格:', EN:'Open:', TC:'價格'}],
74926
+ ['DivTooltip-Price', {CN:'价格:', EN:'Price:', TC:'價格'}],
74911
74927
 
74912
74928
  ['DialogTooltip-Date', {CN:'日期', EN:'Date', TC:'日期'}],
74913
74929
  ['DialogTooltip-Time', {CN:'时间', EN:'Time', TC:'時間'}],
@@ -74916,12 +74932,17 @@ function JSChartLocalization()
74916
74932
  ['DialogTooltip-Low', {CN:'最低价', EN:'Low', TC:'最低價'}],
74917
74933
  ['DialogTooltip-Close', {CN:'收盘价', EN:'Close', TC:'收盤價'}],
74918
74934
  ['DialogTooltip-Increase', {CN:'涨幅', EN:'Increase', TC:'漲幅'}],
74935
+ ['DialogTooltip-Risefall', {CN:'涨跌', EN:'Risefall', TC:'漲跌'}],
74919
74936
  ['DialogTooltip-Vol', {CN:'成交量', EN:'Volume', TC:'數量'}],
74920
74937
  ['DialogTooltip-Amount', {CN:'成交额', EN:'Amount', TC:'金額'}],
74921
74938
  ['DialogTooltip-Exchange', {CN:'换手率', EN:'Exchange', TC:'換手'}],
74922
74939
  ['DialogTooltip-Position', {CN:'持仓量', EN:'Position', TC:'持倉'}],
74923
- ['DialogTooltip-Price', {CN:'价格', EN:'Open', TC:'價格'}],
74940
+ ['DialogTooltip-Price', {CN:'价格', EN:'Price', TC:'價格'}],
74924
74941
  ['DialogTooltip-Amplitude', {CN:'振幅', EN:'amplitude', TC:'價格'}],
74942
+ ['DialogTooltip-AC-Price', {CN:'匹配价', EN:'Price', TC:'匹配價'}],
74943
+ ['DialogTooltip-AC-AvPrice', {CN:'匹配均价', EN:'AVPrice', TC:'匹配均價'}],
74944
+ ['DialogTooltip-AC-Increase', {CN:'竞价涨幅', EN:'Increase', TC:'競價漲幅'}],
74945
+ ['DialogTooltip-AC-Vol', {CN:'匹配量', EN:'Vol', TC:'匹配量'}],
74925
74946
 
74926
74947
  //走势图PC tooltip
74927
74948
  ['PCTooltip-Date', {CN:'日期', EN:'Date', TC:"日期"}],
@@ -84925,6 +84946,14 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
84925
84946
 
84926
84947
  var keyID = e.keyCode ? e.keyCode :e.which;
84927
84948
 
84949
+ var draw=false;
84950
+ if (this.ChartCorssCursor && this.ChartCorssCursor.OnKeyDown) //十字光标 隐藏显示
84951
+ {
84952
+ var sendData={ e:e, KeyID:keyID, Draw:false, PreventDefault:false };
84953
+ this.ChartCorssCursor.OnKeyDown(sendData);
84954
+ draw=sendData.Draw;
84955
+ }
84956
+
84928
84957
  switch(keyID)
84929
84958
  {
84930
84959
  case 37: //left
@@ -85030,10 +85059,20 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
85030
85059
  this.ChartOperator(option);
85031
85060
  }
85032
85061
  break;
85062
+ case 27:
85063
+ if (this.CurrentChartDrawPicture)
85064
+ {
85065
+ var drawPicture=this.CurrentChartDrawPicture;
85066
+ if (drawPicture.Status!=20) //画布移动的时候不能取消
85067
+ this.CurrentChartDrawPicture=null;
85068
+ }
85069
+ break;
85033
85070
  default:
85034
85071
  return;
85035
85072
  }
85036
85073
 
85074
+ if (draw) this.DrawDynamicInfo();
85075
+
85037
85076
  //不让滚动条滚动
85038
85077
  if(e.preventDefault) e.preventDefault();
85039
85078
  else e.returnValue = false;
@@ -88980,6 +89019,55 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
88980
89019
 
88981
89020
  return null;
88982
89021
  }
89022
+
89023
+ this.DrawTooltipDialog=function()
89024
+ {
89025
+ if (!this.DialogTooltip) return;
89026
+
89027
+ this.UpdateTooltipDialog();
89028
+ }
89029
+
89030
+ this.UpdateTooltipDialog=function()
89031
+ {
89032
+ if (!this.DialogTooltip) return false;
89033
+ if (!this.ChartCorssCursor) return false;
89034
+
89035
+ var minuteItem=null; //{ Type:0=连续交易 1=集合竞价, Data:数据 }
89036
+ if (this.ChartCorssCursor.ClientPos>=0)
89037
+ {
89038
+ var titlePaint=this.TitlePaint[0];
89039
+ if (titlePaint && titlePaint.PointInfo)
89040
+ {
89041
+ var pointInfo=titlePaint.PointInfo;
89042
+ if ((pointInfo.ClientPos==2 || pointInfo.ClientPos==3 || (pointInfo.ClientPos>=200&& pointInfo.ClientPos<=299) || (pointInfo.ClientPos>=300&& pointInfo.ClientPos<=399)))
89043
+ {
89044
+ var auctionData=titlePaint.GetCurrentAuctionData();
89045
+ if (!auctionData) return;
89046
+ minuteItem={ Type:1, Data:auctionData };
89047
+ }
89048
+ else
89049
+ {
89050
+ var minuteData=titlePaint.GetCurrentKLineData();
89051
+ if (!minuteData) return;
89052
+ minuteItem={ Type:0, Data:minuteData };
89053
+ }
89054
+ }
89055
+
89056
+ }
89057
+
89058
+ var sendData=
89059
+ {
89060
+ ClientPos:this.ChartCorssCursor.ClientPos, //位置
89061
+ IsShowCorss:this.ChartCorssCursor.IsShowCorss, //是否显示十字线
89062
+ MinItem:minuteItem,
89063
+ Symbol:this.Symbol, Name:this.Name,
89064
+ };
89065
+
89066
+
89067
+ this.DialogTooltip.Update(sendData);
89068
+
89069
+ return true;
89070
+ }
88983
89071
  }
88984
89072
 
88985
89073
  //盘前数据
@@ -120160,6 +120248,7 @@ function ScriptIndex(name,script,args,option)
120160
120248
  if (varItem.UpColor) chart.UpColor=varItem.UpColor;
120161
120249
  if (varItem.DownColor) chart.DownColor=varItem.DownColor;
120162
120250
  if (IFrameSplitOperator.IsNumber(varItem.StickType)) chart.BarType=varItem.StickType;
120251
+ if (IFrameSplitOperator.IsNumber(varItem.BarColorType)) chart.BarColorType=varItem.BarColorType;
120163
120252
  if (varItem.LineWidth)
120164
120253
  {
120165
120254
  let width=parseInt(varItem.LineWidth.replace("LINETHICK",""));
@@ -120171,9 +120260,21 @@ function ScriptIndex(name,script,args,option)
120171
120260
  chart.HistoryData=hisData;
120172
120261
  this.ReloadChartResource(hqChart,windowIndex,chart);
120173
120262
 
120174
- var titleData=new DynamicTitleData(chart.Data,varItem.Name,chart.Color);
120175
- hqChart.TitlePaint[titleIndex].Data[id]=titleData;
120176
- this.SetTitleData(titleData,chart);
120263
+ if (varItem.IsShowTitle===false) //NOTEXT 不绘制标题
120264
+ {
120265
+
120266
+ }
120267
+ else if (IFrameSplitOperator.IsString(varItem.Name) && varItem.Name.indexOf("NOTEXT")==0) //标题中包含NOTEXT不绘制标题
120268
+ {
120269
+
120270
+ }
120271
+ else
120272
+ {
120273
+ var titleData=new DynamicTitleData(chart.Data,varItem.Name,chart.Color);
120274
+ hqChart.TitlePaint[titleIndex].Data[id]=titleData;
120275
+ this.SetTitleData(titleData,chart);
120276
+ }
120277
+
120177
120278
  this.SetChartIndexName(chart);
120178
120279
  hqChart.ChartPaint.push(chart);
120179
120280
  }
@@ -122119,6 +122220,7 @@ function OverlayScriptIndex(name,script,args,option)
122119
122220
  if (varItem.UpColor) chart.UpColor=varItem.UpColor;
122120
122221
  if (varItem.DownColor) chart.DownColor=varItem.DownColor;
122121
122222
  if (IFrameSplitOperator.IsNumber(varItem.StickType)) chart.BarType=varItem.StickType;
122223
+ if (IFrameSplitOperator.IsNumber(varItem.BarColorType)) chart.BarColorType=varItem.BarColorType;
122122
122224
  if (varItem.LineWidth)
122123
122225
  {
122124
122226
  let width=parseInt(varItem.LineWidth.replace("LINETHICK",""));
@@ -123547,6 +123649,8 @@ function APIScriptIndex(name,script,args,option, isOverlay)
123547
123649
  if (IFrameSplitOperator.IsBool(item.isDotLine)) outVarItem.IsDotLine = item.isDotLine;
123548
123650
  if (IFrameSplitOperator.IsNonEmptyArray(item.lineDash)) outVarItem.LineDash=item.lineDash;
123549
123651
  if (IFrameSplitOperator.IsBool(item.isSingleLine)) outVarItem.IsSingleLine=item.isSingleLine;
123652
+ if (IFrameSplitOperator.IsNumber(item.StickType)) outVarItem.StickType=item.StickType;
123653
+ if (IFrameSplitOperator.IsNumber(item.BarColorType)) outVarItem.BarColorType=item.BarColorType;
123550
123654
 
123551
123655
  result.push(outVarItem);
123552
123656
  }
@@ -143278,22 +143382,41 @@ function JSDialogTooltip()
143278
143382
  this.Update=function(data)
143279
143383
  {
143280
143384
  if (!this.DivDialog || !this.TitleBox) return;
143281
- if (!data.KItem || !data.IsShowCorss || data.ClientPos<0) return;
143385
+ if ((!data.KItem && !data.MinItem) || !data.IsShowCorss || data.ClientPos<0) return;
143282
143386
 
143283
143387
  this.LanguageID=this.HQChart.LanguageID;
143284
- this.TitleBox.DivName.innerText=data.Name;
143285
-
143286
- var strKItem=JSON.stringify(data.KItem);
143287
- if (this.KItemCacheID!=strKItem) //数据变动的才更新
143388
+
143389
+ if (this.HQChart.ClassName=='KLineChartContainer')
143390
+ {
143391
+ var strKItem=JSON.stringify(data.KItem);
143392
+ if (this.KItemCacheID!=strKItem) //数据变动的才更新
143393
+ {
143394
+ this.KItemCache= JSON.parse(strKItem);
143395
+ this.KItemCacheID=strKItem;
143396
+ this.UpdateTableDOM();
143397
+ }
143398
+ else
143399
+ {
143400
+ //JSConsole.Chart.Log(`[JSDialogTooltip::Update] save as KItemCache and KItem`);
143401
+ }
143402
+ }
143403
+ else if (this.HQChart.ClassName=='MinuteChartContainer')
143288
143404
  {
143289
- this.KItemCache= JSON.parse(strKItem);
143290
- this.KItemCacheID=strKItem;
143291
- this.UpdateTableDOM();
143405
+ var strKItem=JSON.stringify(data.MinItem);
143406
+ if (this.KItemCacheID!=strKItem) //数据变动的才更新
143407
+ {
143408
+ this.KItemCache= JSON.parse(strKItem);
143409
+ this.KItemCacheID=strKItem;
143410
+ this.UpdateTableDOM();
143411
+ }
143292
143412
  }
143293
143413
  else
143294
143414
  {
143295
- //JSConsole.Chart.Log(`[JSDialogTooltip::Update] save as KItemCache and KItem`);
143415
+ return;
143296
143416
  }
143417
+
143418
+ this.TitleBox.DivName.innerText=data.Name;
143419
+
143297
143420
 
143298
143421
  if (!this.IsShow()) this.Show();
143299
143422
  }
@@ -143302,7 +143425,12 @@ function JSDialogTooltip()
143302
143425
  {
143303
143426
  if (!this.KItemCache) return;
143304
143427
 
143305
- this.AryText=this.GetFormatKlineTooltipText(this.KItemCache);
143428
+ if (this.HQChart.ClassName=='KLineChartContainer')
143429
+ this.AryText=this.GetFormatKlineTooltipText(this.KItemCache);
143430
+ else if (this.HQChart.ClassName=='MinuteChartContainer')
143431
+ this.AryText=this.GetFormatMinuteTooltipText(this.KItemCache);
143432
+ else
143433
+ return;
143306
143434
 
143307
143435
  var index=0;
143308
143436
  for(index=0;index<this.AryText.length && index<this.MaxRowCount;++index)
@@ -143403,92 +143531,22 @@ function JSDialogTooltip()
143403
143531
  var defaultfloatPrecision=GetfloatPrecision(this.HQChart.Symbol);//价格小数位数
143404
143532
 
143405
143533
  //日期
143406
- var dateItem=
143407
- {
143408
- Title:g_JSChartLocalization.GetText('DialogTooltip-Date',this.LanguageID),
143409
- Text:IFrameSplitOperator.FormatDateString(data.Date,"YYYY/MM/DD/W"),
143410
- Color:this.DateTimeColor
143411
- }
143534
+ var dateItem=this.ForamtDate(data.Date,"YYYY/MM/DD/W",'DialogTooltip-Date' );
143412
143535
 
143413
143536
  //时间
143414
143537
  var timeItem=null;
143415
- var timeFormat=null;
143416
- if (ChartData.IsMinutePeriod(this.HQChart.Period,true)) timeFormat='HH:MM'; // 分钟周期
143417
- else if (ChartData.IsSecondPeriod(this.HQChart.Period)) timeFormat='HH:MM:SS';
143418
- else if (ChartData.IsMilliSecondPeriod(this.HQChart.Period)) timeFormat='HH:MM:SS.fff';
143419
-
143420
- if (timeFormat)
143421
- {
143422
- timeItem=
143423
- {
143424
- Title:g_JSChartLocalization.GetText('DialogTooltip-Time',this.LanguageID),
143425
- Text:IFrameSplitOperator.FormatTimeString(data.Time,timeFormat),
143426
- Color:this.DateTimeColor
143427
- }
143428
- }
143429
-
143430
- //涨幅
143431
- var increaseItem=
143432
- {
143433
- Title:g_JSChartLocalization.GetText('DialogTooltip-Increase',this.LanguageID),
143434
- Text:"--.--",
143435
- Color:this.TitleColor
143436
- };
143437
- if (IFrameSplitOperator.IsNumber(data.YClose) && IFrameSplitOperator.IsNumber(data.Close))
143438
- {
143439
- var value=(data.Close-data.YClose)/data.YClose;
143440
- increaseItem.Text=`${(value*100).toFixed(2)}%`;
143441
- increaseItem.Color=this.GetColor(value,0);
143442
- }
143443
-
143444
- //涨幅
143445
- var amplitudeItem=
143446
- {
143447
- Title:g_JSChartLocalization.GetText('DialogTooltip-Amplitude',this.LanguageID),
143448
- Text:"--.--",
143449
- Color:this.TitleColor
143450
- }
143451
- if (IFrameSplitOperator.IsNumber(data.YClose) && IFrameSplitOperator.IsNumber(data.High) && IFrameSplitOperator.IsNumber(data.Low))
143452
- {
143453
- var value=(data.High-data.Low)/data.YClose;
143454
- amplitudeItem.Text=`${(value*100).toFixed(2)}%`;
143455
- amplitudeItem.Color=this.GetColor(value,0);
143456
- }
143457
-
143538
+ if (IFrameSplitOperator.IsNumber(data.Time)) timeItem=this.FormatTime(data.Time, this.HQChart.Period, null, 'DialogTooltip-Time');
143539
+
143458
143540
  var aryText=
143459
143541
  [
143460
- {
143461
- Title:g_JSChartLocalization.GetText('DialogTooltip-Open',this.LanguageID),
143462
- Text:IFrameSplitOperator.IsNumber(data.Open)? data.Open.toFixed(defaultfloatPrecision):'--',
143463
- Color:this.GetPriceColor(data.Open,data.YClose),
143464
- },
143465
- {
143466
- Title:g_JSChartLocalization.GetText('DialogTooltip-High',this.LanguageID),
143467
- Text:IFrameSplitOperator.IsNumber(data.High)? data.High.toFixed(defaultfloatPrecision):'--',
143468
- Color:this.GetPriceColor(data.High,data.YClose)
143469
- },
143470
- {
143471
- Title:g_JSChartLocalization.GetText('DialogTooltip-Low',this.LanguageID),
143472
- Text:IFrameSplitOperator.IsNumber(data.Low)? data.Low.toFixed(defaultfloatPrecision):'--',
143473
- Color:this.GetPriceColor(data.Low,data.YClose)
143474
- },
143475
- {
143476
- Title:g_JSChartLocalization.GetText('DialogTooltip-Close',this.LanguageID),
143477
- Text:IFrameSplitOperator.IsNumber(data.Close)? data.Close.toFixed(defaultfloatPrecision):'--',
143478
- Color:this.GetPriceColor(data.Close,data.YClose)
143479
- },
143480
- {
143481
- Title:g_JSChartLocalization.GetText('DialogTooltip-Vol',this.LanguageID),
143482
- Text:IFrameSplitOperator.IsNumber(data.Vol)? IFrameSplitOperator.FormatValueString(data.Vol,2,this.LanguageID):'--',
143483
- Color:this.VolColor
143484
- },
143485
- {
143486
- Title:g_JSChartLocalization.GetText('DialogTooltip-Amount',this.LanguageID),
143487
- Text:IFrameSplitOperator.IsNumber(data.Amount)? IFrameSplitOperator.FormatValueString(data.Amount,2,this.LanguageID):'--',
143488
- Color:this.AmountColor
143489
- },
143490
- increaseItem,
143491
- amplitudeItem
143542
+ this.ForamtPrice(data.Open,data.YClose, defaultfloatPrecision,'DialogTooltip-Open'),
143543
+ this.ForamtPrice(data.High,data.YClose, defaultfloatPrecision,'DialogTooltip-High'),
143544
+ this.ForamtPrice(data.Low,data.YClose, defaultfloatPrecision,'DialogTooltip-Low'),
143545
+ this.ForamtPrice(data.Close,data.YClose, defaultfloatPrecision,'DialogTooltip-Close'),
143546
+ this.FormatVol(data.Vol,'DialogTooltip-Vol' ),
143547
+ this.FormatAmount(data.Amount,'DialogTooltip-Amount' ),
143548
+ this.FormatIncrease(data.Close,data.YClose,'DialogTooltip-Increase'),
143549
+ this.FormatAmplitude(data.High,data.Low,data.YClose,'DialogTooltip-Amplitude'),
143492
143550
  ];
143493
143551
 
143494
143552
  if (timeItem) aryText.unshift(timeItem);
@@ -143497,6 +143555,50 @@ function JSDialogTooltip()
143497
143555
  return aryText;
143498
143556
  },
143499
143557
 
143558
+ this.GetFormatMinuteTooltipText=function(data)
143559
+ {
143560
+ var defaultfloatPrecision=GetfloatPrecision(this.HQChart.Symbol);//价格小数位数
143561
+
143562
+ if (data.Type==0) //连续交易
143563
+ {
143564
+ var item=data.Data;
143565
+ if (!item) item={ };
143566
+
143567
+ var aryText=
143568
+ [
143569
+ this.ForamtDate(item.Date,"YYYY/MM/DD/W",'DialogTooltip-Date' ),
143570
+ this.FormatTime(item.Time, null, "HH:MM", 'DialogTooltip-Time'),
143571
+ this.ForamtPrice(item.Close,item.YClose, defaultfloatPrecision,'DialogTooltip-Price'),
143572
+ this.FormatRisefall(item.Close,item.YClose, defaultfloatPrecision,'DialogTooltip-Risefall'),
143573
+ this.FormatIncrease(item.Close,item.YClose,'DialogTooltip-Increase'),
143574
+ this.FormatVol(item.Vol,'DialogTooltip-Vol' ),
143575
+ this.FormatAmount(item.Amount,'DialogTooltip-Amount' ),
143576
+ ];
143577
+
143578
+ return aryText;
143579
+ }
143580
+ else if (data.Type==1) //集合竞价
143581
+ {
143582
+ var item=data.Data.Data;
143583
+ if (!item) item={ Vol:[] };
143584
+
143585
+ var timeForamt="HH:MM:SS";
143586
+ if (item.Ver===1) timeForamt="HH:MM"
143587
+ var aryText=
143588
+ [
143589
+ this.ForamtDate(item.Date,"YYYY/MM/DD/W",'DialogTooltip-Date' ),
143590
+ this.FormatTime(item.Time, null, timeForamt, 'DialogTooltip-Time'),
143591
+ this.ForamtPrice(item.Price,item.YClose, defaultfloatPrecision,'DialogTooltip-AC-Price'),
143592
+ this.FormatIncrease(item.Price,item.YClose,'DialogTooltip-AC-Increase'),
143593
+ this.FormatVol(item.Vol[0],'DialogTooltip-AC-Vol' ),
143594
+ ];
143595
+
143596
+ return aryText;
143597
+ }
143598
+
143599
+ return [];
143600
+ }
143601
+
143500
143602
  this.GetColor=function(price,yClose)
143501
143603
  {
143502
143604
  if(price>yClose) return this.UpColor;
@@ -143543,6 +143645,157 @@ function JSDialogTooltip()
143543
143645
  if (this.TitleBGColor) this.TitleBox.DivTitle.style['background-color']=this.TitleBGColor;
143544
143646
 
143545
143647
  this.UpdateTableDOM();
143648
+ },
143649
+
143650
+
143651
+ /////////////////////////////////////////////////////////////////////////////////////////////
143652
+ //数据格式化
143653
+ this.ForamtPrice=function(price, yClose, defaultfloatPrecision, TitleID)
143654
+ {
143655
+ var item=
143656
+ {
143657
+ Title:g_JSChartLocalization.GetText(TitleID, this.LanguageID),
143658
+ Text:"--.--",
143659
+ Color:this.TitleColor
143660
+ };
143661
+
143662
+ if (!IFrameSplitOperator.IsNumber(price)) return item;
143663
+
143664
+ item.Text=price.toFixed(defaultfloatPrecision);
143665
+ item.Color=this.GetColor(price, yClose);
143666
+
143667
+ return item;
143668
+ }
143669
+
143670
+ this.FormatVol=function(vol, TitleID)
143671
+ {
143672
+ var item=
143673
+ {
143674
+ Title:g_JSChartLocalization.GetText(TitleID,this.LanguageID),
143675
+ Text:'--',
143676
+ Color:this.VolColor
143677
+ };
143678
+
143679
+ if (!IFrameSplitOperator.IsNumber(vol)) return item;
143680
+
143681
+ item.Text=IFrameSplitOperator.FormatValueString(vol,2,this.LanguageID);
143682
+
143683
+ return item;
143684
+ }
143685
+
143686
+ this.FormatAmount=function(amount, TitleID)
143687
+ {
143688
+ var item=
143689
+ {
143690
+ Title:g_JSChartLocalization.GetText(TitleID,this.LanguageID),
143691
+ Text:'--',
143692
+ Color:this.AmountColor
143693
+ };
143694
+
143695
+ if (!IFrameSplitOperator.IsNumber(amount)) return item;
143696
+
143697
+ item.Text=IFrameSplitOperator.FormatValueString(amount,2,this.LanguageID);
143698
+
143699
+ return item;
143700
+ }
143701
+
143702
+ this.FormatIncrease=function(price, yClose, TitleID)
143703
+ {
143704
+ //涨幅
143705
+ var item=
143706
+ {
143707
+ Title:g_JSChartLocalization.GetText(TitleID,this.LanguageID),
143708
+ Text:"--.--",
143709
+ Color:this.TitleColor
143710
+ };
143711
+
143712
+ if (!IFrameSplitOperator.IsNumber(price) || !IFrameSplitOperator.IsNumber(yClose)) return item;
143713
+
143714
+ var value=(price-yClose)/yClose;
143715
+ item.Text=`${(value*100).toFixed(2)}%`;
143716
+ item.Color=this.GetColor(value,0);
143717
+
143718
+ return item;
143719
+ }
143720
+
143721
+ this.FormatRisefall=function(price, yClose, defaultfloatPrecision, TitleID)
143722
+ {
143723
+ //涨跌
143724
+ var item=
143725
+ {
143726
+ Title:g_JSChartLocalization.GetText(TitleID,this.LanguageID),
143727
+ Text:"--.--",
143728
+ Color:this.TitleColor
143729
+ };
143730
+
143731
+ if (!IFrameSplitOperator.IsNumber(price) || !IFrameSplitOperator.IsNumber(yClose)) return item;
143732
+
143733
+ var value=price-yClose;
143734
+ item.Text=`${value.toFixed(defaultfloatPrecision)}`;
143735
+ item.Color=this.GetColor(value,0);
143736
+
143737
+ return item;
143738
+ }
143739
+
143740
+ this.FormatAmplitude=function(high, low, yClose, TitleID)
143741
+ {
143742
+ //涨幅
143743
+ var item=
143744
+ {
143745
+ Title:g_JSChartLocalization.GetText(TitleID,this.LanguageID),
143746
+ Text:"--.--",
143747
+ Color:this.TitleColor
143748
+ };
143749
+
143750
+
143751
+ if (!IFrameSplitOperator.IsNumber(high) || !IFrameSplitOperator.IsNumber(low) || !IFrameSplitOperator.IsNumber(yClose)) return item;
143752
+
143753
+ var value=(high-low)/yClose;
143754
+ item.Text=`${(value*100).toFixed(2)}%`;
143755
+ item.Color=this.GetColor(value,0);
143756
+
143757
+ return item;
143758
+ }
143759
+
143760
+ this.ForamtDate=function(date, format, TitleID)
143761
+ {
143762
+ //日期
143763
+ var item=
143764
+ {
143765
+ Title:g_JSChartLocalization.GetText('DialogTooltip-Date',this.LanguageID),
143766
+ Text:"----/--/--",
143767
+ Color:this.DateTimeColor
143768
+ }
143769
+
143770
+ if (!IFrameSplitOperator.IsNumber(date)) return item;
143771
+
143772
+ item.Text=IFrameSplitOperator.FormatDateString(date,format);
143773
+
143774
+ return item;
143775
+ }
143776
+
143777
+ this.FormatTime=function(time, period, format, TitleID)
143778
+ {
143779
+ //时间
143780
+ var item=
143781
+ {
143782
+ Title:g_JSChartLocalization.GetText(TitleID,this.LanguageID),
143783
+ Text:'--:--',
143784
+ Color:this.DateTimeColor
143785
+ };
143786
+
143787
+ if (!IFrameSplitOperator.IsNumber(time)) return item;
143788
+ if (!format)
143789
+ {
143790
+ format="HH:MM";
143791
+ if (ChartData.IsMinutePeriod(period,true)) timeFormat='HH:MM'; // 分钟周期
143792
+ else if (ChartData.IsSecondPeriod(period)) timeFormat='HH:MM:SS';
143793
+ else if (ChartData.IsMilliSecondPeriod(period)) timeFormat='HH:MM:SS.fff';
143794
+ }
143795
+
143796
+ item.Text=IFrameSplitOperator.FormatTimeString(time,format);
143797
+
143798
+ return item;
143546
143799
  }
143547
143800
 
143548
143801
  }///////////////////////////////////////////////////////////////////////////////////
@@ -143666,7 +143919,7 @@ function HQChartScriptWorker()
143666
143919
 
143667
143920
 
143668
143921
 
143669
- var HQCHART_VERSION="1.1.13910";
143922
+ var HQCHART_VERSION="1.1.13914";
143670
143923
 
143671
143924
  function PrintHQChartVersion()
143672
143925
  {