hqchart 1.1.13911 → 1.1.13921

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
 
@@ -72966,7 +72982,7 @@ function JSChartResource()
72966
72982
  AmountColor:"rgb(79, 79, 79)", //成交金额
72967
72983
  DateTimeColor:'rgb(60,60,60)',
72968
72984
  TurnoverRateColor:'rgb(43,54,69)', //换手率
72969
- PositionColor:"rgb(43,54,69)" //持仓
72985
+ PositionColor:"rgb(255,0,255)" //持仓
72970
72986
  }
72971
72987
 
72972
72988
  //弹幕
@@ -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,18 @@ 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:'價格'}],
74941
+ ['DialogTooltip-YClose', {CN:"结算价", EN:'Settlement', TC:'結算價'}],
74924
74942
  ['DialogTooltip-Amplitude', {CN:'振幅', EN:'amplitude', TC:'價格'}],
74943
+ ['DialogTooltip-AC-Price', {CN:'匹配价', EN:'Price', TC:'匹配價'}],
74944
+ ['DialogTooltip-AC-AvPrice', {CN:'匹配均价', EN:'AVPrice', TC:'匹配均價'}],
74945
+ ['DialogTooltip-AC-Increase', {CN:'竞价涨幅', EN:'Increase', TC:'競價漲幅'}],
74946
+ ['DialogTooltip-AC-Vol', {CN:'匹配量', EN:'Vol', TC:'匹配量'}],
74925
74947
 
74926
74948
  //走势图PC tooltip
74927
74949
  ['PCTooltip-Date', {CN:'日期', EN:'Date', TC:"日期"}],
@@ -84925,6 +84947,14 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
84925
84947
 
84926
84948
  var keyID = e.keyCode ? e.keyCode :e.which;
84927
84949
 
84950
+ var draw=false;
84951
+ if (this.ChartCorssCursor && this.ChartCorssCursor.OnKeyDown) //十字光标 隐藏显示
84952
+ {
84953
+ var sendData={ e:e, KeyID:keyID, Draw:false, PreventDefault:false };
84954
+ this.ChartCorssCursor.OnKeyDown(sendData);
84955
+ draw=sendData.Draw;
84956
+ }
84957
+
84928
84958
  switch(keyID)
84929
84959
  {
84930
84960
  case 37: //left
@@ -85030,10 +85060,20 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
85030
85060
  this.ChartOperator(option);
85031
85061
  }
85032
85062
  break;
85063
+ case 27:
85064
+ if (this.CurrentChartDrawPicture)
85065
+ {
85066
+ var drawPicture=this.CurrentChartDrawPicture;
85067
+ if (drawPicture.Status!=20) //画布移动的时候不能取消
85068
+ this.CurrentChartDrawPicture=null;
85069
+ }
85070
+ break;
85033
85071
  default:
85034
85072
  return;
85035
85073
  }
85036
85074
 
85075
+ if (draw) this.DrawDynamicInfo();
85076
+
85037
85077
  //不让滚动条滚动
85038
85078
  if(e.preventDefault) e.preventDefault();
85039
85079
  else e.returnValue = false;
@@ -88980,6 +89020,55 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
88980
89020
 
88981
89021
  return null;
88982
89022
  }
