hqchart 1.1.14045 → 1.1.14056
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.
- package/lib/umychart.vue.js +117 -29
- package/package.json +1 -1
- package/src/jscommon/umychart.DialogTooltip.js +937 -5
- package/src/jscommon/umychart.js +197 -9
- package/src/jscommon/umychart.resource/css/tools.css +80 -0
- package/src/jscommon/umychart.style.js +15 -0
- package/src/jscommon/umychart.testdata/60000.sh.TradeDetal.js +4 -0
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +213 -10
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.vue.js +1150 -15
|
@@ -5691,6 +5691,9 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
5691
5691
|
if (option.TooltipDialog && option.TooltipDialog.Enable)
|
|
5692
5692
|
chart.InitalTooltipDialog(option.TooltipDialog);
|
|
5693
5693
|
|
|
5694
|
+
if (option.FloatTooltip && option.FloatTooltip.Enable)
|
|
5695
|
+
chart.InitalFloatTooltip(option.FloatTooltip);
|
|
5696
|
+
|
|
5694
5697
|
if (option.SelectRectDialog && option.SelectRectDialog.Enable)
|
|
5695
5698
|
{
|
|
5696
5699
|
chart.InitalSelectRectDialog(option.SelectRectDialog);
|
|
@@ -6602,9 +6605,11 @@ var JSCHART_EVENT_ID=
|
|
|
6602
6605
|
ON_CUSTOM_MINUTE_BG:157, //自定义分时图背景颜色
|
|
6603
6606
|
ON_CLICK_HORIZONTAL_LABEL:158, //点击Y轴刻度标签
|
|
6604
6607
|
|
|
6605
|
-
|
|
6608
|
+
ON_FORMAT_DIALOG_TOOLTIP:159, //格式化Tooltip对话框显示文字
|
|
6609
|
+
|
|
6610
|
+
ON_CHANGE_KLINE_RIGHT:160, //切换复权
|
|
6606
6611
|
|
|
6607
|
-
|
|
6612
|
+
ON_FORMAT_KLINE_FLOAT_TOOLTIP:161, //格式化k线浮动框显示文字
|
|
6608
6613
|
}
|
|
6609
6614
|
|
|
6610
6615
|
var JSCHART_OPERATOR_ID=
|
|
@@ -7008,6 +7013,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
7008
7013
|
|
|
7009
7014
|
this.DialogTooltip; //tooltip信息
|
|
7010
7015
|
this.DialogSelectRect; //区间统计
|
|
7016
|
+
this.FloatTooltip; //浮动tooltip信息
|
|
7011
7017
|
|
|
7012
7018
|
|
|
7013
7019
|
this.ClearStockCache=function()
|
|
@@ -7041,6 +7047,15 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
7041
7047
|
this.DialogTooltip.Create();
|
|
7042
7048
|
}
|
|
7043
7049
|
|
|
7050
|
+
this.InitalFloatTooltip=function(option)
|
|
7051
|
+
{
|
|
7052
|
+
if (this.FloatTooltip) return;
|
|
7053
|
+
|
|
7054
|
+
this.FloatTooltip=new JSFloatTooltip();
|
|
7055
|
+
this.FloatTooltip.Inital(this, option);
|
|
7056
|
+
this.FloatTooltip.Create();
|
|
7057
|
+
}
|
|
7058
|
+
|
|
7044
7059
|
this.InitalModifyDrawDialog=function()
|
|
7045
7060
|
{
|
|
7046
7061
|
if ( this.DialogModifyDraw) return;
|
|
@@ -7059,6 +7074,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
7059
7074
|
this.DialogSelectRect.Create();
|
|
7060
7075
|
}
|
|
7061
7076
|
|
|
7077
|
+
|
|
7078
|
+
|
|
7062
7079
|
this.DrawSelectRectDialog=function()
|
|
7063
7080
|
{
|
|
7064
7081
|
|
|
@@ -7132,6 +7149,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
7132
7149
|
this.DialogTooltip.Close();
|
|
7133
7150
|
}
|
|
7134
7151
|
|
|
7152
|
+
this.HideFloatTooltip=function()
|
|
7153
|
+
{
|
|
7154
|
+
if (!this.FloatTooltip) return;
|
|
7155
|
+
|
|
7156
|
+
this.FloatTooltip.Hide();
|
|
7157
|
+
}
|
|
7158
|
+
|
|
7135
7159
|
this.DestroyTooltipDialog=function()
|
|
7136
7160
|
{
|
|
7137
7161
|
if (!this.DialogTooltip) return;
|
|
@@ -7140,6 +7164,14 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
7140
7164
|
this.DialogTooltip=null;
|
|
7141
7165
|
}
|
|
7142
7166
|
|
|
7167
|
+
this.DestroyFloatTooltip=function()
|
|
7168
|
+
{
|
|
7169
|
+
if (!this.FloatTooltip) return;
|
|
7170
|
+
|
|
7171
|
+
this.FloatTooltip.Destroy();
|
|
7172
|
+
this.FloatTooltip=null;
|
|
7173
|
+
}
|
|
7174
|
+
|
|
7143
7175
|
|
|
7144
7176
|
|
|
7145
7177
|
//obj={ Element:, Canvas: }
|
|
@@ -7192,6 +7224,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
7192
7224
|
this.IsDestroy=true;
|
|
7193
7225
|
this.StopAutoUpdate();
|
|
7194
7226
|
this.DestroyTooltipDialog();
|
|
7227
|
+
this.DestroyFloatTooltip();
|
|
7195
7228
|
}
|
|
7196
7229
|
|
|
7197
7230
|
this.ChartDestory=this.ChartDestroy; //老版本写错了,需要兼容下
|
|
@@ -10963,6 +10996,17 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
10963
10996
|
|
|
10964
10997
|
}
|
|
10965
10998
|
|
|
10999
|
+
this.DrawFloatTooltip=function(point,toolTip)
|
|
11000
|
+
{
|
|
11001
|
+
|
|
11002
|
+
}
|
|
11003
|
+
|
|
11004
|
+
//更新实时行情到浮动tooltip
|
|
11005
|
+
this.UpdateHQFloatTooltip=function(item)
|
|
11006
|
+
{
|
|
11007
|
+
|
|
11008
|
+
}
|
|
11009
|
+
|
|
10966
11010
|
this.ShowTooltip=function(x,y,toolTip)
|
|
10967
11011
|
{
|
|
10968
11012
|
if (!this.IsShowTooltip) return;
|
|
@@ -10974,11 +11018,18 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
10974
11018
|
this.TooltipCache.Data=null;
|
|
10975
11019
|
this.TooltipCache.X=x;
|
|
10976
11020
|
this.TooltipCache.Y=y;
|
|
10977
|
-
|
|
11021
|
+
var bHideFloatToolip=true;
|
|
10978
11022
|
if (toolTip.Type===0) //K线信息
|
|
10979
11023
|
{
|
|
10980
11024
|
if (!this.KLineTooltipConfig.Enable) return;
|
|
10981
11025
|
|
|
11026
|
+
if (this.FloatTooltip)
|
|
11027
|
+
{
|
|
11028
|
+
this.DrawFloatTooltip({X:x, Y:y, YMove:20/pixelTatio}, toolTip);
|
|
11029
|
+
bHideFloatToolip=false;
|
|
11030
|
+
return;
|
|
11031
|
+
}
|
|
11032
|
+
|
|
10982
11033
|
var scrollPos=GetScrollPosition();
|
|
10983
11034
|
var left = x;
|
|
10984
11035
|
var top = y;
|
|
@@ -11018,6 +11069,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
11018
11069
|
}
|
|
11019
11070
|
else if (toolTip.Type===1) //信息地雷提示信息
|
|
11020
11071
|
{
|
|
11072
|
+
if (this.FloatTooltip)
|
|
11073
|
+
{
|
|
11074
|
+
this.DrawFloatTooltip({X:x, Y:y, YMove:20/pixelTatio}, toolTip);
|
|
11075
|
+
bHideFloatToolip=false;
|
|
11076
|
+
return;
|
|
11077
|
+
}
|
|
11078
|
+
|
|
11021
11079
|
var scrollPos=GetScrollPosition();
|
|
11022
11080
|
var left = x;
|
|
11023
11081
|
var top = y;
|
|
@@ -11172,6 +11230,9 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
11172
11230
|
this.Tooltip.innerHTML=format.Text;
|
|
11173
11231
|
this.Tooltip.style.display = "block";
|
|
11174
11232
|
}
|
|
11233
|
+
|
|
11234
|
+
|
|
11235
|
+
if (bHideFloatToolip) this.HideFloatTooltip();
|
|
11175
11236
|
}
|
|
11176
11237
|
|
|
11177
11238
|
this.UpdateDOMTooltip=function(toolTipType, data)
|
|
@@ -11208,6 +11269,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
11208
11269
|
this.TooltipCache.Data=null;
|
|
11209
11270
|
|
|
11210
11271
|
if (this.Tooltip.style.display!="none") this.Tooltip.style.display = "none";
|
|
11272
|
+
|
|
11273
|
+
this.HideFloatTooltip();
|
|
11211
11274
|
}
|
|
11212
11275
|
|
|
11213
11276
|
this.UpdateSelectRect=function(start,end)
|
|
@@ -12073,6 +12136,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
12073
12136
|
|
|
12074
12137
|
if (this.PopMinuteChart) this.PopMinuteChart.ReloadResource(option);
|
|
12075
12138
|
if (this.DialogTooltip) this.DialogTooltip.ReloadResource(option);
|
|
12139
|
+
if (this.FloatTooltip) this.FloatTooltip.ReloadResource(option);
|
|
12076
12140
|
if (this.DialogSelectRect) this.DialogSelectRect.ReloadResource(option);
|
|
12077
12141
|
}
|
|
12078
12142
|
|
|
@@ -14415,6 +14479,8 @@ function CoordinateInfo()
|
|
|
14415
14479
|
this.ExtendData; //扩展属性
|
|
14416
14480
|
//百分比 { PriceColor:, PercentageColor:, SplitColor:, Font: }
|
|
14417
14481
|
//自定义刻度 { Custom:{ Position: 1=强制内部 }}
|
|
14482
|
+
//输出位置的Y轴偏移
|
|
14483
|
+
//this.YOffset;
|
|
14418
14484
|
this.AreaData; //区域: { Start:, End:, BGColor:, Position:[0=左, 1=右] }
|
|
14419
14485
|
|
|
14420
14486
|
//不在当前屏范围 (可定义刻度使用)
|
|
@@ -17446,7 +17512,7 @@ function AverageWidthFrame()
|
|
|
17446
17512
|
this.Canvas.lineWidth=pixelRatio;
|
|
17447
17513
|
}
|
|
17448
17514
|
}
|
|
17449
|
-
else if (lineType==
|
|
17515
|
+
else if (lineType==3) //绘制短线
|
|
17450
17516
|
{
|
|
17451
17517
|
var lineWidth=10*GetDevicePixelRatio();
|
|
17452
17518
|
this.Canvas.strokeStyle=color;
|
|
@@ -73245,8 +73311,20 @@ function JSChartResource()
|
|
|
73245
73311
|
|
|
73246
73312
|
TextColor:"rgb(0,0,0)", //数值名称
|
|
73247
73313
|
ValueColor:"rgb(0,0,0)", //数值
|
|
73314
|
+
};
|
|
73248
73315
|
|
|
73249
|
-
|
|
73316
|
+
this.FloatTooltip=
|
|
73317
|
+
{
|
|
73318
|
+
BGColor:'rgb(250,250,250)', //背景色
|
|
73319
|
+
BorderColor:'rgb(20,20,20)', //边框颜色
|
|
73320
|
+
VolColor:"rgb(255, 185, 15)", //标题成交量
|
|
73321
|
+
AmountColor:"rgb(79, 79, 79)", //成交金额
|
|
73322
|
+
DateTimeColor:'rgb(60,60,60)',
|
|
73323
|
+
TurnoverRateColor:'rgb(43,54,69)', //换手率
|
|
73324
|
+
PositionColor:"rgb(255,0,255)", //持仓
|
|
73325
|
+
|
|
73326
|
+
TextColor:"rgb(0,0,0)", //数值名称
|
|
73327
|
+
ValueColor:"rgb(0,0,0)", //数值
|
|
73250
73328
|
};
|
|
73251
73329
|
|
|
73252
73330
|
//区间统计
|
|
@@ -74295,6 +74373,22 @@ function JSChartResource()
|
|
|
74295
74373
|
if (item.ValueColor) this.DialogTooltip.ValueColor=item.ValueColor;
|
|
74296
74374
|
}
|
|
74297
74375
|
|
|
74376
|
+
if (style.FloatTooltip)
|
|
74377
|
+
{
|
|
74378
|
+
var item=style.FloatTooltip;
|
|
74379
|
+
if (item.BGColor) this.FloatTooltip.BGColor=item.BGColor;
|
|
74380
|
+
if (item.BorderColor) this.FloatTooltip.BorderColor=item.BorderColor;
|
|
74381
|
+
|
|
74382
|
+
if (item.DateTimeColor) this.FloatTooltip.DateTimeColor=item.DateTimeColor;
|
|
74383
|
+
if (item.VolColor) this.FloatTooltip.VolColor=item.VolColor;
|
|
74384
|
+
if (item.AmountColor) this.FloatTooltip.AmountColor=item.AmountColor;
|
|
74385
|
+
if (item.TurnoverRateColor) this.FloatTooltip.TurnoverRateColor=item.TurnoverRateColor;
|
|
74386
|
+
if (item.PositionColor) this.FloatTooltip.PositionColor=item.PositionColor;
|
|
74387
|
+
|
|
74388
|
+
if (item.TextColor) this.FloatTooltip.TextColor=item.TextColor;
|
|
74389
|
+
if (item.ValueColor) this.FloatTooltip.ValueColor=item.ValueColor;
|
|
74390
|
+
}
|
|
74391
|
+
|
|
74298
74392
|
if (style.DialogSelectRect)
|
|
74299
74393
|
{
|
|
74300
74394
|
var item=style.DialogSelectRect;
|
|
@@ -75397,7 +75491,26 @@ function JSChartLocalization()
|
|
|
75397
75491
|
['DialogTooltip-AC-Vol', {CN:'匹配量', EN:'Vol', TC:'匹配量'}],
|
|
75398
75492
|
['DialogTooltip-Value', {CN:'数值', EN:'Value', TC:'数值'}],
|
|
75399
75493
|
|
|
75494
|
+
['FloatTooltip-Date', {CN:'日期', EN:'Date', TC:'日期'}],
|
|
75495
|
+
['FloatTooltip-Time', {CN:'时间', EN:'Time', TC:'時間'}],
|
|
75496
|
+
['FloatTooltip-Open', {CN:'开盘价', EN:'Open', TC:'開盤價'}],
|
|
75497
|
+
['FloatTooltip-High', {CN:'最高价', EN:'High', TC:'最高價'}],
|
|
75498
|
+
['FloatTooltip-Low', {CN:'最低价', EN:'Low', TC:'最低價'}],
|
|
75499
|
+
['FloatTooltip-Close', {CN:'收盘价', EN:'Close', TC:'收盤價'}],
|
|
75500
|
+
['FloatTooltip-YClose', {CN:'昨收价', EN:'YClose', TC:'昨收價'}],
|
|
75501
|
+
['FloatTooltip-Increase', {CN:'涨幅', EN:'Increase', TC:'漲幅'}],
|
|
75502
|
+
['FloatTooltip-Risefall', {CN:'涨跌', EN:'Risefall', TC:'漲跌'}],
|
|
75503
|
+
['FloatTooltip-Vol', {CN:'成交量', EN:'Volume', TC:'數量'}],
|
|
75504
|
+
['FloatTooltip-Amount', {CN:'成交额', EN:'Amount', TC:'金額'}],
|
|
75505
|
+
['FloatTooltip-Exchange', {CN:'换手率', EN:'Exchange', TC:'換手'}],
|
|
75506
|
+
['FloatTooltip-Position', {CN:'持仓量', EN:'Position', TC:'持倉'}],
|
|
75507
|
+
['FloatTooltip-Price', {CN:'价格', EN:'Price', TC:'價格'}],
|
|
75508
|
+
['FloatTooltip-AvPrice', {CN:'均价', EN:'AVPrice:', TC:'均價'}],
|
|
75509
|
+
['FloatTooltip-FClose', {CN:"结算价", EN:'Settlement', TC:'結算價'}],
|
|
75510
|
+
['FloatTooltip-YSettlePrice', {CN:"昨结算", EN:'YSettlement', TC:'昨結算'}],
|
|
75511
|
+
['FloatTooltip-Amplitude', {CN:'振幅', EN:'amplitude', TC:'振幅'}],
|
|
75400
75512
|
|
|
75513
|
+
|
|
75401
75514
|
['DialogSelectRect-StartPrice', {CN:'起始价:', EN:'Start Price:', TC:'起始價'}],
|
|
75402
75515
|
['DialogSelectRect-EndPrice', {CN:'最终价:', EN:"End Price:", TC:'最终價'}],
|
|
75403
75516
|
['DialogSelectRect-High', {CN:'最高价:', EN:'High:', TC:'最高價'}],
|
|
@@ -78872,6 +78985,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
78872
78985
|
|
|
78873
78986
|
this.SendKLineUpdateEvent(bindData);
|
|
78874
78987
|
this.UpdateDOMTooltip(0, bindData);
|
|
78988
|
+
this.UpdateHQFloatTooltip(bindData);
|
|
78875
78989
|
|
|
78876
78990
|
//叠加指标计算
|
|
78877
78991
|
this.BindAllOverlayIndexData(bindData, { CheckRunCount:true,SyncExecute:false }); //异步模式叠加指标
|
|
@@ -79130,6 +79244,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
79130
79244
|
|
|
79131
79245
|
this.SendKLineUpdateEvent(bindData);
|
|
79132
79246
|
this.UpdateDOMTooltip(0, bindData);
|
|
79247
|
+
this.UpdateHQFloatTooltip(bindData);
|
|
79133
79248
|
|
|
79134
79249
|
//更新叠加指标
|
|
79135
79250
|
this.BindAllOverlayIndexData(bindData, { CheckRunCount:true,SyncExecute:false }); //异步模式叠加指标
|
|
@@ -83665,18 +83780,34 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
83665
83780
|
if (!this.DialogTooltip) return false;
|
|
83666
83781
|
if (!this.ChartCorssCursor) return false;
|
|
83667
83782
|
|
|
83783
|
+
var dataType=0;
|
|
83668
83784
|
var kItem=null;
|
|
83669
83785
|
if (this.ChartCorssCursor.ClientPos>=0)
|
|
83670
83786
|
{
|
|
83671
83787
|
var hisData=this.ChartOperator_Temp_GetHistroyData();;
|
|
83672
83788
|
if (!hisData) return false; //数据还没有到达
|
|
83789
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(hisData.Data)) return false;
|
|
83673
83790
|
|
|
83674
83791
|
var dataIndex=hisData.DataOffset+this.ChartCorssCursor.CursorIndex;
|
|
83792
|
+
if (dataIndex>=hisData.Data.length) dataIndex=hisData.Data.length-1;
|
|
83675
83793
|
var kItem=hisData.Data[dataIndex];
|
|
83676
83794
|
}
|
|
83795
|
+
else //取最后一个数据
|
|
83796
|
+
{
|
|
83797
|
+
var hisData=this.ChartOperator_Temp_GetHistroyData();;
|
|
83798
|
+
if (!hisData) return false; //数据还没有到达
|
|
83799
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(hisData.Data)) return false;
|
|
83800
|
+
var kItem=hisData.Data[hisData.Data.length-1];
|
|
83801
|
+
var dataID={ Symbol:this.Symbol, Date:kItem.Date };
|
|
83802
|
+
if (IFrameSplitOperator.IsNumber(kItem.Time)) dataID.Time=kItem.Time;
|
|
83803
|
+
if (!this.DialogTooltip.IsEqualDataID(dataID)) return false;
|
|
83804
|
+
|
|
83805
|
+
dataType=1;
|
|
83806
|
+
}
|
|
83677
83807
|
|
|
83678
83808
|
var sendData=
|
|
83679
83809
|
{
|
|
83810
|
+
DataType:dataType, //0=全部更新 1=更新实时K线
|
|
83680
83811
|
ClientPos:this.ChartCorssCursor.ClientPos, //位置
|
|
83681
83812
|
IsShowCorss:this.ChartCorssCursor.IsShowCorss, //是否显示十字线
|
|
83682
83813
|
KItem:kItem,
|
|
@@ -83684,7 +83815,6 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
83684
83815
|
LastValue:this.ChartCorssCursor.LastValue,
|
|
83685
83816
|
};
|
|
83686
83817
|
|
|
83687
|
-
|
|
83688
83818
|
this.DialogTooltip.Update(sendData);
|
|
83689
83819
|
|
|
83690
83820
|
return true;
|
|
@@ -83725,6 +83855,52 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
83725
83855
|
|
|
83726
83856
|
this.DialogSelectRect.Update(sendData);
|
|
83727
83857
|
}
|
|
83858
|
+
|
|
83859
|
+
this.DrawFloatTooltip=function(point,toolTip)
|
|
83860
|
+
{
|
|
83861
|
+
if (!this.FloatTooltip) return;
|
|
83862
|
+
|
|
83863
|
+
this.UpdateFloatTooltip(point, toolTip)
|
|
83864
|
+
}
|
|
83865
|
+
|
|
83866
|
+
this.UpdateFloatTooltip=function(point, toolTip)
|
|
83867
|
+
{
|
|
83868
|
+
if (!this.FloatTooltip) return;
|
|
83869
|
+
|
|
83870
|
+
var sendData=
|
|
83871
|
+
{
|
|
83872
|
+
Tooltip:toolTip,
|
|
83873
|
+
Point:point,
|
|
83874
|
+
Symbol:this.Symbol,
|
|
83875
|
+
Name:this.Name,
|
|
83876
|
+
DataType:1,
|
|
83877
|
+
};
|
|
83878
|
+
|
|
83879
|
+
this.FloatTooltip.Update(sendData);
|
|
83880
|
+
}
|
|
83881
|
+
|
|
83882
|
+
this.UpdateHQFloatTooltip=function(kData)
|
|
83883
|
+
{
|
|
83884
|
+
if (!this.FloatTooltip) return;
|
|
83885
|
+
if (!this.FloatTooltip.IsShow()) return;
|
|
83886
|
+
if (!kData || !IFrameSplitOperator.IsNonEmptyArray(kData.Data)) return;
|
|
83887
|
+
|
|
83888
|
+
var lastItem=kData.Data[kData.Data.length-1];
|
|
83889
|
+
if (!lastItem) return;
|
|
83890
|
+
|
|
83891
|
+
var dataID={ Symbol:kData.Symbol, Date:lastItem.Date, Time:lastItem.Time };
|
|
83892
|
+
if (!this.FloatTooltip.IsEqualHQID(dataID)) return;
|
|
83893
|
+
|
|
83894
|
+
var sendData=
|
|
83895
|
+
{
|
|
83896
|
+
Data:lastItem,
|
|
83897
|
+
Symbol:this.Symbol,
|
|
83898
|
+
Name:this.Name,
|
|
83899
|
+
DataType:2,
|
|
83900
|
+
};
|
|
83901
|
+
|
|
83902
|
+
this.FloatTooltip.Update(sendData);
|
|
83903
|
+
}
|
|
83728
83904
|
}
|
|
83729
83905
|
|
|
83730
83906
|
//API 返回数据 转化为array[]
|
|
@@ -89551,6 +89727,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
89551
89727
|
if (!this.ChartCorssCursor) return false;
|
|
89552
89728
|
|
|
89553
89729
|
var minuteItem=null; //{ Type:0=连续交易 1=集合竞价, Data:数据 }
|
|
89730
|
+
var dataType=0; //0=全部更新 2=分时实时数据更新
|
|
89554
89731
|
if (this.ChartCorssCursor.ClientPos>=0)
|
|
89555
89732
|
{
|
|
89556
89733
|
var titlePaint=this.TitlePaint[0];
|
|
@@ -89560,21 +89737,32 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
89560
89737
|
if ((pointInfo.ClientPos==2 || pointInfo.ClientPos==3 || (pointInfo.ClientPos>=200&& pointInfo.ClientPos<=299) || (pointInfo.ClientPos>=300&& pointInfo.ClientPos<=399)))
|
|
89561
89738
|
{
|
|
89562
89739
|
var auctionData=titlePaint.GetCurrentAuctionData();
|
|
89563
|
-
if (!auctionData) return;
|
|
89740
|
+
if (!auctionData) return false;
|
|
89564
89741
|
minuteItem={ Type:1, Data:auctionData };
|
|
89565
89742
|
}
|
|
89566
89743
|
else
|
|
89567
89744
|
{
|
|
89568
89745
|
var minuteData=titlePaint.GetCurrentKLineData();
|
|
89569
|
-
if (!minuteData) return;
|
|
89746
|
+
if (!minuteData) return false;
|
|
89570
89747
|
minuteItem={ Type:0, Data:minuteData };
|
|
89571
89748
|
}
|
|
89572
89749
|
}
|
|
89573
|
-
|
|
89750
|
+
}
|
|
89751
|
+
else //实时数据更新
|
|
89752
|
+
{
|
|
89753
|
+
if (!this.SourceData || !IFrameSplitOperator.IsNonEmptyArray(this.SourceData.Data)) return false;
|
|
89754
|
+
var minuteData=this.SourceData.Data[this.SourceData.Data.length-1];
|
|
89755
|
+
|
|
89756
|
+
var dataID={ Symbol:this.Symbol, Date:minuteData.Date, Time:minuteData.Time };
|
|
89757
|
+
if (!this.DialogTooltip.IsEqualDataID(dataID)) return false;
|
|
89758
|
+
|
|
89759
|
+
minuteItem={ Type:0, Data:minuteData };
|
|
89760
|
+
dataType=2;
|
|
89574
89761
|
}
|
|
89575
89762
|
|
|
89576
89763
|
var sendData=
|
|
89577
89764
|
{
|
|
89765
|
+
DataType:dataType,
|
|
89578
89766
|
ClientPos:this.ChartCorssCursor.ClientPos, //位置
|
|
89579
89767
|
IsShowCorss:this.ChartCorssCursor.IsShowCorss, //是否显示十字线
|
|
89580
89768
|
MinItem:minuteItem,
|
|
@@ -125334,6 +125522,21 @@ function GetBlackStyle()
|
|
|
125334
125522
|
TitleBGColor:"rgb(200, 66, 69)",
|
|
125335
125523
|
},
|
|
125336
125524
|
|
|
125525
|
+
FloatTooltip:
|
|
125526
|
+
{
|
|
125527
|
+
BGColor:'rgb(20,20,20)', //背景色
|
|
125528
|
+
BorderColor:'rgb(170,170,170)', //边框颜色
|
|
125529
|
+
|
|
125530
|
+
VolColor:"rgb(255, 185, 15)", //标题成交量
|
|
125531
|
+
AmountColor:"rgb(210,210,210)", //成交金额
|
|
125532
|
+
DateTimeColor:'rgb(210,210,210)',
|
|
125533
|
+
TurnoverRateColor:'rgb(43,54,69)', //换手率
|
|
125534
|
+
PositionColor:"rgb(255,0,255)", //持仓
|
|
125535
|
+
|
|
125536
|
+
TextColor:"rgb(210,210,210)", //数值名称
|
|
125537
|
+
ValueColor:"rgb(210,210,210)", //数值
|
|
125538
|
+
},
|
|
125539
|
+
|
|
125337
125540
|
DialogSelectRect:
|
|
125338
125541
|
{
|
|
125339
125542
|
BGColor:'rgb(20,20,20)', //背景色
|
|
@@ -144259,8 +144462,9 @@ function JSDialogTooltip()
|
|
|
144259
144462
|
|
|
144260
144463
|
this.KItemCache=null;
|
|
144261
144464
|
this.KItemCacheID=null;
|
|
144262
|
-
this.LastValueCache=null;
|
|
144263
|
-
this.LastValueCacheID=null;
|
|
144465
|
+
this.LastValueCache=null; //最后的鼠标位置对应的数值
|
|
144466
|
+
this.LastValueCacheID=null; //鼠标信息
|
|
144467
|
+
this.DataID=null; //当前显示的数据时间{ Symbol:, Date:, Time: }
|
|
144264
144468
|
|
|
144265
144469
|
this.Inital=function(hqchart, option)
|
|
144266
144470
|
{
|
|
@@ -144300,6 +144504,22 @@ function JSDialogTooltip()
|
|
|
144300
144504
|
}
|
|
144301
144505
|
}
|
|
144302
144506
|
|
|
144507
|
+
//data={ Symbol, Date, Time}
|
|
144508
|
+
this.IsEqualDataID=function(data)
|
|
144509
|
+
{
|
|
144510
|
+
if (!this.DataID) return false;
|
|
144511
|
+
if (!data) return false;
|
|
144512
|
+
|
|
144513
|
+
if (this.DataID.Symbol!=data.Symbol) return false;
|
|
144514
|
+
if (this.DataID.Date!=data.Date) return false;
|
|
144515
|
+
if (IFrameSplitOperator.IsNumber(this.DataID.Time))
|
|
144516
|
+
{
|
|
144517
|
+
if (this.DataID.Time!=data.Time) return false;
|
|
144518
|
+
}
|
|
144519
|
+
|
|
144520
|
+
return true;
|
|
144521
|
+
}
|
|
144522
|
+
|
|
144303
144523
|
this.Create=function()
|
|
144304
144524
|
{
|
|
144305
144525
|
var divDom=document.createElement("div");
|
|
@@ -144415,9 +144635,72 @@ function JSDialogTooltip()
|
|
|
144415
144635
|
this.UpdateStyle();
|
|
144416
144636
|
}
|
|
144417
144637
|
|
|
144638
|
+
//更新实时数据
|
|
144639
|
+
this.UpdateKLineData=function(data)
|
|
144640
|
+
{
|
|
144641
|
+
if (!data.KItem|| !data.IsShowCorss) return;
|
|
144642
|
+
|
|
144643
|
+
this.LanguageID=this.HQChart.LanguageID;
|
|
144644
|
+
|
|
144645
|
+
if (this.HQChart.ClassName=='KLineChartContainer')
|
|
144646
|
+
{
|
|
144647
|
+
var strKItem=JSON.stringify(data.KItem);
|
|
144648
|
+
var bUpdata=false;
|
|
144649
|
+
if (this.KItemCacheID!=strKItem) //数据变动的才更新
|
|
144650
|
+
{
|
|
144651
|
+
this.KItemCache= JSON.parse(strKItem);
|
|
144652
|
+
this.KItemCacheID=strKItem;
|
|
144653
|
+
bUpdata=true;
|
|
144654
|
+
}
|
|
144655
|
+
|
|
144656
|
+
if (bUpdata)
|
|
144657
|
+
{
|
|
144658
|
+
this.UpdateTableDOM();
|
|
144659
|
+
}
|
|
144660
|
+
else
|
|
144661
|
+
{
|
|
144662
|
+
//JSConsole.Chart.Log(`[JSDialogTooltip::Update] save as KItemCache and KItem`);
|
|
144663
|
+
}
|
|
144664
|
+
}
|
|
144665
|
+
}
|
|
144666
|
+
|
|
144667
|
+
//更新实时分时数据
|
|
144668
|
+
this.UpdateMinuteData=function(data)
|
|
144669
|
+
{
|
|
144670
|
+
if (!data.MinItem || !data.IsShowCorss) return;
|
|
144671
|
+
|
|
144672
|
+
var strKItem=JSON.stringify(data.MinItem);
|
|
144673
|
+
var bUpdata=false;
|
|
144674
|
+
if (this.KItemCacheID!=strKItem) //数据变动的才更新
|
|
144675
|
+
{
|
|
144676
|
+
this.KItemCache= JSON.parse(strKItem);
|
|
144677
|
+
this.KItemCacheID=strKItem;
|
|
144678
|
+
bUpdata=true;
|
|
144679
|
+
}
|
|
144680
|
+
|
|
144681
|
+
if (bUpdata)
|
|
144682
|
+
{
|
|
144683
|
+
this.UpdateTableDOM();
|
|
144684
|
+
}
|
|
144685
|
+
}
|
|
144686
|
+
|
|
144418
144687
|
this.Update=function(data)
|
|
144419
144688
|
{
|
|
144420
144689
|
if (!this.DivDialog || !this.TitleBox) return;
|
|
144690
|
+
|
|
144691
|
+
//实时数据更新
|
|
144692
|
+
if (data.DataType==1)
|
|
144693
|
+
{
|
|
144694
|
+
this.UpdateKLineData(data);
|
|
144695
|
+
return;
|
|
144696
|
+
}
|
|
144697
|
+
else if (data.DataType==2)
|
|
144698
|
+
{
|
|
144699
|
+
this.UpdateMinuteData(data);
|
|
144700
|
+
return;
|
|
144701
|
+
}
|
|
144702
|
+
|
|
144703
|
+
|
|
144421
144704
|
if ((!data.KItem && !data.MinItem) || !data.IsShowCorss || data.ClientPos<0) return;
|
|
144422
144705
|
|
|
144423
144706
|
this.LanguageID=this.HQChart.LanguageID;
|
|
@@ -144442,6 +144725,7 @@ function JSDialogTooltip()
|
|
|
144442
144725
|
|
|
144443
144726
|
if (bUpdata)
|
|
144444
144727
|
{
|
|
144728
|
+
this.UpdateDataID(data);
|
|
144445
144729
|
this.UpdateTableDOM();
|
|
144446
144730
|
}
|
|
144447
144731
|
else
|
|
@@ -144469,6 +144753,7 @@ function JSDialogTooltip()
|
|
|
144469
144753
|
|
|
144470
144754
|
if (bUpdata)
|
|
144471
144755
|
{
|
|
144756
|
+
this.UpdateDataID(data);
|
|
144472
144757
|
this.UpdateTableDOM();
|
|
144473
144758
|
}
|
|
144474
144759
|
}
|
|
@@ -144516,6 +144801,31 @@ function JSDialogTooltip()
|
|
|
144516
144801
|
}
|
|
144517
144802
|
}
|
|
144518
144803
|
|
|
144804
|
+
this.UpdateDataID=function(data)
|
|
144805
|
+
{
|
|
144806
|
+
if (this.HQChart.ClassName=='KLineChartContainer')
|
|
144807
|
+
{
|
|
144808
|
+
var kItem=data.KItem;
|
|
144809
|
+
this.DataID={ Symbol:data.Symbol, Date:kItem.Date, Time:null };
|
|
144810
|
+
if (IFrameSplitOperator.IsNumber(kItem.Time)) this.DataID.Time=kItem.Time;
|
|
144811
|
+
}
|
|
144812
|
+
else if (this.HQChart.ClassName=='MinuteChartContainer')
|
|
144813
|
+
{
|
|
144814
|
+
var minItem=data.MinItem;
|
|
144815
|
+
if (minItem.Type==0) //连续交易
|
|
144816
|
+
{
|
|
144817
|
+
var item=minItem.Data;
|
|
144818
|
+
if (item) this.DataID={ Symbol:data.Symbol, Date:item.Date, Time:item.Time };
|
|
144819
|
+
}
|
|
144820
|
+
else if (minItem.Type==1) //集合竞价
|
|
144821
|
+
{
|
|
144822
|
+
var item=minItem.Data.Data;
|
|
144823
|
+
if (item) this.DataID={ Symbol:data.Symbol, Date:item.Date, Time:item.Time };
|
|
144824
|
+
}
|
|
144825
|
+
|
|
144826
|
+
}
|
|
144827
|
+
}
|
|
144828
|
+
|
|
144519
144829
|
this.Close=function(e)
|
|
144520
144830
|
{
|
|
144521
144831
|
if (!this.DivDialog) return;
|
|
@@ -144661,7 +144971,7 @@ function JSDialogTooltip()
|
|
|
144661
144971
|
aryText.push(this.ForamtFClose(data.FClose, defaultfloatPrecision, 'DialogTooltip-FClose'));
|
|
144662
144972
|
}
|
|
144663
144973
|
|
|
144664
|
-
var event=this.HQChart.GetEventCallback(JSCHART_EVENT_ID.
|
|
144974
|
+
var event=this.HQChart.GetEventCallback(JSCHART_EVENT_ID.ON_FORMAT_DIALOG_TOOLTIP);
|
|
144665
144975
|
if (event && event.Callback)
|
|
144666
144976
|
{
|
|
144667
144977
|
var sendData={ AryText:aryText, Data:data, Symbol:this.HQChart.Symbol, HQChart:this.HQChart, IsKLine:true };
|
|
@@ -144669,7 +144979,7 @@ function JSDialogTooltip()
|
|
|
144669
144979
|
}
|
|
144670
144980
|
|
|
144671
144981
|
return aryText;
|
|
144672
|
-
}
|
|
144982
|
+
}
|
|
144673
144983
|
|
|
144674
144984
|
this.GetFormatMinuteTooltipText=function(data)
|
|
144675
144985
|
{
|
|
@@ -144729,7 +145039,7 @@ function JSDialogTooltip()
|
|
|
144729
145039
|
|
|
144730
145040
|
}
|
|
144731
145041
|
|
|
144732
|
-
var event=this.HQChart.GetEventCallback(JSCHART_EVENT_ID.
|
|
145042
|
+
var event=this.HQChart.GetEventCallback(JSCHART_EVENT_ID.ON_FORMAT_DIALOG_TOOLTIP);
|
|
144733
145043
|
if (event && event.Callback)
|
|
144734
145044
|
{
|
|
144735
145045
|
var sendData={ AryText:aryText, Data:data, Symbol:this.HQChart.Symbol, HQChart:this.HQChart, IsMinute:true };
|
|
@@ -145044,6 +145354,831 @@ function JSDialogTooltip()
|
|
|
145044
145354
|
|
|
145045
145355
|
|
|
145046
145356
|
}
|
|
145357
|
+
|
|
145358
|
+
//浮动K线提示信息
|
|
145359
|
+
function JSFloatTooltip()
|
|
145360
|
+
{
|
|
145361
|
+
this.DivDialog=null;
|
|
145362
|
+
this.Style=0; //0=一行一个, 1=2行一个
|
|
145363
|
+
|
|
145364
|
+
this.HQChart=null;
|
|
145365
|
+
this.MaxRowCount=25;
|
|
145366
|
+
|
|
145367
|
+
this.UpColor=g_JSChartResource.UpTextColor;
|
|
145368
|
+
this.DownColor=g_JSChartResource.DownTextColor;
|
|
145369
|
+
this.UnchangeColor=g_JSChartResource.UnchagneTextColor;
|
|
145370
|
+
|
|
145371
|
+
this.BGColor=g_JSChartResource.FloatTooltip.BGColor;
|
|
145372
|
+
this.BorderColor=g_JSChartResource.FloatTooltip.BorderColor;
|
|
145373
|
+
|
|
145374
|
+
this.TextColor=g_JSChartResource.FloatTooltip.TextColor;
|
|
145375
|
+
this.ValueColor=g_JSChartResource.FloatTooltip.ValueColor;
|
|
145376
|
+
|
|
145377
|
+
this.VolColor=g_JSChartResource.FloatTooltip.VolColor;
|
|
145378
|
+
this.AmountColor=g_JSChartResource.FloatTooltip.AmountColor;
|
|
145379
|
+
this.TurnoverRateColor=g_JSChartResource.FloatTooltip.TurnoverRateColor;
|
|
145380
|
+
this.PositionColor=g_JSChartResource.FloatTooltip.PositionColor;
|
|
145381
|
+
this.DateTimeColor=g_JSChartResource.FloatTooltip.DateTimeColor;
|
|
145382
|
+
this.LanguageID=JSCHART_LANGUAGE_ID.LANGUAGE_CHINESE_ID;
|
|
145383
|
+
|
|
145384
|
+
this.ValueAlign=
|
|
145385
|
+
{
|
|
145386
|
+
Left:"UMyChart_Tooltip_Float_Text2_Span", //左对齐
|
|
145387
|
+
MarginLeft:'UMyChart_Tooltip_Float_Text3_Span',
|
|
145388
|
+
Right:"UMyChart_Tooltip_Float_Text_Span"
|
|
145389
|
+
}
|
|
145390
|
+
|
|
145391
|
+
this.AryData=[]; //输出文字信息
|
|
145392
|
+
this.AryText=[]; //表格tr
|
|
145393
|
+
|
|
145394
|
+
this.KItemCache=null; //{ Symbol:, Item:, Name }
|
|
145395
|
+
this.KItemCacheID=null;
|
|
145396
|
+
|
|
145397
|
+
this.Inital=function(hqchart, option)
|
|
145398
|
+
{
|
|
145399
|
+
this.HQChart=hqchart;
|
|
145400
|
+
if (option)
|
|
145401
|
+
{
|
|
145402
|
+
if (IFrameSplitOperator.IsNumber(option.Style)) this.Style=option.Style;
|
|
145403
|
+
}
|
|
145404
|
+
}
|
|
145405
|
+
|
|
145406
|
+
this.Destroy=function()
|
|
145407
|
+
{
|
|
145408
|
+
this.AryData=[];
|
|
145409
|
+
this.AryText=[];
|
|
145410
|
+
this.KItemCache=null;
|
|
145411
|
+
this.KItemCacheID=null;
|
|
145412
|
+
|
|
145413
|
+
if (this.DivDialog)
|
|
145414
|
+
{
|
|
145415
|
+
document.body.removeChild(this.DivDialog);
|
|
145416
|
+
this.DivDialog=null;
|
|
145417
|
+
}
|
|
145418
|
+
}
|
|
145419
|
+
|
|
145420
|
+
this.Show=function(x, y)
|
|
145421
|
+
{
|
|
145422
|
+
if (!this.DivDialog) return;
|
|
145423
|
+
if (!this.HQChart) return;
|
|
145424
|
+
|
|
145425
|
+
var rtClient=this.HQChart.UIElement.getBoundingClientRect();
|
|
145426
|
+
var left=x+rtClient.left,top=y+rtClient.top;
|
|
145427
|
+
var right=left+this.DivDialog.offsetWidth;
|
|
145428
|
+
var bottom=top+this.DivDialog.offsetHeight;
|
|
145429
|
+
|
|
145430
|
+
if ((right+5)>=window.innerWidth) left=left-this.DivDialog.offsetWidth;
|
|
145431
|
+
if ((bottom+5)>=window.innerHeight) top=0;
|
|
145432
|
+
|
|
145433
|
+
this.DivDialog.style.top = top + "px";
|
|
145434
|
+
this.DivDialog.style.left = left + "px";
|
|
145435
|
+
|
|
145436
|
+
if (this.DivDialog.style.visibility!='visible')
|
|
145437
|
+
this.DivDialog.style.visibility='visible';
|
|
145438
|
+
}
|
|
145439
|
+
|
|
145440
|
+
this.Hide=function()
|
|
145441
|
+
{
|
|
145442
|
+
if (!this.DivDialog) return;
|
|
145443
|
+
|
|
145444
|
+
this.KItemCache=null;
|
|
145445
|
+
this.KItemCacheID=null;
|
|
145446
|
+
|
|
145447
|
+
if (this.DivDialog.style.visibility!='hidden') this.DivDialog.style.visibility='hidden';
|
|
145448
|
+
}
|
|
145449
|
+
|
|
145450
|
+
this.Create=function()
|
|
145451
|
+
{
|
|
145452
|
+
var divDom=document.createElement("div");
|
|
145453
|
+
divDom.className='UMyChart_Tooltip_Float_Div';
|
|
145454
|
+
|
|
145455
|
+
var table=document.createElement("table");
|
|
145456
|
+
table.className="UMyChart_Tooltip_Float_Table";
|
|
145457
|
+
divDom.appendChild(table);
|
|
145458
|
+
|
|
145459
|
+
var tbody=document.createElement("tbody");
|
|
145460
|
+
tbody.className="UMyChart_Tooltip_Float_Tbody";
|
|
145461
|
+
table.appendChild(tbody);
|
|
145462
|
+
|
|
145463
|
+
this.AryData=[];
|
|
145464
|
+
|
|
145465
|
+
for(var i=0;i<this.MaxRowCount;++i)
|
|
145466
|
+
{
|
|
145467
|
+
var rowItem={ Tr:null, TitleSpan:null, TextSpan:null, TitleTd:null, TextTd:null };
|
|
145468
|
+
|
|
145469
|
+
var trDom=document.createElement("tr");
|
|
145470
|
+
trDom.className='UMyChart_Tooltip_Float_Group_Tr';
|
|
145471
|
+
tbody.appendChild(trDom);
|
|
145472
|
+
rowItem.Tr=trDom;
|
|
145473
|
+
|
|
145474
|
+
var tdDom=document.createElement("td");
|
|
145475
|
+
tdDom.className="UMyChart_Tooltip_Float_Title_Td"; //标题
|
|
145476
|
+
trDom.appendChild(tdDom);
|
|
145477
|
+
rowItem.TitleTd=tdDom;
|
|
145478
|
+
|
|
145479
|
+
var spanDom=document.createElement("span");
|
|
145480
|
+
spanDom.className='UMyChart_Tooltip_Float_Title_Span';
|
|
145481
|
+
spanDom.innerText='标题';
|
|
145482
|
+
tdDom.appendChild(spanDom);
|
|
145483
|
+
rowItem.TitleSpan=spanDom;
|
|
145484
|
+
|
|
145485
|
+
var tdDom=document.createElement("td");
|
|
145486
|
+
tdDom.className="UMyChart_Tooltip_Float_Text_Td"; //数值
|
|
145487
|
+
trDom.appendChild(tdDom);
|
|
145488
|
+
rowItem.TextTd=tdDom;
|
|
145489
|
+
|
|
145490
|
+
var spanDom=document.createElement("span");
|
|
145491
|
+
spanDom.className='UMyChart_Tooltip_Float_Text_Span';
|
|
145492
|
+
spanDom.innerText='数值';
|
|
145493
|
+
tdDom.appendChild(spanDom);
|
|
145494
|
+
rowItem.TextSpan=spanDom;
|
|
145495
|
+
|
|
145496
|
+
this.AryData.push(rowItem);
|
|
145497
|
+
}
|
|
145498
|
+
|
|
145499
|
+
document.body.appendChild(divDom);
|
|
145500
|
+
|
|
145501
|
+
this.DivDialog=divDom;
|
|
145502
|
+
|
|
145503
|
+
this.UpdateStyle();
|
|
145504
|
+
}
|
|
145505
|
+
|
|
145506
|
+
this.IsShow=function()
|
|
145507
|
+
{
|
|
145508
|
+
if (!this.DivDialog) return false;
|
|
145509
|
+
|
|
145510
|
+
return this.DivDialog.style.visibility==='visible';
|
|
145511
|
+
}
|
|
145512
|
+
|
|
145513
|
+
//data={ Symbol, Date, Time} 是否是同一条K线
|
|
145514
|
+
this.IsEqualHQID=function(data)
|
|
145515
|
+
{
|
|
145516
|
+
if (!this.KItemCache) return false;
|
|
145517
|
+
if (!data) return false;
|
|
145518
|
+
if (!this.KItemCache.Item) return false;
|
|
145519
|
+
|
|
145520
|
+
var kItem=this.KItemCache.Item;
|
|
145521
|
+
if (this.KItemCache.Symbol!=data.Symbol) return false;
|
|
145522
|
+
if (kItem.Date!=data.Date) return false;
|
|
145523
|
+
if (IFrameSplitOperator.IsNumber(kItem.Time))
|
|
145524
|
+
{
|
|
145525
|
+
if (kItem.Time!=data.Time) return false;
|
|
145526
|
+
}
|
|
145527
|
+
|
|
145528
|
+
return true;
|
|
145529
|
+
}
|
|
145530
|
+
|
|
145531
|
+
this.UpdateStyle=function()
|
|
145532
|
+
{
|
|
145533
|
+
if (!this.DivDialog) return;
|
|
145534
|
+
|
|
145535
|
+
if (this.BGColor) this.DivDialog.style['background-color']=this.BGColor;
|
|
145536
|
+
if (this.BorderColor) this.DivDialog.style['border-color']=this.BorderColor;
|
|
145537
|
+
|
|
145538
|
+
//this.UpdateTableDOM();
|
|
145539
|
+
}
|
|
145540
|
+
|
|
145541
|
+
//更新数据
|
|
145542
|
+
this.Update=function(data)
|
|
145543
|
+
{
|
|
145544
|
+
if (!this.DivDialog) return;
|
|
145545
|
+
this.LanguageID=this.HQChart.LanguageID;
|
|
145546
|
+
|
|
145547
|
+
if (data.DataType==1)
|
|
145548
|
+
{
|
|
145549
|
+
var tooltipData=data.Tooltip;
|
|
145550
|
+
if (!tooltipData) return;
|
|
145551
|
+
|
|
145552
|
+
if (tooltipData.Type==0) //K线信息
|
|
145553
|
+
{
|
|
145554
|
+
this.UpdateKLineToolitp(data);
|
|
145555
|
+
}
|
|
145556
|
+
else if (tooltipData.Type==1) //信息地雷
|
|
145557
|
+
{
|
|
145558
|
+
this.UpdateKLineInfoTooltip(data);
|
|
145559
|
+
}
|
|
145560
|
+
}
|
|
145561
|
+
else if (data.DataType==2) //更新实时行情数据
|
|
145562
|
+
{
|
|
145563
|
+
this.UpdateRealtimeHQTooltip(data);
|
|
145564
|
+
}
|
|
145565
|
+
}
|
|
145566
|
+
|
|
145567
|
+
this.UpdateRealtimeHQTooltip=function(data)
|
|
145568
|
+
{
|
|
145569
|
+
if (!this.KItemCache) return;
|
|
145570
|
+
|
|
145571
|
+
var kItem={ Symbol:data.Symbol, Name:this.KItemCache.Name, Item:data.Data, IsOverlay:this.KItemCache.IsOverlay };
|
|
145572
|
+
var strKItem=JSON.stringify(kItem);
|
|
145573
|
+
|
|
145574
|
+
var bUpdata=false;
|
|
145575
|
+
if (this.KItemCacheID!=strKItem) //数据变动的才更新
|
|
145576
|
+
{
|
|
145577
|
+
this.KItemCache= kItem;
|
|
145578
|
+
this.KItemCacheID=strKItem;
|
|
145579
|
+
this.AryText=this.GetFormatKLineTooltipText(this.KItemCache);
|
|
145580
|
+
bUpdata=true;
|
|
145581
|
+
}
|
|
145582
|
+
|
|
145583
|
+
if (bUpdata)
|
|
145584
|
+
{
|
|
145585
|
+
this.UpdateTableDOM();
|
|
145586
|
+
}
|
|
145587
|
+
}
|
|
145588
|
+
|
|
145589
|
+
//K线提示信息
|
|
145590
|
+
this.UpdateKLineToolitp=function(data)
|
|
145591
|
+
{
|
|
145592
|
+
var tooltipData=data.Tooltip;
|
|
145593
|
+
var symbol=data.Symbol;
|
|
145594
|
+
var name=data.Name;
|
|
145595
|
+
var bOverlay=false; //是否是叠加指标
|
|
145596
|
+
if (tooltipData.ChartPaint.Name=="Overlay-KLine")
|
|
145597
|
+
{
|
|
145598
|
+
symbol=tooltipData.ChartPaint.Symbol;
|
|
145599
|
+
name=tooltipData.ChartPaint.Title;
|
|
145600
|
+
bOverlay=true;
|
|
145601
|
+
}
|
|
145602
|
+
|
|
145603
|
+
var kItem={ Symbol:symbol, Name:name, Item:CloneData(tooltipData.Data), IsOverlay:bOverlay };
|
|
145604
|
+
var strKItem=JSON.stringify(kItem);
|
|
145605
|
+
var bUpdata=false;
|
|
145606
|
+
if (this.KItemCacheID!=strKItem) //数据变动的才更新
|
|
145607
|
+
{
|
|
145608
|
+
this.KItemCache= kItem;
|
|
145609
|
+
this.KItemCacheID=strKItem;
|
|
145610
|
+
this.AryText=this.GetFormatKLineTooltipText(this.KItemCache);
|
|
145611
|
+
bUpdata=true;
|
|
145612
|
+
}
|
|
145613
|
+
|
|
145614
|
+
if (bUpdata)
|
|
145615
|
+
{
|
|
145616
|
+
this.UpdateTableDOM();
|
|
145617
|
+
}
|
|
145618
|
+
|
|
145619
|
+
if (data.Point)
|
|
145620
|
+
{
|
|
145621
|
+
var x=data.Point.X;
|
|
145622
|
+
var y=data.Point.Y+data.Point.YMove;
|
|
145623
|
+
this.Show(x, y);
|
|
145624
|
+
}
|
|
145625
|
+
}
|
|
145626
|
+
|
|
145627
|
+
this.UpdateTableDOM=function()
|
|
145628
|
+
{
|
|
145629
|
+
var index=0;
|
|
145630
|
+
for(index=0;index<this.AryText.length && index<this.MaxRowCount;++index)
|
|
145631
|
+
{
|
|
145632
|
+
var outItem=this.AryText[index];
|
|
145633
|
+
var item=this.AryData[index];
|
|
145634
|
+
|
|
145635
|
+
item.TitleSpan.innerText=outItem.Title;
|
|
145636
|
+
item.TitleSpan.style.color=this.TextColor;
|
|
145637
|
+
item.TextSpan.innerText=outItem.Text;
|
|
145638
|
+
item.TextSpan.style.color=outItem.Color;
|
|
145639
|
+
|
|
145640
|
+
if (outItem.ClassName)
|
|
145641
|
+
{
|
|
145642
|
+
item.TextSpan.className=outItem.ClassName;
|
|
145643
|
+
}
|
|
145644
|
+
else
|
|
145645
|
+
{
|
|
145646
|
+
if (item.TextSpan.className!=this.ValueAlign.Right) item.TextSpan.className=this.ValueAlign.Right;
|
|
145647
|
+
}
|
|
145648
|
+
|
|
145649
|
+
item.Tr.style.display="";
|
|
145650
|
+
if (item.Tr2) item.Tr2.style.display="";
|
|
145651
|
+
}
|
|
145652
|
+
|
|
145653
|
+
for( ; index<this.MaxRowCount; ++index)
|
|
145654
|
+
{
|
|
145655
|
+
var item=this.AryData[index];
|
|
145656
|
+
item.Tr.style.display="none";
|
|
145657
|
+
if (item.Tr2) item.Tr2.style.display="none";
|
|
145658
|
+
}
|
|
145659
|
+
}
|
|
145660
|
+
|
|
145661
|
+
|
|
145662
|
+
this.GetFormatKLineTooltipText=function(kItem)
|
|
145663
|
+
{
|
|
145664
|
+
var data=kItem.Item;
|
|
145665
|
+
var symbol=kItem.Symbol;
|
|
145666
|
+
var upperSymbol=symbol.toUpperCase();
|
|
145667
|
+
var defaultfloatPrecision=GetfloatPrecision(symbol);//价格小数位数
|
|
145668
|
+
|
|
145669
|
+
//日期
|
|
145670
|
+
var dateItem=this.ForamtDate(data.Date,"YYYY/MM/DD/W",'FloatTooltip-Date' );
|
|
145671
|
+
|
|
145672
|
+
//时间
|
|
145673
|
+
var timeItem=null;
|
|
145674
|
+
if (IFrameSplitOperator.IsNumber(data.Time)) timeItem=this.FormatTime(data.Time, this.HQChart.Period, null, 'FloatTooltip-Time');
|
|
145675
|
+
|
|
145676
|
+
var overlayItem=null;
|
|
145677
|
+
if (kItem.IsOverlay)
|
|
145678
|
+
overlayItem={ Title:"", Text:kItem.Name, Color:this.TextColor, ClassName:this.ValueAlign.Left };
|
|
145679
|
+
|
|
145680
|
+
|
|
145681
|
+
var yClose=data.YClose; //昨收价|昨结算价
|
|
145682
|
+
var aryText=
|
|
145683
|
+
[
|
|
145684
|
+
this.ForamtPrice(data.Open,yClose, defaultfloatPrecision,'FloatTooltip-Open'),
|
|
145685
|
+
this.ForamtPrice(data.High,yClose, defaultfloatPrecision,'FloatTooltip-High'),
|
|
145686
|
+
this.ForamtPrice(data.Low,yClose, defaultfloatPrecision,'FloatTooltip-Low'),
|
|
145687
|
+
this.ForamtPrice(data.Close,yClose, defaultfloatPrecision,'FloatTooltip-Close'),
|
|
145688
|
+
this.ForamtPrice(data.YClose,data.YClose, defaultfloatPrecision,'FloatTooltip-YClose'),
|
|
145689
|
+
this.FormatVol(data.Vol,'FloatTooltip-Vol' ),
|
|
145690
|
+
this.FormatAmount(data.Amount,'FloatTooltip-Amount' ),
|
|
145691
|
+
this.FormatIncrease(data.Close,yClose,defaultfloatPrecision,'FloatTooltip-Increase'),
|
|
145692
|
+
this.FormatAmplitude(data.High,data.Low,yClose,defaultfloatPrecision,'FloatTooltip-Amplitude'),
|
|
145693
|
+
];
|
|
145694
|
+
|
|
145695
|
+
if (timeItem) aryText.unshift(timeItem);
|
|
145696
|
+
aryText.unshift(dateItem);
|
|
145697
|
+
if (overlayItem) aryText.unshift(overlayItem);
|
|
145698
|
+
|
|
145699
|
+
//换手率
|
|
145700
|
+
if (MARKET_SUFFIX_NAME.IsSHSZStockA(upperSymbol) && data.FlowCapital>0)
|
|
145701
|
+
{
|
|
145702
|
+
aryText.push(this.FormatExchange(data.Vol,data.FlowCapital,'FloatTooltip-Exchange' ));
|
|
145703
|
+
}
|
|
145704
|
+
|
|
145705
|
+
//持仓量 结算价
|
|
145706
|
+
if (MARKET_SUFFIX_NAME.IsFutures(upperSymbol))
|
|
145707
|
+
{
|
|
145708
|
+
aryText.push(this.FormatPosition(data.Position,'FloatTooltip-Position'));
|
|
145709
|
+
aryText.push(this.ForamtFClose(data.FClose, defaultfloatPrecision, 'FloatTooltip-FClose'));
|
|
145710
|
+
aryText.push(this.ForamtFClose(data.YFClose, defaultfloatPrecision, 'FloatTooltip-YSettlePrice'));
|
|
145711
|
+
|
|
145712
|
+
}
|
|
145713
|
+
|
|
145714
|
+
var event=this.HQChart.GetEventCallback(JSCHART_EVENT_ID.ON_FORMAT_KLINE_FLOAT_TOOLTIP);
|
|
145715
|
+
if (event && event.Callback)
|
|
145716
|
+
{
|
|
145717
|
+
var sendData={ AryText:aryText, Data:kItem, HQChart:this.HQChart };
|
|
145718
|
+
event.Callback(event, sendData, this);
|
|
145719
|
+
}
|
|
145720
|
+
|
|
145721
|
+
return aryText;
|
|
145722
|
+
}
|
|
145723
|
+
|
|
145724
|
+
|
|
145725
|
+
//信息地雷
|
|
145726
|
+
this.UpdateKLineInfoTooltip=function(data)
|
|
145727
|
+
{
|
|
145728
|
+
var tooltipData=data.Tooltip;
|
|
145729
|
+
var symbol=data.Symbol;
|
|
145730
|
+
var defaultfloatPrecision=GetfloatPrecision(symbol);//价格小数位数
|
|
145731
|
+
|
|
145732
|
+
var aryData=tooltipData.Data.Data;
|
|
145733
|
+
var aryText=[]; //输出内容
|
|
145734
|
+
for(var i=0;i<aryData.length;++i)
|
|
145735
|
+
{
|
|
145736
|
+
var item=aryData[i];
|
|
145737
|
+
var infoType=item.InfoType;
|
|
145738
|
+
switch(infoType)
|
|
145739
|
+
{
|
|
145740
|
+
case KLINE_INFO_TYPE.BLOCKTRADING:
|
|
145741
|
+
this.FormatBlockTradingText(item, defaultfloatPrecision, aryText);
|
|
145742
|
+
break;
|
|
145743
|
+
case KLINE_INFO_TYPE.TRADEDETAIL:
|
|
145744
|
+
this.FormatTradeDetailText(item,defaultfloatPrecision,aryText);
|
|
145745
|
+
break;
|
|
145746
|
+
case KLINE_INFO_TYPE.RESEARCH:
|
|
145747
|
+
this.FormatResearchText(item, aryText);
|
|
145748
|
+
break;
|
|
145749
|
+
case KLINE_INFO_TYPE.PFORECAST:
|
|
145750
|
+
this.FormatPerformanceForecastText(item,aryText);
|
|
145751
|
+
break;
|
|
145752
|
+
default:
|
|
145753
|
+
this.FormatDefaultKLineInfoText(item, aryText);
|
|
145754
|
+
break;
|
|
145755
|
+
}
|
|
145756
|
+
}
|
|
145757
|
+
|
|
145758
|
+
this.AryText=aryText;
|
|
145759
|
+
|
|
145760
|
+
this.UpdateTableDOM();
|
|
145761
|
+
|
|
145762
|
+
if (data.Point)
|
|
145763
|
+
{
|
|
145764
|
+
var x=data.Point.X;
|
|
145765
|
+
var y=data.Point.Y+data.Point.YMove;
|
|
145766
|
+
this.Show(x, y);
|
|
145767
|
+
}
|
|
145768
|
+
}
|
|
145769
|
+
|
|
145770
|
+
|
|
145771
|
+
/////////////////////////////////////////////////////////////////////////////////////////////
|
|
145772
|
+
// 公告数据格式化
|
|
145773
|
+
|
|
145774
|
+
this.FormatDefaultKLineInfoText=function(item, aryOut)
|
|
145775
|
+
{
|
|
145776
|
+
var title;
|
|
145777
|
+
var strDate=IFrameSplitOperator.FormatDateString(item.Date,"YYYY-MM-DD");
|
|
145778
|
+
if (IFrameSplitOperator.IsNumber(item.Time))
|
|
145779
|
+
{
|
|
145780
|
+
var strTime=IFrameSplitOperator.FormatTimeString(item.Time);
|
|
145781
|
+
title=`${strDate} ${strTime}`;
|
|
145782
|
+
}
|
|
145783
|
+
else
|
|
145784
|
+
{
|
|
145785
|
+
title=strDate;
|
|
145786
|
+
}
|
|
145787
|
+
|
|
145788
|
+
var item=
|
|
145789
|
+
{
|
|
145790
|
+
Title:title, //日期
|
|
145791
|
+
Text:item.Title, //标题
|
|
145792
|
+
Color:this.ValueColor,
|
|
145793
|
+
ClassName:this.ValueAlign.MarginLeft
|
|
145794
|
+
};
|
|
145795
|
+
|
|
145796
|
+
aryOut.push(item);
|
|
145797
|
+
}
|
|
145798
|
+
|
|
145799
|
+
//大宗交易
|
|
145800
|
+
this.FormatBlockTradingText=function(data, floatPrecision, aryOut)
|
|
145801
|
+
{
|
|
145802
|
+
var item={ Title:"", Text:"大宗交易", Color:this.TextColor, ClassName:this.ValueAlign.Left };
|
|
145803
|
+
aryOut.push(item);
|
|
145804
|
+
|
|
145805
|
+
var item={ Title:"日期",Text:IFrameSplitOperator.FormatDateString(data.Date,"YYYY-MM-DD"), Color:this.ValueColor };
|
|
145806
|
+
aryOut.push(item);
|
|
145807
|
+
|
|
145808
|
+
var extendata = data.ExtendData;
|
|
145809
|
+
var item={ Title:"成交价:", Text:extendata.Price.toFixed(floatPrecision), Color:this.ValueColor };
|
|
145810
|
+
aryOut.push(item);
|
|
145811
|
+
|
|
145812
|
+
var item={ Title:"收盘价:", Text:extendata.ClosePrice.toFixed(floatPrecision), Color:this.ValueColor };
|
|
145813
|
+
aryOut.push(item);
|
|
145814
|
+
|
|
145815
|
+
var item={ Title:"溢折价率:", Text:extendata.Premium.toFixed(2), Color:this.GetColor(extendata.Premium,0) };
|
|
145816
|
+
aryOut.push(item);
|
|
145817
|
+
|
|
145818
|
+
var item={ Title:"成交量:", Text:IFrameSplitOperator.FormatValueStringV2(extendata.Vol,0,2,this.LanguageID), Color:this.VolColor };
|
|
145819
|
+
aryOut.push(item);
|
|
145820
|
+
}
|
|
145821
|
+
|
|
145822
|
+
//龙虎榜
|
|
145823
|
+
this.FormatTradeDetailText=function(data, floatPrecision, aryOut)
|
|
145824
|
+
{
|
|
145825
|
+
if (!data.ExtendData) return;
|
|
145826
|
+
var extendata = data.ExtendData;
|
|
145827
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(extendata.Detail)) return;
|
|
145828
|
+
|
|
145829
|
+
var item={ Title:"日期",Text:IFrameSplitOperator.FormatDateString(data.Date,"YYYY-MM-DD"), Color:this.ValueColor, ClassName:this.ValueAlign.MarginLeft };
|
|
145830
|
+
aryOut.push(item);
|
|
145831
|
+
|
|
145832
|
+
for(var i=0;i<extendata.Detail.length;++i)
|
|
145833
|
+
{
|
|
145834
|
+
var resItem=extendata.Detail[i];
|
|
145835
|
+
if (i==0)
|
|
145836
|
+
var item={ Title:"上榜原因:",Text:resItem.TypeExplain, Color:this.ValueColor, ClassName:this.ValueAlign.MarginLeft };
|
|
145837
|
+
else
|
|
145838
|
+
var item={ Title:"",Text:resItem.TypeExplain, Color:this.ValueColor, ClassName:this.ValueAlign.MarginLeft };
|
|
145839
|
+
|
|
145840
|
+
aryOut.push(item);
|
|
145841
|
+
}
|
|
145842
|
+
|
|
145843
|
+
if (extendata.FWeek)
|
|
145844
|
+
{
|
|
145845
|
+
var value=extendata.FWeek.Week1;
|
|
145846
|
+
if (IFrameSplitOperator.IsNumber(value))
|
|
145847
|
+
{
|
|
145848
|
+
var item={ Title:"一周后涨幅:",Text:`${value.toFixed(2)}%`, Color:this.GetColor(value,0), ClassName:this.ValueAlign.MarginLeft };
|
|
145849
|
+
aryOut.push(item);
|
|
145850
|
+
}
|
|
145851
|
+
|
|
145852
|
+
var value=extendata.FWeek.Week4;
|
|
145853
|
+
if (IFrameSplitOperator.IsNumber(value))
|
|
145854
|
+
{
|
|
145855
|
+
var item={ Title:"四周后涨幅:",Text:`${value.toFixed(2)}%`, Color:this.GetColor(value,0), ClassName:this.ValueAlign.MarginLeft };
|
|
145856
|
+
aryOut.push(item);
|
|
145857
|
+
}
|
|
145858
|
+
}
|
|
145859
|
+
}
|
|
145860
|
+
|
|
145861
|
+
//调研
|
|
145862
|
+
this.FormatResearchText=function(data,aryOut)
|
|
145863
|
+
{
|
|
145864
|
+
if (!data.ExtendData) return;
|
|
145865
|
+
var extendata = data.ExtendData;
|
|
145866
|
+
|
|
145867
|
+
var item={ Title:"日期",Text:IFrameSplitOperator.FormatDateString(data.Date,"YYYY-MM-DD"), Color:this.ValueColor, ClassName:this.ValueAlign.MarginLeft };
|
|
145868
|
+
aryOut.push(item);
|
|
145869
|
+
|
|
145870
|
+
if (IFrameSplitOperator.IsNonEmptyArray(extendata.Level))
|
|
145871
|
+
{
|
|
145872
|
+
var strLevel="";
|
|
145873
|
+
for(var i=0;i<extendata.Level.length;++i)
|
|
145874
|
+
{
|
|
145875
|
+
var value=extendata.Level[i];
|
|
145876
|
+
if (strLevel.length>0) strLevel+=",";
|
|
145877
|
+
if(value==0) strLevel+="证券代表";
|
|
145878
|
+
else if(value==1) strLevel+="董秘";
|
|
145879
|
+
else if(value==2) strLevel+="总经理";
|
|
145880
|
+
else if(value==3) strLevel+="董事长";
|
|
145881
|
+
}
|
|
145882
|
+
|
|
145883
|
+
var item={ Title:"接待人员:",Text:strLevel, Color:this.ValueColor, ClassName:this.ValueAlign.MarginLeft };
|
|
145884
|
+
aryOut.push(item);
|
|
145885
|
+
}
|
|
145886
|
+
else
|
|
145887
|
+
{
|
|
145888
|
+
var item={ Title:"接待人员",Text:"----", Color:this.ValueColor, ClassName:this.ValueAlign.MarginLeft };
|
|
145889
|
+
aryOut.push(item);
|
|
145890
|
+
}
|
|
145891
|
+
|
|
145892
|
+
if (extendata.Type)
|
|
145893
|
+
{
|
|
145894
|
+
var item={ Title:"", Text:extendata.Type, Color:this.ValueColor, ClassName:this.ValueAlign.MarginLeft };
|
|
145895
|
+
aryOut.push(item);
|
|
145896
|
+
}
|
|
145897
|
+
|
|
145898
|
+
}
|
|
145899
|
+
|
|
145900
|
+
//业绩预告
|
|
145901
|
+
this.FormatPerformanceForecastText=function(data,aryOut)
|
|
145902
|
+
{
|
|
145903
|
+
if (!data.ExtendData) return;
|
|
145904
|
+
var extendata = data.ExtendData;
|
|
145905
|
+
var reportDate=extendata.ReportDate;
|
|
145906
|
+
if (!reportDate) return;
|
|
145907
|
+
|
|
145908
|
+
var year=parseInt(reportDate/10000); //年份
|
|
145909
|
+
var day=reportDate%10000; //日期
|
|
145910
|
+
var reportType="----";
|
|
145911
|
+
if(day == 1231) reportType = '年报';
|
|
145912
|
+
else if(day == 331) reportType ='一季度报';
|
|
145913
|
+
else if(day == 630) reportType = "半年度报";
|
|
145914
|
+
else if(day == 930) reportType = "三季度报";
|
|
145915
|
+
|
|
145916
|
+
var item={ Title:"业绩预告:",Text:data.Title, Color:this.ValueColor, ClassName:this.ValueAlign.MarginLeft };
|
|
145917
|
+
aryOut.push(item);
|
|
145918
|
+
|
|
145919
|
+
var item={ Title:"年份:",Text:`${year}`, Color:this.ValueColor, ClassName:this.ValueAlign.MarginLeft };
|
|
145920
|
+
aryOut.push(item);
|
|
145921
|
+
|
|
145922
|
+
var item={ Title:"类型:",Text:reportType, Color:this.ValueColor, ClassName:this.ValueAlign.MarginLeft };
|
|
145923
|
+
aryOut.push(item);
|
|
145924
|
+
}
|
|
145925
|
+
|
|
145926
|
+
|
|
145927
|
+
/////////////////////////////////////////////////////////////////////////////////////////////
|
|
145928
|
+
//数据格式化
|
|
145929
|
+
this.ForamtPrice=function(price, yClose, defaultfloatPrecision, TitleID)
|
|
145930
|
+
{
|
|
145931
|
+
var item=
|
|
145932
|
+
{
|
|
145933
|
+
Title:g_JSChartLocalization.GetText(TitleID, this.LanguageID),
|
|
145934
|
+
Text:"--.--",
|
|
145935
|
+
Color:this.ValueColor
|
|
145936
|
+
};
|
|
145937
|
+
|
|
145938
|
+
if (!IFrameSplitOperator.IsNumber(price)) return item;
|
|
145939
|
+
|
|
145940
|
+
item.Text=price.toFixed(defaultfloatPrecision);
|
|
145941
|
+
item.Color=this.GetColor(price, yClose);
|
|
145942
|
+
|
|
145943
|
+
return item;
|
|
145944
|
+
}
|
|
145945
|
+
|
|
145946
|
+
this.ForamtValue=function(value, defaultfloatPrecision, TitleID)
|
|
145947
|
+
{
|
|
145948
|
+
var item=
|
|
145949
|
+
{
|
|
145950
|
+
Title:g_JSChartLocalization.GetText(TitleID,this.LanguageID),
|
|
145951
|
+
Text:'--',
|
|
145952
|
+
Color:this.ValueColor
|
|
145953
|
+
};
|
|
145954
|
+
|
|
145955
|
+
if (!IFrameSplitOperator.IsNumber(value)) return item;
|
|
145956
|
+
|
|
145957
|
+
item.Text=IFrameSplitOperator.FormatValueStringV2(value,defaultfloatPrecision,2,this.LanguageID);
|
|
145958
|
+
return item;
|
|
145959
|
+
}
|
|
145960
|
+
|
|
145961
|
+
this.FormatVol=function(vol, TitleID)
|
|
145962
|
+
{
|
|
145963
|
+
var item=
|
|
145964
|
+
{
|
|
145965
|
+
Title:g_JSChartLocalization.GetText(TitleID,this.LanguageID),
|
|
145966
|
+
Text:'--',
|
|
145967
|
+
Color:this.VolColor
|
|
145968
|
+
};
|
|
145969
|
+
|
|
145970
|
+
if (!IFrameSplitOperator.IsNumber(vol)) return item;
|
|
145971
|
+
|
|
145972
|
+
item.Text=IFrameSplitOperator.FormatValueStringV2(vol,0,2,this.LanguageID);
|
|
145973
|
+
|
|
145974
|
+
return item;
|
|
145975
|
+
}
|
|
145976
|
+
|
|
145977
|
+
this.FormatAmount=function(amount, TitleID)
|
|
145978
|
+
{
|
|
145979
|
+
var item=
|
|
145980
|
+
{
|
|
145981
|
+
Title:g_JSChartLocalization.GetText(TitleID,this.LanguageID),
|
|
145982
|
+
Text:'--',
|
|
145983
|
+
Color:this.AmountColor
|
|
145984
|
+
};
|
|
145985
|
+
|
|
145986
|
+
if (!IFrameSplitOperator.IsNumber(amount)) return item;
|
|
145987
|
+
|
|
145988
|
+
item.Text=IFrameSplitOperator.FormatValueString(amount,2,this.LanguageID);
|
|
145989
|
+
|
|
145990
|
+
return item;
|
|
145991
|
+
}
|
|
145992
|
+
|
|
145993
|
+
this.FormatIncrease=function(price, yClose, defaultfloatPrecision, TitleID)
|
|
145994
|
+
{
|
|
145995
|
+
//涨幅
|
|
145996
|
+
var item=
|
|
145997
|
+
{
|
|
145998
|
+
Title:g_JSChartLocalization.GetText(TitleID,this.LanguageID),
|
|
145999
|
+
Text:"--.--",
|
|
146000
|
+
Color:this.ValueColor
|
|
146001
|
+
};
|
|
146002
|
+
|
|
146003
|
+
if (!IFrameSplitOperator.IsNumber(price) || !IFrameSplitOperator.IsNumber(yClose)) return item;
|
|
146004
|
+
|
|
146005
|
+
var diffValue=price-yClose;
|
|
146006
|
+
var value=(price-yClose)/yClose;
|
|
146007
|
+
|
|
146008
|
+
item.Text=`${(value*100).toFixed(2)}%`;
|
|
146009
|
+
item.Color=this.GetColor(value,0);
|
|
146010
|
+
|
|
146011
|
+
return item;
|
|
146012
|
+
}
|
|
146013
|
+
|
|
146014
|
+
this.FormatRisefall=function(price, yClose, defaultfloatPrecision, TitleID)
|
|
146015
|
+
{
|
|
146016
|
+
//涨跌
|
|
146017
|
+
var item=
|
|
146018
|
+
{
|
|
146019
|
+
Title:g_JSChartLocalization.GetText(TitleID,this.LanguageID),
|
|
146020
|
+
Text:"--.--",
|
|
146021
|
+
Color:this.ValueColor
|
|
146022
|
+
};
|
|
146023
|
+
|
|
146024
|
+
if (!IFrameSplitOperator.IsNumber(price) || !IFrameSplitOperator.IsNumber(yClose)) return item;
|
|
146025
|
+
|
|
146026
|
+
var value=price-yClose;
|
|
146027
|
+
item.Text=`${value.toFixed(defaultfloatPrecision)}`;
|
|
146028
|
+
item.Color=this.GetColor(value,0);
|
|
146029
|
+
|
|
146030
|
+
return item;
|
|
146031
|
+
}
|
|
146032
|
+
|
|
146033
|
+
this.FormatAmplitude=function(high, low, yClose, defaultfloatPrecision, TitleID)
|
|
146034
|
+
{
|
|
146035
|
+
//振幅
|
|
146036
|
+
var item=
|
|
146037
|
+
{
|
|
146038
|
+
Title:g_JSChartLocalization.GetText(TitleID,this.LanguageID),
|
|
146039
|
+
Text:"--.--",
|
|
146040
|
+
Color:this.ValueColor
|
|
146041
|
+
};
|
|
146042
|
+
|
|
146043
|
+
|
|
146044
|
+
if (!IFrameSplitOperator.IsNumber(high) || !IFrameSplitOperator.IsNumber(low) || !IFrameSplitOperator.IsNumber(yClose)) return item;
|
|
146045
|
+
|
|
146046
|
+
var diffValue=high-low;
|
|
146047
|
+
var value=(diffValue)/yClose;
|
|
146048
|
+
item.Text=`${(value*100).toFixed(2)}%`;
|
|
146049
|
+
item.Color=this.GetColor(value,0);
|
|
146050
|
+
|
|
146051
|
+
return item;
|
|
146052
|
+
}
|
|
146053
|
+
|
|
146054
|
+
this.ForamtDate=function(date, format, TitleID)
|
|
146055
|
+
{
|
|
146056
|
+
//日期
|
|
146057
|
+
var item=
|
|
146058
|
+
{
|
|
146059
|
+
Title:g_JSChartLocalization.GetText('DialogTooltip-Date',this.LanguageID),
|
|
146060
|
+
Text:"----/--/--",
|
|
146061
|
+
Color:this.DateTimeColor
|
|
146062
|
+
}
|
|
146063
|
+
|
|
146064
|
+
if (!IFrameSplitOperator.IsNumber(date)) return item;
|
|
146065
|
+
|
|
146066
|
+
item.Text=IFrameSplitOperator.FormatDateString(date,format);
|
|
146067
|
+
|
|
146068
|
+
return item;
|
|
146069
|
+
}
|
|
146070
|
+
|
|
146071
|
+
this.FormatTime=function(time, period, format, TitleID)
|
|
146072
|
+
{
|
|
146073
|
+
//时间
|
|
146074
|
+
var item=
|
|
146075
|
+
{
|
|
146076
|
+
Title:g_JSChartLocalization.GetText(TitleID,this.LanguageID),
|
|
146077
|
+
Text:'--:--',
|
|
146078
|
+
Color:this.DateTimeColor
|
|
146079
|
+
};
|
|
146080
|
+
|
|
146081
|
+
if (!IFrameSplitOperator.IsNumber(time)) return item;
|
|
146082
|
+
if (!format)
|
|
146083
|
+
{
|
|
146084
|
+
format="HH:MM";
|
|
146085
|
+
if (ChartData.IsMinutePeriod(period,true)) format='HH:MM'; // 分钟周期
|
|
146086
|
+
else if (ChartData.IsSecondPeriod(period)) format='HH:MM:SS';
|
|
146087
|
+
else if (ChartData.IsMilliSecondPeriod(period)) format='HH:MM:SS.fff';
|
|
146088
|
+
}
|
|
146089
|
+
|
|
146090
|
+
item.Text=IFrameSplitOperator.FormatTimeString(time,format);
|
|
146091
|
+
|
|
146092
|
+
return item;
|
|
146093
|
+
}
|
|
146094
|
+
|
|
146095
|
+
//换手率 成交量/流通股本
|
|
146096
|
+
this.FormatExchange=function(vol, flowCapital, TitleID)
|
|
146097
|
+
{
|
|
146098
|
+
//换手率
|
|
146099
|
+
var item=
|
|
146100
|
+
{
|
|
146101
|
+
Title:g_JSChartLocalization.GetText(TitleID,this.LanguageID),
|
|
146102
|
+
Text:'--.--',
|
|
146103
|
+
Color:this.DateTimeColor
|
|
146104
|
+
};
|
|
146105
|
+
|
|
146106
|
+
if (!IFrameSplitOperator.IsNumber(vol) || !IFrameSplitOperator.IsNumber(flowCapital) || flowCapital==0) return item;
|
|
146107
|
+
|
|
146108
|
+
var value=vol/flowCapital*100;
|
|
146109
|
+
item.Text=value.toFixed(2)+'%';
|
|
146110
|
+
|
|
146111
|
+
return item;
|
|
146112
|
+
}
|
|
146113
|
+
|
|
146114
|
+
|
|
146115
|
+
//持仓
|
|
146116
|
+
this.FormatPosition=function(position, TitleID)
|
|
146117
|
+
{
|
|
146118
|
+
//持仓
|
|
146119
|
+
var item=
|
|
146120
|
+
{
|
|
146121
|
+
Title:g_JSChartLocalization.GetText(TitleID,this.LanguageID),
|
|
146122
|
+
Text:'--.--',
|
|
146123
|
+
Color:this.PositionColor
|
|
146124
|
+
};
|
|
146125
|
+
|
|
146126
|
+
if (!IFrameSplitOperator.IsNumber(position)) return item;
|
|
146127
|
+
|
|
146128
|
+
item.Text=position.toFixed(0);
|
|
146129
|
+
|
|
146130
|
+
return item;
|
|
146131
|
+
}
|
|
146132
|
+
|
|
146133
|
+
//结算价
|
|
146134
|
+
this.ForamtFClose=function(value, defaultfloatPrecision, TitleID)
|
|
146135
|
+
{
|
|
146136
|
+
var item=
|
|
146137
|
+
{
|
|
146138
|
+
Title:g_JSChartLocalization.GetText(TitleID,this.LanguageID),
|
|
146139
|
+
Text:'--.--',
|
|
146140
|
+
Color:this.DateTimeColor
|
|
146141
|
+
};
|
|
146142
|
+
|
|
146143
|
+
if (!IFrameSplitOperator.IsNumber(value)) return item;
|
|
146144
|
+
|
|
146145
|
+
item.Text=value.toFixed(defaultfloatPrecision);
|
|
146146
|
+
|
|
146147
|
+
return item;
|
|
146148
|
+
}
|
|
146149
|
+
|
|
146150
|
+
this.GetColor=function(price,yClose)
|
|
146151
|
+
{
|
|
146152
|
+
if(price>yClose) return this.UpColor;
|
|
146153
|
+
else if (price<yClose) return this.DownColor;
|
|
146154
|
+
else return this.UnchangeColor;
|
|
146155
|
+
}
|
|
146156
|
+
|
|
146157
|
+
|
|
146158
|
+
//配色修改
|
|
146159
|
+
this.ReloadResource=function(option)
|
|
146160
|
+
{
|
|
146161
|
+
this.UpColor=g_JSChartResource.UpTextColor;
|
|
146162
|
+
this.DownColor=g_JSChartResource.DownTextColor;
|
|
146163
|
+
this.UnchangeColor=g_JSChartResource.UnchagneTextColor;
|
|
146164
|
+
|
|
146165
|
+
this.BGColor=g_JSChartResource.FloatTooltip.BGColor;
|
|
146166
|
+
this.BorderColor=g_JSChartResource.FloatTooltip.BorderColor;
|
|
146167
|
+
|
|
146168
|
+
this.TextColor=g_JSChartResource.FloatTooltip.TextColor;
|
|
146169
|
+
this.ValueColor=g_JSChartResource.FloatTooltip.ValueColor;
|
|
146170
|
+
|
|
146171
|
+
this.VolColor=g_JSChartResource.FloatTooltip.VolColor;
|
|
146172
|
+
this.AmountColor=g_JSChartResource.FloatTooltip.AmountColor;
|
|
146173
|
+
this.TurnoverRateColor=g_JSChartResource.FloatTooltip.TurnoverRateColor;
|
|
146174
|
+
this.PositionColor=g_JSChartResource.FloatTooltip.PositionColor;
|
|
146175
|
+
this.DateTimeColor=g_JSChartResource.FloatTooltip.DateTimeColor;
|
|
146176
|
+
|
|
146177
|
+
if (!this.DivDialog) return;
|
|
146178
|
+
|
|
146179
|
+
this.UpdateStyle();
|
|
146180
|
+
}
|
|
146181
|
+
}
|
|
145047
146182
|
/*
|
|
145048
146183
|
Copyright (c) 2018 jones
|
|
145049
146184
|
|
|
@@ -146029,7 +147164,7 @@ function HQChartScriptWorker()
|
|
|
146029
147164
|
|
|
146030
147165
|
|
|
146031
147166
|
|
|
146032
|
-
var HQCHART_VERSION="1.1.
|
|
147167
|
+
var HQCHART_VERSION="1.1.14055";
|
|
146033
147168
|
|
|
146034
147169
|
function PrintHQChartVersion()
|
|
146035
147170
|
{
|