89023
+
89024
+ this.DrawTooltipDialog=function()
89025
+ {
89026
+ if (!this.DialogTooltip) return;
89027
+
89028
+ this.UpdateTooltipDialog();
89029
+ }
89030
+
89031
+ this.UpdateTooltipDialog=function()
89032
+ {
89033
+ if (!this.DialogTooltip) return false;
89034
+ if (!this.ChartCorssCursor) return false;
89035
+
89036
+ var minuteItem=null; //{ Type:0=连续交易 1=集合竞价, Data:数据 }
89037
+ if (this.ChartCorssCursor.ClientPos>=0)
89038
+ {
89039
+ var titlePaint=this.TitlePaint[0];
89040
+ if (titlePaint && titlePaint.PointInfo)
89041
+ {
89042
+ var pointInfo=titlePaint.PointInfo;
89043
+ if ((pointInfo.ClientPos==2 || pointInfo.ClientPos==3 || (pointInfo.ClientPos>=200&& pointInfo.ClientPos<=299) || (pointInfo.ClientPos>=300&& pointInfo.ClientPos<=399)))
89044
+ {
89045
+ var auctionData=titlePaint.GetCurrentAuctionData();
89046
+ if (!auctionData) return;
89047
+ minuteItem={ Type:1, Data:auctionData };
89048
+ }
89049
+ else
89050
+ {
89051
+ var minuteData=titlePaint.GetCurrentKLineData();
89052
+ if (!minuteData) return;
89053
+ minuteItem={ Type:0, Data:minuteData };
89054
+ }
89055
+ }
89056
+
89057
+ }
89058
+
89059
+ var sendData=
89060
+ {
89061
+ ClientPos:this.ChartCorssCursor.ClientPos, //位置
89062
+ IsShowCorss:this.ChartCorssCursor.IsShowCorss, //是否显示十字线
89063
+ MinItem:minuteItem,
89064
+ Symbol:this.Symbol, Name:this.Name,
89065
+ };
89066
+
89067
+
89068
+ this.DialogTooltip.Update(sendData);
89069
+
89070
+ return true;
89071
+ }
88983
89072
  }
88984
89073
 
88985
89074
  //盘前数据
@@ -120160,6 +120249,7 @@ function ScriptIndex(name,script,args,option)
120160
120249
  if (varItem.UpColor) chart.UpColor=varItem.UpColor;
120161
120250
  if (varItem.DownColor) chart.DownColor=varItem.DownColor;
120162
120251
  if (IFrameSplitOperator.IsNumber(varItem.StickType)) chart.BarType=varItem.StickType;
120252
+ if (IFrameSplitOperator.IsNumber(varItem.BarColorType)) chart.BarColorType=varItem.BarColorType;
120163
120253
  if (varItem.LineWidth)
120164
120254
  {
120165
120255
  let width=parseInt(varItem.LineWidth.replace("LINETHICK",""));
@@ -120171,9 +120261,21 @@ function ScriptIndex(name,script,args,option)
120171
120261
  chart.HistoryData=hisData;
120172
120262
  this.ReloadChartResource(hqChart,windowIndex,chart);
120173
120263
 
120174
- var titleData=new DynamicTitleData(chart.Data,varItem.Name,chart.Color);
120175
- hqChart.TitlePaint[titleIndex].Data[id]=titleData;
120176
- this.SetTitleData(titleData,chart);
120264
+ if (varItem.IsShowTitle===false) //NOTEXT 不绘制标题
120265
+ {
120266
+
120267
+ }
120268
+ else if (IFrameSplitOperator.IsString(varItem.Name) && varItem.Name.indexOf("NOTEXT")==0) //标题中包含NOTEXT不绘制标题
120269
+ {
120270
+
120271
+ }
120272
+ else
120273
+ {
120274
+ var titleData=new DynamicTitleData(chart.Data,varItem.Name,chart.Color);
120275
+ hqChart.TitlePaint[titleIndex].Data[id]=titleData;
120276
+ this.SetTitleData(titleData,chart);
120277
+ }
120278
+
120177
120279
  this.SetChartIndexName(chart);
120178
120280
  hqChart.ChartPaint.push(chart);
120179
120281
  }
@@ -122119,6 +122221,7 @@ function OverlayScriptIndex(name,script,args,option)
122119
122221
  if (varItem.UpColor) chart.UpColor=varItem.UpColor;
122120
122222
  if (varItem.DownColor) chart.DownColor=varItem.DownColor;
122121
122223
  if (IFrameSplitOperator.IsNumber(varItem.StickType)) chart.BarType=varItem.StickType;
122224
+ if (IFrameSplitOperator.IsNumber(varItem.BarColorType)) chart.BarColorType=varItem.BarColorType;
122122
122225
  if (varItem.LineWidth)
122123
122226
  {
122124
122227
  let width=parseInt(varItem.LineWidth.replace("LINETHICK",""));
@@ -123547,6 +123650,8 @@ function APIScriptIndex(name,script,args,option, isOverlay)
123547
123650
  if (IFrameSplitOperator.IsBool(item.isDotLine)) outVarItem.IsDotLine = item.isDotLine;
123548
123651
  if (IFrameSplitOperator.IsNonEmptyArray(item.lineDash)) outVarItem.LineDash=item.lineDash;
123549
123652
  if (IFrameSplitOperator.IsBool(item.isSingleLine)) outVarItem.IsSingleLine=item.isSingleLine;
123653
+ if (IFrameSplitOperator.IsNumber(item.StickType)) outVarItem.StickType=item.StickType;
123654
+ if (IFrameSplitOperator.IsNumber(item.BarColorType)) outVarItem.BarColorType=item.BarColorType;
123550
123655
 
123551
123656
  result.push(outVarItem);
123552
123657
  }
@@ -125289,7 +125394,7 @@ function GetBlackStyle()
125289
125394
  AmountColor:"rgb(210,210,210)", //成交金额
125290
125395
  DateTimeColor:'rgb(210,210,210)',
125291
125396
  TurnoverRateColor:'rgb(43,54,69)', //换手率
125292
- PositionColor:"rgb(43,54,69)" //持仓
125397
+ PositionColor:"rgb(255,0,255)" //持仓
125293
125398
  },
125294
125399
 
125295
125400
  //走势图 信息地雷
@@ -143160,7 +143265,7 @@ function JSDialogTooltip()
143160
143265
  this.PositionColor=g_JSChartResource.DialogTooltip.PositionColor;
143161
143266
  this.DateTimeColor=g_JSChartResource.DialogTooltip.DateTimeColor;
143162
143267
  this.LanguageID=JSCHART_LANGUAGE_ID.LANGUAGE_CHINESE_ID;
143163
- this.MaxRowCount=10;
143268
+ this.MaxRowCount=18;
143164
143269
 
143165
143270
  this.AryData=[];
143166
143271
  this.AryText=[];
@@ -143278,22 +143383,41 @@ function JSDialogTooltip()
143278
143383
  this.Update=function(data)
143279
143384
  {
143280
143385
  if (!this.DivDialog || !this.TitleBox) return;
143281
- if (!data.KItem || !data.IsShowCorss || data.ClientPos<0) return;
143386
+ if ((!data.KItem && !data.MinItem) || !data.IsShowCorss || data.ClientPos<0) return;
143282
143387
 
143283
143388
  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) //数据变动的才更新
143389
+
143390
+ if (this.HQChart.ClassName=='KLineChartContainer')
143288
143391
  {
143289
- this.KItemCache= JSON.parse(strKItem);
143290
- this.KItemCacheID=strKItem;
143291
- this.UpdateTableDOM();
143392
+ var strKItem=JSON.stringify(data.KItem);
143393
+ if (this.KItemCacheID!=strKItem) //数据变动的才更新
143394
+ {
143395
+ this.KItemCache= JSON.parse(strKItem);
143396
+ this.KItemCacheID=strKItem;
143397
+ this.UpdateTableDOM();
143398
+ }
143399
+ else
143400
+ {
143401
+ //JSConsole.Chart.Log(`[JSDialogTooltip::Update] save as KItemCache and KItem`);
143402
+ }
143403
+ }
143404
+ else if (this.HQChart.ClassName=='MinuteChartContainer')
143405
+ {
143406
+ var strKItem=JSON.stringify(data.MinItem);
143407
+ if (this.KItemCacheID!=strKItem) //数据变动的才更新
143408
+ {
143409
+ this.KItemCache= JSON.parse(strKItem);
143410
+ this.KItemCacheID=strKItem;
143411
+ this.UpdateTableDOM();
143412
+ }
143292
143413
  }
143293
143414
  else
143294
143415
  {
143295
- //JSConsole.Chart.Log(`[JSDialogTooltip::Update] save as KItemCache and KItem`);
143416
+ return;
143296
143417
  }
143418
+
143419
+ this.TitleBox.DivName.innerText=data.Name;
143420
+
143297
143421
 
143298
143422
  if (!this.IsShow()) this.Show();
143299
143423
  }
@@ -143302,7 +143426,12 @@ function JSDialogTooltip()
143302
143426
  {
143303
143427
  if (!this.KItemCache) return;
143304
143428
 
143305
- this.AryText=this.GetFormatKlineTooltipText(this.KItemCache);
143429
+ if (this.HQChart.ClassName=='KLineChartContainer')
143430
+ this.AryText=this.GetFormatKlineTooltipText(this.KItemCache);
143431
+ else if (this.HQChart.ClassName=='MinuteChartContainer')
143432
+ this.AryText=this.GetFormatMinuteTooltipText(this.KItemCache);
143433
+ else
143434
+ return;
143306
143435
 
143307
143436
  var index=0;
143308
143437
  for(index=0;index<this.AryText.length && index<this.MaxRowCount;++index)
@@ -143401,101 +143530,89 @@ function JSDialogTooltip()
143401
143530
  this.GetFormatKlineTooltipText=function(data)
143402
143531
  {
143403
143532
  var defaultfloatPrecision=GetfloatPrecision(this.HQChart.Symbol);//价格小数位数
143404
-
143533
+ var upperSymbol=this.HQChart.Symbol.toUpperCase();
143405
143534
  //日期
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
- }
143535
+ var dateItem=this.ForamtDate(data.Date,"YYYY/MM/DD/W",'DialogTooltip-Date' );
143412
143536
 
143413
143537
  //时间
143414
143538
  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';
143539
+ if (IFrameSplitOperator.IsNumber(data.Time)) timeItem=this.FormatTime(data.Time, this.HQChart.Period, null, 'DialogTooltip-Time');
143540
+
143541
+ var yClose=data.YClose; //昨收价|昨结算价
143542
+ var aryText=
143543
+ [
143544
+ this.ForamtPrice(data.Open,yClose, defaultfloatPrecision,'DialogTooltip-Open'),
143545
+ this.ForamtPrice(data.High,yClose, defaultfloatPrecision,'DialogTooltip-High'),
143546
+ this.ForamtPrice(data.Low,yClose, defaultfloatPrecision,'DialogTooltip-Low'),
143547
+ this.ForamtPrice(data.Close,yClose, defaultfloatPrecision,'DialogTooltip-Close'),
143548
+ this.FormatVol(data.Vol,'DialogTooltip-Vol' ),
143549
+ this.FormatAmount(data.Amount,'DialogTooltip-Amount' ),
143550
+ this.FormatIncrease(data.Close,yClose,'DialogTooltip-Increase'),
143551
+ this.FormatAmplitude(data.High,data.Low,yClose,'DialogTooltip-Amplitude'),
143552
+ ];
143419
143553
 
143420
- if (timeFormat)
143554
+ if (timeItem) aryText.unshift(timeItem);
143555
+ aryText.unshift(dateItem);
143556
+
143557
+ //换手率
143558
+ if (MARKET_SUFFIX_NAME.IsSHSZStockA(upperSymbol) && data.FlowCapital>0)
143421
143559
  {
143422
- timeItem=
143423
- {
143424
- Title:g_JSChartLocalization.GetText('DialogTooltip-Time',this.LanguageID),
143425
- Text:IFrameSplitOperator.FormatTimeString(data.Time,timeFormat),
143426
- Color:this.DateTimeColor
143427
- }
143560
+ aryText.push(this.FormatExchange(data.Vol,data.FlowCapital,'DialogTooltip-Exchange' ));
143428
143561
  }
143429
143562
 
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))
143563
+ //持仓量
143564
+ if (MARKET_SUFFIX_NAME.IsFutures(upperSymbol))
143438
143565
  {
143439
- var value=(data.Close-data.YClose)/data.YClose;
143440
- increaseItem.Text=`${(value*100).toFixed(2)}%`;
143441
- increaseItem.Color=this.GetColor(value,0);
143566
+ aryText.push(this.FormatPosition(data.Position,'DialogTooltip-Position'));
143567
+ aryText.push(this.ForamtYClose(data.YClose, defaultfloatPrecision, 'DialogTooltip-YClose'));
143442
143568
  }
143443
143569
 
143444
- //涨幅
143445
- var amplitudeItem=
143570
+ return aryText;
143571
+ },
143572
+
143573
+ this.GetFormatMinuteTooltipText=function(data)
143574
+ {
143575
+ var defaultfloatPrecision=GetfloatPrecision(this.HQChart.Symbol);//价格小数位数
143576
+
143577
+ if (data.Type==0) //连续交易
143446
143578
  {
143447
- Title:g_JSChartLocalization.GetText('DialogTooltip-Amplitude',this.LanguageID),
143448
- Text:"--.--",
143449
- Color:this.TitleColor
143579
+ var item=data.Data;
143580
+ if (!item) item={ };
143581
+
143582
+ var aryText=
143583
+ [
143584
+ this.ForamtDate(item.Date,"YYYY/MM/DD/W",'DialogTooltip-Date' ),
143585
+ this.FormatTime(item.Time, null, "HH:MM", 'DialogTooltip-Time'),
143586
+ this.ForamtPrice(item.Close,item.YClose, defaultfloatPrecision,'DialogTooltip-Price'),
143587
+ this.FormatRisefall(item.Close,item.YClose, defaultfloatPrecision,'DialogTooltip-Risefall'),
143588
+ this.FormatIncrease(item.Close,item.YClose,'DialogTooltip-Increase'),
143589
+ this.FormatVol(item.Vol,'DialogTooltip-Vol' ),
143590
+ this.FormatAmount(item.Amount,'DialogTooltip-Amount' ),
143591
+ ];
143592
+
143593
+ return aryText;
143450
143594
  }
143451
- if (IFrameSplitOperator.IsNumber(data.YClose) && IFrameSplitOperator.IsNumber(data.High) && IFrameSplitOperator.IsNumber(data.Low))
143595
+ else if (data.Type==1) //集合竞价
143452
143596
  {
143453
- var value=(data.High-data.Low)/data.YClose;
143454
- amplitudeItem.Text=`${(value*100).toFixed(2)}%`;
143455
- amplitudeItem.Color=this.GetColor(value,0);
143456
- }
143597
+ var item=data.Data.Data;
143598
+ if (!item) item={ Vol:[] };
143457
143599
 
143458
- var aryText=
143459
- [
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
143492
- ];
143600
+ var timeForamt="HH:MM:SS";
143601
+ if (item.Ver===1) timeForamt="HH:MM"
143602
+ var aryText=
143603
+ [
143604
+ this.ForamtDate(item.Date,"YYYY/MM/DD/W",'DialogTooltip-Date' ),
143605
+ this.FormatTime(item.Time, null, timeForamt, 'DialogTooltip-Time'),
143606
+ this.ForamtPrice(item.Price,item.YClose, defaultfloatPrecision,'DialogTooltip-AC-Price'),
143607
+ this.FormatIncrease(item.Price,item.YClose,'DialogTooltip-AC-Increase'),
143608
+ this.FormatVol(item.Vol[0],'DialogTooltip-AC-Vol' ),
143609
+ ];
143493
143610
 
143494
- if (timeItem) aryText.unshift(timeItem);
143495
- aryText.unshift(dateItem);
143611
+ return aryText;
143612
+ }
143496
143613
 
143497
- return aryText;
143498
- },
143614
+ return [];
143615
+ }
143499
143616
 
143500
143617
  this.GetColor=function(price,yClose)
143501
143618
  {
@@ -143543,8 +143660,215 @@ function JSDialogTooltip()
143543
143660
  if (this.TitleBGColor) this.TitleBox.DivTitle.style['background-color']=this.TitleBGColor;
143544
143661
 
143545
143662
  this.UpdateTableDOM();
143663
+ },
143664
+
143665
+
143666
+ /////////////////////////////////////////////////////////////////////////////////////////////
143667
+ //数据格式化
143668
+ this.ForamtPrice=function(price, yClose, defaultfloatPrecision, TitleID)
143669
+ {
143670
+ var item=
143671
+ {
143672
+ Title:g_JSChartLocalization.GetText(TitleID, this.LanguageID),
143673
+ Text:"--.--",
143674
+ Color:this.TitleColor
143675
+ };
143676
+
143677
+ if (!IFrameSplitOperator.IsNumber(price)) return item;
143678
+
143679
+ item.Text=price.toFixed(defaultfloatPrecision);
143680
+ item.Color=this.GetColor(price, yClose);
143681
+
143682
+ return item;
143546
143683
  }
143547
143684
 
143685
+ this.FormatVol=function(vol, TitleID)
143686
+ {
143687
+ var item=
143688
+ {
143689
+ Title:g_JSChartLocalization.GetText(TitleID,this.LanguageID),
143690
+ Text:'--',
143691
+ Color:this.VolColor
143692
+ };
143693
+
143694
+ if (!IFrameSplitOperator.IsNumber(vol)) return item;
143695
+
143696
+ item.Text=IFrameSplitOperator.FormatValueString(vol,2,this.LanguageID);
143697
+
143698
+ return item;
143699
+ }
143700
+
143701
+ this.FormatAmount=function(amount, TitleID)
143702
+ {
143703
+ var item=
143704
+ {
143705
+ Title:g_JSChartLocalization.GetText(TitleID,this.LanguageID),
143706
+ Text:'--',
143707
+ Color:this.AmountColor
143708
+ };
143709
+
143710
+ if (!IFrameSplitOperator.IsNumber(amount)) return item;
143711
+
143712
+ item.Text=IFrameSplitOperator.FormatValueString(amount,2,this.LanguageID);
143713
+
143714
+ return item;
143715
+ }
143716
+
143717
+ this.FormatIncrease=function(price, yClose, TitleID)
143718
+ {
143719
+ //涨幅
143720
+ var item=
143721
+ {
143722
+ Title:g_JSChartLocalization.GetText(TitleID,this.LanguageID),
143723
+ Text:"--.--",
143724
+ Color:this.TitleColor
143725
+ };
143726
+
143727
+ if (!IFrameSplitOperator.IsNumber(price) || !IFrameSplitOperator.IsNumber(yClose)) return item;
143728
+
143729
+ var value=(price-yClose)/yClose;
143730
+ item.Text=`${(value*100).toFixed(2)}%`;
143731
+ item.Color=this.GetColor(value,0);
143732
+
143733
+ return item;
143734
+ }
143735
+
143736
+ this.FormatRisefall=function(price, yClose, defaultfloatPrecision, TitleID)
143737
+ {
143738
+ //涨跌
143739
+ var item=
143740
+ {
143741
+ Title:g_JSChartLocalization.GetText(TitleID,this.LanguageID),
143742
+ Text:"--.--",
143743
+ Color:this.TitleColor
143744
+ };
143745
+
143746
+ if (!IFrameSplitOperator.IsNumber(price) || !IFrameSplitOperator.IsNumber(yClose)) return item;
143747
+
143748
+ var value=price-yClose;
143749
+ item.Text=`${value.toFixed(defaultfloatPrecision)}`;
143750
+ item.Color=this.GetColor(value,0);
143751
+
143752
+ return item;
143753
+ }
143754
+
143755
+ this.FormatAmplitude=function(high, low, yClose, TitleID)
143756
+ {
143757
+ //涨幅
143758
+ var item=
143759
+ {
143760
+ Title:g_JSChartLocalization.GetText(TitleID,this.LanguageID),
143761
+ Text:"--.--",
143762
+ Color:this.TitleColor
143763
+ };
143764
+
143765
+
143766
+ if (!IFrameSplitOperator.IsNumber(high) || !IFrameSplitOperator.IsNumber(low) || !IFrameSplitOperator.IsNumber(yClose)) return item;
143767
+
143768
+ var value=(high-low)/yClose;
143769
+ item.Text=`${(value*100).toFixed(2)}%`;
143770
+ item.Color=this.GetColor(value,0);
143771
+
143772
+ return item;
143773
+ }
143774
+
143775
+ this.ForamtDate=function(date, format, TitleID)
143776
+ {
143777
+ //日期
143778
+ var item=
143779
+ {
143780
+ Title:g_JSChartLocalization.GetText('DialogTooltip-Date',this.LanguageID),
143781
+ Text:"----/--/--",
143782
+ Color:this.DateTimeColor
143783
+ }
143784
+
143785
+ if (!IFrameSplitOperator.IsNumber(date)) return item;
143786
+
143787
+ item.Text=IFrameSplitOperator.FormatDateString(date,format);
143788
+
143789
+ return item;
143790
+ }
143791
+
143792
+ this.FormatTime=function(time, period, format, TitleID)
143793
+ {
143794
+ //时间
143795
+ var item=
143796
+ {
143797
+ Title:g_JSChartLocalization.GetText(TitleID,this.LanguageID),
143798
+ Text:'--:--',
143799
+ Color:this.DateTimeColor
143800
+ };
143801
+
143802
+ if (!IFrameSplitOperator.IsNumber(time)) return item;
143803
+ if (!format)
143804
+ {
143805
+ format="HH:MM";
143806
+ if (ChartData.IsMinutePeriod(period,true)) timeFormat='HH:MM'; // 分钟周期
143807
+ else if (ChartData.IsSecondPeriod(period)) timeFormat='HH:MM:SS';
143808
+ else if (ChartData.IsMilliSecondPeriod(period)) timeFormat='HH:MM:SS.fff';
143809
+ }
143810
+
143811
+ item.Text=IFrameSplitOperator.FormatTimeString(time,format);
143812
+
143813
+ return item;
143814
+ }
143815
+
143816
+ //换手率 成交量/流通股本
143817
+ this.FormatExchange=function(vol, flowCapital, TitleID)
143818
+ {
143819
+ //换手率
143820
+ var item=
143821
+ {
143822
+ Title:g_JSChartLocalization.GetText(TitleID,this.LanguageID),
143823
+ Text:'--.--',
143824
+ Color:this.DateTimeColor
143825
+ };
143826
+
143827
+ if (!IFrameSplitOperator.IsNumber(vol) || !IFrameSplitOperator.IsNumber(flowCapital) || flowCapital==0) return item;
143828
+
143829
+ var value=vol/flowCapital*100;
143830
+ item.Text=value.toFixed(2)+'%';
143831
+
143832
+ return item;
143833
+ }
143834
+
143835
+
143836
+ //持仓
143837
+ this.FormatPosition=function(position, TitleID)
143838
+ {
143839
+ //持仓
143840
+ var item=
143841
+ {
143842
+ Title:g_JSChartLocalization.GetText(TitleID,this.LanguageID),
143843
+ Text:'--.--',
143844
+ Color:this.PositionColor
143845
+ };
143846
+
143847
+ if (!IFrameSplitOperator.IsNumber(position)) return item;
143848
+
143849
+ item.Text=position.toFixed(0);
143850
+
143851
+ return item;
143852
+ }
143853
+
143854
+ //结算价
143855
+ this.ForamtYClose=function(value, defaultfloatPrecision, TitleID)
143856
+ {
143857
+ var item=
143858
+ {
143859
+ Title:g_JSChartLocalization.GetText(TitleID,this.LanguageID),
143860
+ Text:'--.--',
143861
+ Color:this.DateTimeColor
143862
+ };
143863
+
143864
+ if (!IFrameSplitOperator.IsNumber(value)) return item;
143865
+
143866
+ item.Text=value.toFixed(defaultfloatPrecision);
143867
+
143868
+ return item;
143869
+ }
143870
+
143871
+
143548
143872
  }///////////////////////////////////////////////////////////////////////////////////
143549
143873
  // 工作线程计算指标示例
143550
143874
  //
@@ -143666,7 +143990,7 @@ function HQChartScriptWorker()
143666
143990
 
143667
143991
 
143668
143992
 
143669
- var HQCHART_VERSION="1.1.13910";
143993
+ var HQCHART_VERSION="1.1.13920";
143670
143994
 
143671
143995
  function PrintHQChartVersion()
143672
143996
  {