hqchart 1.1.14045 → 1.1.14050
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 +98 -27
- package/package.json +1 -1
- package/src/jscommon/umychart.DialogTooltip.js +727 -5
- package/src/jscommon/umychart.js +189 -8
- package/src/jscommon/umychart.resource/css/tools.css +73 -0
- package/src/jscommon/umychart.style.js +15 -0
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +205 -9
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.vue.js +932 -14
|
@@ -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;
|
|
@@ -11172,6 +11223,9 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
11172
11223
|
this.Tooltip.innerHTML=format.Text;
|
|
11173
11224
|
this.Tooltip.style.display = "block";
|
|
11174
11225
|
}
|
|
11226
|
+
|
|
11227
|
+
|
|
11228
|
+
if (bHideFloatToolip) this.HideFloatTooltip();
|
|
11175
11229
|
}
|
|
11176
11230
|
|
|
11177
11231
|
this.UpdateDOMTooltip=function(toolTipType, data)
|
|
@@ -11208,6 +11262,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
11208
11262
|
this.TooltipCache.Data=null;
|
|
11209
11263
|
|
|
11210
11264
|
if (this.Tooltip.style.display!="none") this.Tooltip.style.display = "none";
|
|
11265
|
+
|
|
11266
|
+
this.HideFloatTooltip();
|
|
11211
11267
|
}
|
|
11212
11268
|
|
|
11213
11269
|
this.UpdateSelectRect=function(start,end)
|
|
@@ -12073,6 +12129,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
12073
12129
|
|
|
12074
12130
|
if (this.PopMinuteChart) this.PopMinuteChart.ReloadResource(option);
|
|
12075
12131
|
if (this.DialogTooltip) this.DialogTooltip.ReloadResource(option);
|
|
12132
|
+
if (this.FloatTooltip) this.FloatTooltip.ReloadResource(option);
|
|
12076
12133
|
if (this.DialogSelectRect) this.DialogSelectRect.ReloadResource(option);
|
|
12077
12134
|
}
|
|
12078
12135
|
|
|
@@ -14415,6 +14472,8 @@ function CoordinateInfo()
|
|
|
14415
14472
|
this.ExtendData; //扩展属性
|
|
14416
14473
|
//百分比 { PriceColor:, PercentageColor:, SplitColor:, Font: }
|
|
14417
14474
|
//自定义刻度 { Custom:{ Position: 1=强制内部 }}
|
|
14475
|
+
//输出位置的Y轴偏移
|
|
14476
|
+
//this.YOffset;
|
|
14418
14477
|
this.AreaData; //区域: { Start:, End:, BGColor:, Position:[0=左, 1=右] }
|
|
14419
14478
|
|
|
14420
14479
|
//不在当前屏范围 (可定义刻度使用)
|
|
@@ -73245,8 +73304,20 @@ function JSChartResource()
|
|
|
73245
73304
|
|
|
73246
73305
|
TextColor:"rgb(0,0,0)", //数值名称
|
|
73247
73306
|
ValueColor:"rgb(0,0,0)", //数值
|
|
73307
|
+
};
|
|
73248
73308
|
|
|
73249
|
-
|
|
73309
|
+
this.FloatTooltip=
|
|
73310
|
+
{
|
|
73311
|
+
BGColor:'rgb(250,250,250)', //背景色
|
|
73312
|
+
BorderColor:'rgb(20,20,20)', //边框颜色
|
|
73313
|
+
VolColor:"rgb(255, 185, 15)", //标题成交量
|
|
73314
|
+
AmountColor:"rgb(79, 79, 79)", //成交金额
|
|
73315
|
+
DateTimeColor:'rgb(60,60,60)',
|
|
73316
|
+
TurnoverRateColor:'rgb(43,54,69)', //换手率
|
|
73317
|
+
PositionColor:"rgb(255,0,255)", //持仓
|
|
73318
|
+
|
|
73319
|
+
TextColor:"rgb(0,0,0)", //数值名称
|
|
73320
|
+
ValueColor:"rgb(0,0,0)", //数值
|
|
73250
73321
|
};
|
|
73251
73322
|
|
|
73252
73323
|
//区间统计
|
|
@@ -74295,6 +74366,22 @@ function JSChartResource()
|
|
|
74295
74366
|
if (item.ValueColor) this.DialogTooltip.ValueColor=item.ValueColor;
|
|
74296
74367
|
}
|
|
74297
74368
|
|
|
74369
|
+
if (style.FloatTooltip)
|
|
74370
|
+
{
|
|
74371
|
+
var item=style.FloatTooltip;
|
|
74372
|
+
if (item.BGColor) this.FloatTooltip.BGColor=item.BGColor;
|
|
74373
|
+
if (item.BorderColor) this.FloatTooltip.BorderColor=item.BorderColor;
|
|
74374
|
+
|
|
74375
|
+
if (item.DateTimeColor) this.FloatTooltip.DateTimeColor=item.DateTimeColor;
|
|
74376
|
+
if (item.VolColor) this.FloatTooltip.VolColor=item.VolColor;
|
|
74377
|
+
if (item.AmountColor) this.FloatTooltip.AmountColor=item.AmountColor;
|
|
74378
|
+
if (item.TurnoverRateColor) this.FloatTooltip.TurnoverRateColor=item.TurnoverRateColor;
|
|
74379
|
+
if (item.PositionColor) this.FloatTooltip.PositionColor=item.PositionColor;
|
|
74380
|
+
|
|
74381
|
+
if (item.TextColor) this.FloatTooltip.TextColor=item.TextColor;
|
|
74382
|
+
if (item.ValueColor) this.FloatTooltip.ValueColor=item.ValueColor;
|
|
74383
|
+
}
|
|
74384
|
+
|
|
74298
74385
|
if (style.DialogSelectRect)
|
|
74299
74386
|
{
|
|
74300
74387
|
var item=style.DialogSelectRect;
|
|
@@ -75397,7 +75484,26 @@ function JSChartLocalization()
|
|
|
75397
75484
|
['DialogTooltip-AC-Vol', {CN:'匹配量', EN:'Vol', TC:'匹配量'}],
|
|
75398
75485
|
['DialogTooltip-Value', {CN:'数值', EN:'Value', TC:'数值'}],
|
|
75399
75486
|
|
|
75487
|
+
['FloatTooltip-Date', {CN:'日期', EN:'Date', TC:'日期'}],
|
|
75488
|
+
['FloatTooltip-Time', {CN:'时间', EN:'Time', TC:'時間'}],
|
|
75489
|
+
['FloatTooltip-Open', {CN:'开盘价', EN:'Open', TC:'開盤價'}],
|
|
75490
|
+
['FloatTooltip-High', {CN:'最高价', EN:'High', TC:'最高價'}],
|
|
75491
|
+
['FloatTooltip-Low', {CN:'最低价', EN:'Low', TC:'最低價'}],
|
|
75492
|
+
['FloatTooltip-Close', {CN:'收盘价', EN:'Close', TC:'收盤價'}],
|
|
75493
|
+
['FloatTooltip-YClose', {CN:'昨收价', EN:'YClose', TC:'昨收價'}],
|
|
75494
|
+
['FloatTooltip-Increase', {CN:'涨幅', EN:'Increase', TC:'漲幅'}],
|
|
75495
|
+
['FloatTooltip-Risefall', {CN:'涨跌', EN:'Risefall', TC:'漲跌'}],
|
|
75496
|
+
['FloatTooltip-Vol', {CN:'成交量', EN:'Volume', TC:'數量'}],
|
|
75497
|
+
['FloatTooltip-Amount', {CN:'成交额', EN:'Amount', TC:'金額'}],
|
|
75498
|
+
['FloatTooltip-Exchange', {CN:'换手率', EN:'Exchange', TC:'換手'}],
|
|
75499
|
+
['FloatTooltip-Position', {CN:'持仓量', EN:'Position', TC:'持倉'}],
|
|
75500
|
+
['FloatTooltip-Price', {CN:'价格', EN:'Price', TC:'價格'}],
|
|
75501
|
+
['FloatTooltip-AvPrice', {CN:'均价', EN:'AVPrice:', TC:'均價'}],
|
|
75502
|
+
['FloatTooltip-FClose', {CN:"结算价", EN:'Settlement', TC:'結算價'}],
|
|
75503
|
+
['FloatTooltip-YSettlePrice', {CN:"昨结算", EN:'YSettlement', TC:'昨結算'}],
|
|
75504
|
+
['FloatTooltip-Amplitude', {CN:'振幅', EN:'amplitude', TC:'振幅'}],
|
|
75400
75505
|
|
|
75506
|
+
|
|
75401
75507
|
['DialogSelectRect-StartPrice', {CN:'起始价:', EN:'Start Price:', TC:'起始價'}],
|
|
75402
75508
|
['DialogSelectRect-EndPrice', {CN:'最终价:', EN:"End Price:", TC:'最终價'}],
|
|
75403
75509
|
['DialogSelectRect-High', {CN:'最高价:', EN:'High:', TC:'最高價'}],
|
|
@@ -78872,6 +78978,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
78872
78978
|
|
|
78873
78979
|
this.SendKLineUpdateEvent(bindData);
|
|
78874
78980
|
this.UpdateDOMTooltip(0, bindData);
|
|
78981
|
+
this.UpdateHQFloatTooltip(bindData);
|
|
78875
78982
|
|
|
78876
78983
|
//叠加指标计算
|
|
78877
78984
|
this.BindAllOverlayIndexData(bindData, { CheckRunCount:true,SyncExecute:false }); //异步模式叠加指标
|
|
@@ -79130,6 +79237,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
79130
79237
|
|
|
79131
79238
|
this.SendKLineUpdateEvent(bindData);
|
|
79132
79239
|
this.UpdateDOMTooltip(0, bindData);
|
|
79240
|
+
this.UpdateHQFloatTooltip(bindData);
|
|
79133
79241
|
|
|
79134
79242
|
//更新叠加指标
|
|
79135
79243
|
this.BindAllOverlayIndexData(bindData, { CheckRunCount:true,SyncExecute:false }); //异步模式叠加指标
|
|
@@ -83665,18 +83773,34 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
83665
83773
|
if (!this.DialogTooltip) return false;
|
|
83666
83774
|
if (!this.ChartCorssCursor) return false;
|
|
83667
83775
|
|
|
83776
|
+
var dataType=0;
|
|
83668
83777
|
var kItem=null;
|
|
83669
83778
|
if (this.ChartCorssCursor.ClientPos>=0)
|
|
83670
83779
|
{
|
|
83671
83780
|
var hisData=this.ChartOperator_Temp_GetHistroyData();;
|
|
83672
83781
|
if (!hisData) return false; //数据还没有到达
|
|
83782
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(hisData.Data)) return false;
|
|
83673
83783
|
|
|
83674
83784
|
var dataIndex=hisData.DataOffset+this.ChartCorssCursor.CursorIndex;
|
|
83785
|
+
if (dataIndex>=hisData.Data.length) dataIndex=hisData.Data.length-1;
|
|
83675
83786
|
var kItem=hisData.Data[dataIndex];
|
|
83676
83787
|
}
|
|
83788
|
+
else //取最后一个数据
|
|
83789
|
+
{
|
|
83790
|
+
var hisData=this.ChartOperator_Temp_GetHistroyData();;
|
|
83791
|
+
if (!hisData) return false; //数据还没有到达
|
|
83792
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(hisData.Data)) return false;
|
|
83793
|
+
var kItem=hisData.Data[hisData.Data.length-1];
|
|
83794
|
+
var dataID={ Symbol:this.Symbol, Date:kItem.Date };
|
|
83795
|
+
if (IFrameSplitOperator.IsNumber(kItem.Time)) dataID.Time=kItem.Time;
|
|
83796
|
+
if (!this.DialogTooltip.IsEqualDataID(dataID)) return false;
|
|
83797
|
+
|
|
83798
|
+
dataType=1;
|
|
83799
|
+
}
|
|
83677
83800
|
|
|
83678
83801
|
var sendData=
|
|
83679
83802
|
{
|
|
83803
|
+
DataType:dataType, //0=全部更新 1=更新实时K线
|
|
83680
83804
|
ClientPos:this.ChartCorssCursor.ClientPos, //位置
|
|
83681
83805
|
IsShowCorss:this.ChartCorssCursor.IsShowCorss, //是否显示十字线
|
|
83682
83806
|
KItem:kItem,
|
|
@@ -83684,7 +83808,6 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
83684
83808
|
LastValue:this.ChartCorssCursor.LastValue,
|
|
83685
83809
|
};
|
|
83686
83810
|
|
|
83687
|
-
|
|
83688
83811
|
this.DialogTooltip.Update(sendData);
|
|
83689
83812
|
|
|
83690
83813
|
return true;
|
|
@@ -83725,6 +83848,52 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
83725
83848
|
|
|
83726
83849
|
this.DialogSelectRect.Update(sendData);
|
|
83727
83850
|
}
|
|
83851
|
+
|
|
83852
|
+
this.DrawFloatTooltip=function(point,toolTip)
|
|
83853
|
+
{
|
|
83854
|
+
if (!this.FloatTooltip) return;
|
|
83855
|
+
|
|
83856
|
+
this.UpdateFloatTooltip(point, toolTip)
|
|
83857
|
+
}
|
|
83858
|
+
|
|
83859
|
+
this.UpdateFloatTooltip=function(point, toolTip)
|
|
83860
|
+
{
|
|
83861
|
+
if (!this.FloatTooltip) return;
|
|
83862
|
+
|
|
83863
|
+
var sendData=
|
|
83864
|
+
{
|
|
83865
|
+
Tooltip:toolTip,
|
|
83866
|
+
Point:point,
|
|
83867
|
+
Symbol:this.Symbol,
|
|
83868
|
+
Name:this.Name,
|
|
83869
|
+
DataType:1,
|
|
83870
|
+
};
|
|
83871
|
+
|
|
83872
|
+
this.FloatTooltip.Update(sendData);
|
|
83873
|
+
}
|
|
83874
|
+
|
|
83875
|
+
this.UpdateHQFloatTooltip=function(kData)
|
|
83876
|
+
{
|
|
83877
|
+
if (!this.FloatTooltip) return;
|
|
83878
|
+
if (!this.FloatTooltip.IsShow()) return;
|
|
83879
|
+
if (!kData || !IFrameSplitOperator.IsNonEmptyArray(kData.Data)) return;
|
|
83880
|
+
|
|
83881
|
+
var lastItem=kData.Data[kData.Data.length-1];
|
|
83882
|
+
if (!lastItem) return;
|
|
83883
|
+
|
|
83884
|
+
var dataID={ Symbol:kData.Symbol, Date:lastItem.Date, Time:lastItem.Time };
|
|
83885
|
+
if (!this.FloatTooltip.IsEqualHQID(dataID)) return;
|
|
83886
|
+
|
|
83887
|
+
var sendData=
|
|
83888
|
+
{
|
|
83889
|
+
Data:lastItem,
|
|
83890
|
+
Symbol:this.Symbol,
|
|
83891
|
+
Name:this.Name,
|
|
83892
|
+
DataType:2,
|
|
83893
|
+
};
|
|
83894
|
+
|
|
83895
|
+
this.FloatTooltip.Update(sendData);
|
|
83896
|
+
}
|
|
83728
83897
|
}
|
|
83729
83898
|
|
|
83730
83899
|
//API 返回数据 转化为array[]
|
|
@@ -89551,6 +89720,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
89551
89720
|
if (!this.ChartCorssCursor) return false;
|
|
89552
89721
|
|
|
89553
89722
|
var minuteItem=null; //{ Type:0=连续交易 1=集合竞价, Data:数据 }
|
|
89723
|
+
var dataType=0; //0=全部更新 2=分时实时数据更新
|
|
89554
89724
|
if (this.ChartCorssCursor.ClientPos>=0)
|
|
89555
89725
|
{
|
|
89556
89726
|
var titlePaint=this.TitlePaint[0];
|
|
@@ -89560,21 +89730,32 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
89560
89730
|
if ((pointInfo.ClientPos==2 || pointInfo.ClientPos==3 || (pointInfo.ClientPos>=200&& pointInfo.ClientPos<=299) || (pointInfo.ClientPos>=300&& pointInfo.ClientPos<=399)))
|
|
89561
89731
|
{
|
|
89562
89732
|
var auctionData=titlePaint.GetCurrentAuctionData();
|
|
89563
|
-
if (!auctionData) return;
|
|
89733
|
+
if (!auctionData) return false;
|
|
89564
89734
|
minuteItem={ Type:1, Data:auctionData };
|
|
89565
89735
|
}
|
|
89566
89736
|
else
|
|
89567
89737
|
{
|
|
89568
89738
|
var minuteData=titlePaint.GetCurrentKLineData();
|
|
89569
|
-
if (!minuteData) return;
|
|
89739
|
+
if (!minuteData) return false;
|
|
89570
89740
|
minuteItem={ Type:0, Data:minuteData };
|
|
89571
89741
|
}
|
|
89572
89742
|
}
|
|
89573
|
-
|
|
89743
|
+
}
|
|
89744
|
+
else //实时数据更新
|
|
89745
|
+
{
|
|
89746
|
+
if (!this.SourceData || !IFrameSplitOperator.IsNonEmptyArray(this.SourceData.Data)) return false;
|
|
89747
|
+
var minuteData=this.SourceData.Data[this.SourceData.Data.length-1];
|
|
89748
|
+
|
|
89749
|
+
var dataID={ Symbol:this.Symbol, Date:minuteData.Date, Time:minuteData.Time };
|
|
89750
|
+
if (!this.DialogTooltip.IsEqualDataID(dataID)) return false;
|
|
89751
|
+
|
|
89752
|
+
minuteItem={ Type:0, Data:minuteData };
|
|
89753
|
+
dataType=2;
|
|
89574
89754
|
}
|
|
89575
89755
|
|
|
89576
89756
|
var sendData=
|
|
89577
89757
|
{
|
|
89758
|
+
DataType:dataType,
|
|
89578
89759
|
ClientPos:this.ChartCorssCursor.ClientPos, //位置
|
|
89579
89760
|
IsShowCorss:this.ChartCorssCursor.IsShowCorss, //是否显示十字线
|
|
89580
89761
|
MinItem:minuteItem,
|
|
@@ -125334,6 +125515,21 @@ function GetBlackStyle()
|
|
|
125334
125515
|
TitleBGColor:"rgb(200, 66, 69)",
|
|
125335
125516
|
},
|
|
125336
125517
|
|
|
125518
|
+
FloatTooltip:
|
|
125519
|
+
{
|
|
125520
|
+
BGColor:'rgb(20,20,20)', //背景色
|
|
125521
|
+
BorderColor:'rgb(170,170,170)', //边框颜色
|
|
125522
|
+
|
|
125523
|
+
VolColor:"rgb(255, 185, 15)", //标题成交量
|
|
125524
|
+
AmountColor:"rgb(210,210,210)", //成交金额
|
|
125525
|
+
DateTimeColor:'rgb(210,210,210)',
|
|
125526
|
+
TurnoverRateColor:'rgb(43,54,69)', //换手率
|
|
125527
|
+
PositionColor:"rgb(255,0,255)", //持仓
|
|
125528
|
+
|
|
125529
|
+
TextColor:"rgb(210,210,210)", //数值名称
|
|
125530
|
+
ValueColor:"rgb(210,210,210)", //数值
|
|
125531
|
+
},
|
|
125532
|
+
|
|
125337
125533
|
DialogSelectRect:
|
|
125338
125534
|
{
|
|
125339
125535
|
BGColor:'rgb(20,20,20)', //背景色
|
|
@@ -144259,8 +144455,9 @@ function JSDialogTooltip()
|
|
|
144259
144455
|
|
|
144260
144456
|
this.KItemCache=null;
|
|
144261
144457
|
this.KItemCacheID=null;
|
|
144262
|
-
this.LastValueCache=null;
|
|
144263
|
-
this.LastValueCacheID=null;
|
|
144458
|
+
this.LastValueCache=null; //最后的鼠标位置对应的数值
|
|
144459
|
+
this.LastValueCacheID=null; //鼠标信息
|
|
144460
|
+
this.DataID=null; //当前显示的数据时间{ Symbol:, Date:, Time: }
|
|
144264
144461
|
|
|
144265
144462
|
this.Inital=function(hqchart, option)
|
|
144266
144463
|
{
|
|
@@ -144300,6 +144497,22 @@ function JSDialogTooltip()
|
|
|
144300
144497
|
}
|
|
144301
144498
|
}
|
|
144302
144499
|
|
|
144500
|
+
//data={ Symbol, Date, Time}
|
|
144501
|
+
this.IsEqualDataID=function(data)
|
|
144502
|
+
{
|
|
144503
|
+
if (!this.DataID) return false;
|
|
144504
|
+
if (!data) return false;
|
|
144505
|
+
|
|
144506
|
+
if (this.DataID.Symbol!=data.Symbol) return false;
|
|
144507
|
+
if (this.DataID.Date!=data.Date) return false;
|
|
144508
|
+
if (IFrameSplitOperator.IsNumber(this.DataID.Time))
|
|
144509
|
+
{
|
|
144510
|
+
if (this.DataID.Time!=data.Time) return false;
|
|
144511
|
+
}
|
|
144512
|
+
|
|
144513
|
+
return true;
|
|
144514
|
+
}
|
|
144515
|
+
|
|
144303
144516
|
this.Create=function()
|
|
144304
144517
|
{
|
|
144305
144518
|
var divDom=document.createElement("div");
|
|
@@ -144415,9 +144628,72 @@ function JSDialogTooltip()
|
|
|
144415
144628
|
this.UpdateStyle();
|
|
144416
144629
|
}
|
|
144417
144630
|
|
|
144631
|
+
//更新实时数据
|
|
144632
|
+
this.UpdateKLineData=function(data)
|
|
144633
|
+
{
|
|
144634
|
+
if (!data.KItem|| !data.IsShowCorss) return;
|
|
144635
|
+
|
|
144636
|
+
this.LanguageID=this.HQChart.LanguageID;
|
|
144637
|
+
|
|
144638
|
+
if (this.HQChart.ClassName=='KLineChartContainer')
|
|
144639
|
+
{
|
|
144640
|
+
var strKItem=JSON.stringify(data.KItem);
|
|
144641
|
+
var bUpdata=false;
|
|
144642
|
+
if (this.KItemCacheID!=strKItem) //数据变动的才更新
|
|
144643
|
+
{
|
|
144644
|
+
this.KItemCache= JSON.parse(strKItem);
|
|
144645
|
+
this.KItemCacheID=strKItem;
|
|
144646
|
+
bUpdata=true;
|
|
144647
|
+
}
|
|
144648
|
+
|
|
144649
|
+
if (bUpdata)
|
|
144650
|
+
{
|
|
144651
|
+
this.UpdateTableDOM();
|
|
144652
|
+
}
|
|
144653
|
+
else
|
|
144654
|
+
{
|
|
144655
|
+
//JSConsole.Chart.Log(`[JSDialogTooltip::Update] save as KItemCache and KItem`);
|
|
144656
|
+
}
|
|
144657
|
+
}
|
|
144658
|
+
}
|
|
144659
|
+
|
|
144660
|
+
//更新实时分时数据
|
|
144661
|
+
this.UpdateMinuteData=function(data)
|
|
144662
|
+
{
|
|
144663
|
+
if (!data.MinItem || !data.IsShowCorss) return;
|
|
144664
|
+
|
|
144665
|
+
var strKItem=JSON.stringify(data.MinItem);
|
|
144666
|
+
var bUpdata=false;
|
|
144667
|
+
if (this.KItemCacheID!=strKItem) //数据变动的才更新
|
|
144668
|
+
{
|
|
144669
|
+
this.KItemCache= JSON.parse(strKItem);
|
|
144670
|
+
this.KItemCacheID=strKItem;
|
|
144671
|
+
bUpdata=true;
|
|
144672
|
+
}
|
|
144673
|
+
|
|
144674
|
+
if (bUpdata)
|
|
144675
|
+
{
|
|
144676
|
+
this.UpdateTableDOM();
|
|
144677
|
+
}
|
|
144678
|
+
}
|
|
144679
|
+
|
|
144418
144680
|
this.Update=function(data)
|
|
144419
144681
|
{
|
|
144420
144682
|
if (!this.DivDialog || !this.TitleBox) return;
|
|
144683
|
+
|
|
144684
|
+
//实时数据更新
|
|
144685
|
+
if (data.DataType==1)
|
|
144686
|
+
{
|
|
144687
|
+
this.UpdateKLineData(data);
|
|
144688
|
+
return;
|
|
144689
|
+
}
|
|
144690
|
+
else if (data.DataType==2)
|
|
144691
|
+
{
|
|
144692
|
+
this.UpdateMinuteData(data);
|
|
144693
|
+
return;
|
|
144694
|
+
}
|
|
144695
|
+
|
|
144696
|
+
|
|
144421
144697
|
if ((!data.KItem && !data.MinItem) || !data.IsShowCorss || data.ClientPos<0) return;
|
|
144422
144698
|
|
|
144423
144699
|
this.LanguageID=this.HQChart.LanguageID;
|
|
@@ -144442,6 +144718,7 @@ function JSDialogTooltip()
|
|
|
144442
144718
|
|
|
144443
144719
|
if (bUpdata)
|
|
144444
144720
|
{
|
|
144721
|
+
this.UpdateDataID(data);
|
|
144445
144722
|
this.UpdateTableDOM();
|
|
144446
144723
|
}
|
|
144447
144724
|
else
|
|
@@ -144469,6 +144746,7 @@ function JSDialogTooltip()
|
|
|
144469
144746
|
|
|
144470
144747
|
if (bUpdata)
|
|
144471
144748
|
{
|
|
144749
|
+
this.UpdateDataID(data);
|
|
144472
144750
|
this.UpdateTableDOM();
|
|
144473
144751
|
}
|
|
144474
144752
|
}
|
|
@@ -144516,6 +144794,31 @@ function JSDialogTooltip()
|
|
|
144516
144794
|
}
|
|
144517
144795
|
}
|
|
144518
144796
|
|
|
144797
|
+
this.UpdateDataID=function(data)
|
|
144798
|
+
{
|
|
144799
|
+
if (this.HQChart.ClassName=='KLineChartContainer')
|
|
144800
|
+
{
|
|
144801
|
+
var kItem=data.KItem;
|
|
144802
|
+
this.DataID={ Symbol:data.Symbol, Date:kItem.Date, Time:null };
|
|
144803
|
+
if (IFrameSplitOperator.IsNumber(kItem.Time)) this.DataID.Time=kItem.Time;
|
|
144804
|
+
}
|
|
144805
|
+
else if (this.HQChart.ClassName=='MinuteChartContainer')
|
|
144806
|
+
{
|
|
144807
|
+
var minItem=data.MinItem;
|
|
144808
|
+
if (minItem.Type==0) //连续交易
|
|
144809
|
+
{
|
|
144810
|
+
var item=minItem.Data;
|
|
144811
|
+
if (item) this.DataID={ Symbol:data.Symbol, Date:item.Date, Time:item.Time };
|
|
144812
|
+
}
|
|
144813
|
+
else if (minItem.Type==1) //集合竞价
|
|
144814
|
+
{
|
|
144815
|
+
var item=minItem.Data.Data;
|
|
144816
|
+
if (item) this.DataID={ Symbol:data.Symbol, Date:item.Date, Time:item.Time };
|
|
144817
|
+
}
|
|
144818
|
+
|
|
144819
|
+
}
|
|
144820
|
+
}
|
|
144821
|
+
|
|
144519
144822
|
this.Close=function(e)
|
|
144520
144823
|
{
|
|
144521
144824
|
if (!this.DivDialog) return;
|
|
@@ -144661,7 +144964,7 @@ function JSDialogTooltip()
|
|
|
144661
144964
|
aryText.push(this.ForamtFClose(data.FClose, defaultfloatPrecision, 'DialogTooltip-FClose'));
|
|
144662
144965
|
}
|
|
144663
144966
|
|
|
144664
|
-
var event=this.HQChart.GetEventCallback(JSCHART_EVENT_ID.
|
|
144967
|
+
var event=this.HQChart.GetEventCallback(JSCHART_EVENT_ID.ON_FORMAT_DIALOG_TOOLTIP);
|
|
144665
144968
|
if (event && event.Callback)
|
|
144666
144969
|
{
|
|
144667
144970
|
var sendData={ AryText:aryText, Data:data, Symbol:this.HQChart.Symbol, HQChart:this.HQChart, IsKLine:true };
|
|
@@ -144669,7 +144972,7 @@ function JSDialogTooltip()
|
|
|
144669
144972
|
}
|
|
144670
144973
|
|
|
144671
144974
|
return aryText;
|
|
144672
|
-
}
|
|
144975
|
+
}
|
|
144673
144976
|
|
|
144674
144977
|
this.GetFormatMinuteTooltipText=function(data)
|
|
144675
144978
|
{
|
|
@@ -144729,7 +145032,7 @@ function JSDialogTooltip()
|
|
|
144729
145032
|
|
|
144730
145033
|
}
|
|
144731
145034
|
|
|
144732
|
-
var event=this.HQChart.GetEventCallback(JSCHART_EVENT_ID.
|
|
145035
|
+
var event=this.HQChart.GetEventCallback(JSCHART_EVENT_ID.ON_FORMAT_DIALOG_TOOLTIP);
|
|
144733
145036
|
if (event && event.Callback)
|
|
144734
145037
|
{
|
|
144735
145038
|
var sendData={ AryText:aryText, Data:data, Symbol:this.HQChart.Symbol, HQChart:this.HQChart, IsMinute:true };
|
|
@@ -145044,6 +145347,621 @@ function JSDialogTooltip()
|
|
|
145044
145347
|
|
|
145045
145348
|
|
|
145046
145349
|
}
|
|
145350
|
+
|
|
145351
|
+
//浮动K线提示信息
|
|
145352
|
+
function JSFloatTooltip()
|
|
145353
|
+
{
|
|
145354
|
+
this.DivDialog=null;
|
|
145355
|
+
this.Style=0; //0=一行一个, 1=2行一个
|
|
145356
|
+
|
|
145357
|
+
this.HQChart=null;
|
|
145358
|
+
this.MaxRowCount=20;
|
|
145359
|
+
|
|
145360
|
+
this.UpColor=g_JSChartResource.UpTextColor;
|
|
145361
|
+
this.DownColor=g_JSChartResource.DownTextColor;
|
|
145362
|
+
this.UnchangeColor=g_JSChartResource.UnchagneTextColor;
|
|
145363
|
+
|
|
145364
|
+
this.BGColor=g_JSChartResource.FloatTooltip.BGColor;
|
|
145365
|
+
this.BorderColor=g_JSChartResource.FloatTooltip.BorderColor;
|
|
145366
|
+
|
|
145367
|
+
this.TextColor=g_JSChartResource.FloatTooltip.TextColor;
|
|
145368
|
+
this.ValueColor=g_JSChartResource.FloatTooltip.ValueColor;
|
|
145369
|
+
|
|
145370
|
+
this.VolColor=g_JSChartResource.FloatTooltip.VolColor;
|
|
145371
|
+
this.AmountColor=g_JSChartResource.FloatTooltip.AmountColor;
|
|
145372
|
+
this.TurnoverRateColor=g_JSChartResource.FloatTooltip.TurnoverRateColor;
|
|
145373
|
+
this.PositionColor=g_JSChartResource.FloatTooltip.PositionColor;
|
|
145374
|
+
this.DateTimeColor=g_JSChartResource.FloatTooltip.DateTimeColor;
|
|
145375
|
+
this.LanguageID=JSCHART_LANGUAGE_ID.LANGUAGE_CHINESE_ID;
|
|
145376
|
+
|
|
145377
|
+
this.AryData=[]; //输出文字信息
|
|
145378
|
+
this.AryText=[]; //表格tr
|
|
145379
|
+
|
|
145380
|
+
this.KItemCache=null; //{ Symbol:, Item:, Name }
|
|
145381
|
+
this.KItemCacheID=null;
|
|
145382
|
+
|
|
145383
|
+
this.Inital=function(hqchart, option)
|
|
145384
|
+
{
|
|
145385
|
+
this.HQChart=hqchart;
|
|
145386
|
+
if (option)
|
|
145387
|
+
{
|
|
145388
|
+
if (IFrameSplitOperator.IsNumber(option.Style)) this.Style=option.Style;
|
|
145389
|
+
}
|
|
145390
|
+
}
|
|
145391
|
+
|
|
145392
|
+
this.Destroy=function()
|
|
145393
|
+
{
|
|
145394
|
+
this.AryData=[];
|
|
145395
|
+
this.AryText=[];
|
|
145396
|
+
this.KItemCache=null;
|
|
145397
|
+
this.KItemCacheID=null;
|
|
145398
|
+
|
|
145399
|
+
if (this.DivDialog)
|
|
145400
|
+
{
|
|
145401
|
+
document.body.removeChild(this.DivDialog);
|
|
145402
|
+
this.DivDialog=null;
|
|
145403
|
+
}
|
|
145404
|
+
}
|
|
145405
|
+
|
|
145406
|
+
this.Show=function(x, y)
|
|
145407
|
+
{
|
|
145408
|
+
if (!this.DivDialog) return;
|
|
145409
|
+
if (!this.HQChart) return;
|
|
145410
|
+
|
|
145411
|
+
var rtClient=this.HQChart.UIElement.getBoundingClientRect();
|
|
145412
|
+
var left=x+rtClient.left,top=y+rtClient.top;
|
|
145413
|
+
var right=left+this.DivDialog.offsetWidth;
|
|
145414
|
+
var bottom=top+this.DivDialog.offsetHeight;
|
|
145415
|
+
|
|
145416
|
+
if ((right+5)>=window.innerWidth) left=left-this.DivDialog.offsetWidth;
|
|
145417
|
+
if ((bottom+5)>=window.innerHeight) top=0;
|
|
145418
|
+
|
|
145419
|
+
this.DivDialog.style.top = top + "px";
|
|
145420
|
+
this.DivDialog.style.left = left + "px";
|
|
145421
|
+
|
|
145422
|
+
if (this.DivDialog.style.visibility!='visible')
|
|
145423
|
+
this.DivDialog.style.visibility='visible';
|
|
145424
|
+
}
|
|
145425
|
+
|
|
145426
|
+
this.Hide=function()
|
|
145427
|
+
{
|
|
145428
|
+
if (!this.DivDialog) return;
|
|
145429
|
+
|
|
145430
|
+
this.KItemCache=null;
|
|
145431
|
+
this.KItemCacheID=null;
|
|
145432
|
+
|
|
145433
|
+
if (this.DivDialog.style.visibility!='hidden') this.DivDialog.style.visibility='hidden';
|
|
145434
|
+
}
|
|
145435
|
+
|
|
145436
|
+
this.Create=function()
|
|
145437
|
+
{
|
|
145438
|
+
var divDom=document.createElement("div");
|
|
145439
|
+
divDom.className='UMyChart_Tooltip_Float_Div';
|
|
145440
|
+
|
|
145441
|
+
var table=document.createElement("table");
|
|
145442
|
+
table.className="UMyChart_Tooltip_Float_Table";
|
|
145443
|
+
divDom.appendChild(table);
|
|
145444
|
+
|
|
145445
|
+
var tbody=document.createElement("tbody");
|
|
145446
|
+
tbody.className="UMyChart_Tooltip_Float_Tbody";
|
|
145447
|
+
table.appendChild(tbody);
|
|
145448
|
+
|
|
145449
|
+
this.AryData=[];
|
|
145450
|
+
|
|
145451
|
+
for(var i=0;i<this.MaxRowCount;++i)
|
|
145452
|
+
{
|
|
145453
|
+
var rowItem={ Tr:null, TitleSpan:null, TextSpan:null, TitleTd:null, TextTd:null };
|
|
145454
|
+
|
|
145455
|
+
var trDom=document.createElement("tr");
|
|
145456
|
+
trDom.className='UMyChart_Tooltip_Float_Group_Tr';
|
|
145457
|
+
tbody.appendChild(trDom);
|
|
145458
|
+
rowItem.Tr=trDom;
|
|
145459
|
+
|
|
145460
|
+
var tdDom=document.createElement("td");
|
|
145461
|
+
tdDom.className="UMyChart_Tooltip_Float_Title_Td"; //标题
|
|
145462
|
+
trDom.appendChild(tdDom);
|
|
145463
|
+
rowItem.TitleTd=tdDom;
|
|
145464
|
+
|
|
145465
|
+
var spanDom=document.createElement("span");
|
|
145466
|
+
spanDom.className='UMyChart_Tooltip_Float_Title_Span';
|
|
145467
|
+
spanDom.innerText='标题';
|
|
145468
|
+
tdDom.appendChild(spanDom);
|
|
145469
|
+
rowItem.TitleSpan=spanDom;
|
|
145470
|
+
|
|
145471
|
+
var tdDom=document.createElement("td");
|
|
145472
|
+
tdDom.className="UMyChart_Tooltip_Float_Text_Td"; //数值
|
|
145473
|
+
trDom.appendChild(tdDom);
|
|
145474
|
+
rowItem.TextTd=tdDom;
|
|
145475
|
+
|
|
145476
|
+
var spanDom=document.createElement("span");
|
|
145477
|
+
spanDom.className='UMyChart_Tooltip_Float_Text_Span';
|
|
145478
|
+
spanDom.innerText='数值';
|
|
145479
|
+
tdDom.appendChild(spanDom);
|
|
145480
|
+
rowItem.TextSpan=spanDom;
|
|
145481
|
+
|
|
145482
|
+
this.AryData.push(rowItem);
|
|
145483
|
+
}
|
|
145484
|
+
|
|
145485
|
+
document.body.appendChild(divDom);
|
|
145486
|
+
|
|
145487
|
+
this.DivDialog=divDom;
|
|
145488
|
+
|
|
145489
|
+
this.UpdateStyle();
|
|
145490
|
+
}
|
|
145491
|
+
|
|
145492
|
+
this.IsShow=function()
|
|
145493
|
+
{
|
|
145494
|
+
if (!this.DivDialog) return false;
|
|
145495
|
+
|
|
145496
|
+
return this.DivDialog.style.visibility==='visible';
|
|
145497
|
+
}
|
|
145498
|
+
|
|
145499
|
+
//data={ Symbol, Date, Time} 是否是同一条K线
|
|
145500
|
+
this.IsEqualHQID=function(data)
|
|
145501
|
+
{
|
|
145502
|
+
if (!this.KItemCache) return false;
|
|
145503
|
+
if (!data) return false;
|
|
145504
|
+
if (!this.KItemCache.Item) return false;
|
|
145505
|
+
|
|
145506
|
+
var kItem=this.KItemCache.Item;
|
|
145507
|
+
if (this.KItemCache.Symbol!=data.Symbol) return false;
|
|
145508
|
+
if (kItem.Date!=data.Date) return false;
|
|
145509
|
+
if (IFrameSplitOperator.IsNumber(kItem.Time))
|
|
145510
|
+
{
|
|
145511
|
+
if (kItem.Time!=data.Time) return false;
|
|
145512
|
+
}
|
|
145513
|
+
|
|
145514
|
+
return true;
|
|
145515
|
+
}
|
|
145516
|
+
|
|
145517
|
+
this.UpdateStyle=function()
|
|
145518
|
+
{
|
|
145519
|
+
if (!this.DivDialog) return;
|
|
145520
|
+
|
|
145521
|
+
if (this.BGColor) this.DivDialog.style['background-color']=this.BGColor;
|
|
145522
|
+
if (this.BorderColor) this.DivDialog.style['border-color']=this.BorderColor;
|
|
145523
|
+
|
|
145524
|
+
//this.UpdateTableDOM();
|
|
145525
|
+
}
|
|
145526
|
+
|
|
145527
|
+
//更新数据
|
|
145528
|
+
this.Update=function(data)
|
|
145529
|
+
{
|
|
145530
|
+
if (!this.DivDialog) return;
|
|
145531
|
+
this.LanguageID=this.HQChart.LanguageID;
|
|
145532
|
+
|
|
145533
|
+
if (data.DataType==1)
|
|
145534
|
+
{
|
|
145535
|
+
var tooltipData=data.Tooltip;
|
|
145536
|
+
if (!tooltipData) return;
|
|
145537
|
+
|
|
145538
|
+
if (tooltipData.Type==0)
|
|
145539
|
+
{
|
|
145540
|
+
this.UpdateKLineToolitp(data);
|
|
145541
|
+
}
|
|
145542
|
+
}
|
|
145543
|
+
else if (data.DataType==2) //更新实时行情数据
|
|
145544
|
+
{
|
|
145545
|
+
this.UpdateRealtimeHQTooltip(data);
|
|
145546
|
+
}
|
|
145547
|
+
}
|
|
145548
|
+
|
|
145549
|
+
this.UpdateRealtimeHQTooltip=function(data)
|
|
145550
|
+
{
|
|
145551
|
+
if (!this.KItemCache) return;
|
|
145552
|
+
|
|
145553
|
+
var kItem={ Symbol:data.Symbol, Name:this.KItemCache.Name, Item:data.Data, IsOverlay:this.KItemCache.IsOverlay };
|
|
145554
|
+
var strKItem=JSON.stringify(kItem);
|
|
145555
|
+
|
|
145556
|
+
var bUpdata=false;
|
|
145557
|
+
if (this.KItemCacheID!=strKItem) //数据变动的才更新
|
|
145558
|
+
{
|
|
145559
|
+
this.KItemCache= kItem;
|
|
145560
|
+
this.KItemCacheID=strKItem;
|
|
145561
|
+
bUpdata=true;
|
|
145562
|
+
}
|
|
145563
|
+
|
|
145564
|
+
if (bUpdata)
|
|
145565
|
+
{
|
|
145566
|
+
this.UpdateTableDOM();
|
|
145567
|
+
}
|
|
145568
|
+
}
|
|
145569
|
+
|
|
145570
|
+
this.UpdateKLineToolitp=function(data)
|
|
145571
|
+
{
|
|
145572
|
+
var tooltipData=data.Tooltip;
|
|
145573
|
+
var symbol=data.Symbol;
|
|
145574
|
+
var name=data.Name;
|
|
145575
|
+
var bOverlay=false; //是否是叠加指标
|
|
145576
|
+
if (tooltipData.ChartPaint.Name=="Overlay-KLine")
|
|
145577
|
+
{
|
|
145578
|
+
symbol=tooltipData.ChartPaint.Symbol;
|
|
145579
|
+
name=tooltipData.ChartPaint.Title;
|
|
145580
|
+
bOverlay=true;
|
|
145581
|
+
}
|
|
145582
|
+
|
|
145583
|
+
var kItem={ Symbol:symbol, Name:name, Item:CloneData(tooltipData.Data), IsOverlay:bOverlay };
|
|
145584
|
+
var strKItem=JSON.stringify(kItem);
|
|
145585
|
+
var bUpdata=false;
|
|
145586
|
+
if (this.KItemCacheID!=strKItem) //数据变动的才更新
|
|
145587
|
+
{
|
|
145588
|
+
this.KItemCache= kItem;
|
|
145589
|
+
this.KItemCacheID=strKItem;
|
|
145590
|
+
bUpdata=true;
|
|
145591
|
+
}
|
|
145592
|
+
|
|
145593
|
+
if (bUpdata)
|
|
145594
|
+
{
|
|
145595
|
+
this.UpdateTableDOM();
|
|
145596
|
+
}
|
|
145597
|
+
|
|
145598
|
+
if (data.Point)
|
|
145599
|
+
{
|
|
145600
|
+
var x=data.Point.X;
|
|
145601
|
+
var y=data.Point.Y+data.Point.YMove;
|
|
145602
|
+
this.Show(x, y);
|
|
145603
|
+
}
|
|
145604
|
+
}
|
|
145605
|
+
|
|
145606
|
+
this.UpdateTableDOM=function()
|
|
145607
|
+
{
|
|
145608
|
+
if (!this.KItemCache) return;
|
|
145609
|
+
|
|
145610
|
+
if (this.HQChart.ClassName=='KLineChartContainer')
|
|
145611
|
+
this.AryText=this.GetFormatKLineTooltipText(this.KItemCache);
|
|
145612
|
+
else
|
|
145613
|
+
return;
|
|
145614
|
+
|
|
145615
|
+
var index=0;
|
|
145616
|
+
for(index=0;index<this.AryText.length && index<this.MaxRowCount;++index)
|
|
145617
|
+
{
|
|
145618
|
+
var outItem=this.AryText[index];
|
|
145619
|
+
var item=this.AryData[index];
|
|
145620
|
+
|
|
145621
|
+
item.TitleSpan.innerText=outItem.Title;
|
|
145622
|
+
item.TitleSpan.style.color=this.TextColor;
|
|
145623
|
+
item.TextSpan.innerText=outItem.Text;
|
|
145624
|
+
item.TextSpan.style.color=outItem.Color;
|
|
145625
|
+
|
|
145626
|
+
if (outItem.ClassName)
|
|
145627
|
+
{
|
|
145628
|
+
item.TextSpan.className=outItem.ClassName;
|
|
145629
|
+
}
|
|
145630
|
+
else
|
|
145631
|
+
{
|
|
145632
|
+
if (item.TextSpan.className!="UMyChart_Tooltip_Float_Text_Span") item.TextSpan.className="UMyChart_Tooltip_Float_Text_Span"
|
|
145633
|
+
}
|
|
145634
|
+
|
|
145635
|
+
item.Tr.style.display="";
|
|
145636
|
+
if (item.Tr2) item.Tr2.style.display="";
|
|
145637
|
+
}
|
|
145638
|
+
|
|
145639
|
+
for( ; index<this.MaxRowCount; ++index)
|
|
145640
|
+
{
|
|
145641
|
+
var item=this.AryData[index];
|
|
145642
|
+
item.Tr.style.display="none";
|
|
145643
|
+
if (item.Tr2) item.Tr2.style.display="none";
|
|
145644
|
+
}
|
|
145645
|
+
}
|
|
145646
|
+
|
|
145647
|
+
this.GetFormatKLineTooltipText=function(kItem)
|
|
145648
|
+
{
|
|
145649
|
+
var data=kItem.Item;
|
|
145650
|
+
var symbol=kItem.Symbol;
|
|
145651
|
+
var upperSymbol=symbol.toUpperCase();
|
|
145652
|
+
var defaultfloatPrecision=GetfloatPrecision(symbol);//价格小数位数
|
|
145653
|
+
|
|
145654
|
+
//日期
|
|
145655
|
+
var dateItem=this.ForamtDate(data.Date,"YYYY/MM/DD/W",'FloatTooltip-Date' );
|
|
145656
|
+
|
|
145657
|
+
//时间
|
|
145658
|
+
var timeItem=null;
|
|
145659
|
+
if (IFrameSplitOperator.IsNumber(data.Time)) timeItem=this.FormatTime(data.Time, this.HQChart.Period, null, 'FloatTooltip-Time');
|
|
145660
|
+
|
|
145661
|
+
var overlayItem=null;
|
|
145662
|
+
if (kItem.IsOverlay)
|
|
145663
|
+
overlayItem={ Title:"", Text:kItem.Name, Color:this.TextColor, ClassName:"UMyChart_Tooltip_Float_Text2_Span" };
|
|
145664
|
+
|
|
145665
|
+
|
|
145666
|
+
var yClose=data.YClose; //昨收价|昨结算价
|
|
145667
|
+
var aryText=
|
|
145668
|
+
[
|
|
145669
|
+
this.ForamtPrice(data.Open,yClose, defaultfloatPrecision,'FloatTooltip-Open'),
|
|
145670
|
+
this.ForamtPrice(data.High,yClose, defaultfloatPrecision,'FloatTooltip-High'),
|
|
145671
|
+
this.ForamtPrice(data.Low,yClose, defaultfloatPrecision,'FloatTooltip-Low'),
|
|
145672
|
+
this.ForamtPrice(data.Close,yClose, defaultfloatPrecision,'FloatTooltip-Close'),
|
|
145673
|
+
this.ForamtPrice(data.YClose,data.YClose, defaultfloatPrecision,'FloatTooltip-YClose'),
|
|
145674
|
+
this.FormatVol(data.Vol,'FloatTooltip-Vol' ),
|
|
145675
|
+
this.FormatAmount(data.Amount,'FloatTooltip-Amount' ),
|
|
145676
|
+
this.FormatIncrease(data.Close,yClose,defaultfloatPrecision,'FloatTooltip-Increase'),
|
|
145677
|
+
this.FormatAmplitude(data.High,data.Low,yClose,defaultfloatPrecision,'FloatTooltip-Amplitude'),
|
|
145678
|
+
];
|
|
145679
|
+
|
|
145680
|
+
if (timeItem) aryText.unshift(timeItem);
|
|
145681
|
+
aryText.unshift(dateItem);
|
|
145682
|
+
if (overlayItem) aryText.unshift(overlayItem);
|
|
145683
|
+
|
|
145684
|
+
//换手率
|
|
145685
|
+
if (MARKET_SUFFIX_NAME.IsSHSZStockA(upperSymbol) && data.FlowCapital>0)
|
|
145686
|
+
{
|
|
145687
|
+
aryText.push(this.FormatExchange(data.Vol,data.FlowCapital,'FloatTooltip-Exchange' ));
|
|
145688
|
+
}
|
|
145689
|
+
|
|
145690
|
+
//持仓量 结算价
|
|
145691
|
+
if (MARKET_SUFFIX_NAME.IsFutures(upperSymbol))
|
|
145692
|
+
{
|
|
145693
|
+
aryText.push(this.FormatPosition(data.Position,'FloatTooltip-Position'));
|
|
145694
|
+
aryText.push(this.ForamtFClose(data.FClose, defaultfloatPrecision, 'FloatTooltip-FClose'));
|
|
145695
|
+
aryText.push(this.ForamtFClose(data.YFClose, defaultfloatPrecision, 'FloatTooltip-YSettlePrice'));
|
|
145696
|
+
|
|
145697
|
+
}
|
|
145698
|
+
|
|
145699
|
+
var event=this.HQChart.GetEventCallback(JSCHART_EVENT_ID.ON_FORMAT_KLINE_FLOAT_TOOLTIP);
|
|
145700
|
+
if (event && event.Callback)
|
|
145701
|
+
{
|
|
145702
|
+
var sendData={ AryText:aryText, Data:kItem, HQChart:this.HQChart };
|
|
145703
|
+
event.Callback(event, sendData, this);
|
|
145704
|
+
}
|
|
145705
|
+
|
|
145706
|
+
return aryText;
|
|
145707
|
+
}
|
|
145708
|
+
|
|
145709
|
+
|
|
145710
|
+
/////////////////////////////////////////////////////////////////////////////////////////////
|
|
145711
|
+
//数据格式化
|
|
145712
|
+
this.ForamtPrice=function(price, yClose, defaultfloatPrecision, TitleID)
|
|
145713
|
+
{
|
|
145714
|
+
var item=
|
|
145715
|
+
{
|
|
145716
|
+
Title:g_JSChartLocalization.GetText(TitleID, this.LanguageID),
|
|
145717
|
+
Text:"--.--",
|
|
145718
|
+
Color:this.ValueColor
|
|
145719
|
+
};
|
|
145720
|
+
|
|
145721
|
+
if (!IFrameSplitOperator.IsNumber(price)) return item;
|
|
145722
|
+
|
|
145723
|
+
item.Text=price.toFixed(defaultfloatPrecision);
|
|
145724
|
+
item.Color=this.GetColor(price, yClose);
|
|
145725
|
+
|
|
145726
|
+
return item;
|
|
145727
|
+
}
|
|
145728
|
+
|
|
145729
|
+
this.ForamtValue=function(value, defaultfloatPrecision, TitleID)
|
|
145730
|
+
{
|
|
145731
|
+
var item=
|
|
145732
|
+
{
|
|
145733
|
+
Title:g_JSChartLocalization.GetText(TitleID,this.LanguageID),
|
|
145734
|
+
Text:'--',
|
|
145735
|
+
Color:this.ValueColor
|
|
145736
|
+
};
|
|
145737
|
+
|
|
145738
|
+
if (!IFrameSplitOperator.IsNumber(value)) return item;
|
|
145739
|
+
|
|
145740
|
+
item.Text=IFrameSplitOperator.FormatValueStringV2(value,defaultfloatPrecision,2,this.LanguageID);
|
|
145741
|
+
return item;
|
|
145742
|
+
}
|
|
145743
|
+
|
|
145744
|
+
this.FormatVol=function(vol, TitleID)
|
|
145745
|
+
{
|
|
145746
|
+
var item=
|
|
145747
|
+
{
|
|
145748
|
+
Title:g_JSChartLocalization.GetText(TitleID,this.LanguageID),
|
|
145749
|
+
Text:'--',
|
|
145750
|
+
Color:this.VolColor
|
|
145751
|
+
};
|
|
145752
|
+
|
|
145753
|
+
if (!IFrameSplitOperator.IsNumber(vol)) return item;
|
|
145754
|
+
|
|
145755
|
+
item.Text=IFrameSplitOperator.FormatValueStringV2(vol,0,2,this.LanguageID);
|
|
145756
|
+
|
|
145757
|
+
return item;
|
|
145758
|
+
}
|
|
145759
|
+
|
|
145760
|
+
this.FormatAmount=function(amount, TitleID)
|
|
145761
|
+
{
|
|
145762
|
+
var item=
|
|
145763
|
+
{
|
|
145764
|
+
Title:g_JSChartLocalization.GetText(TitleID,this.LanguageID),
|
|
145765
|
+
Text:'--',
|
|
145766
|
+
Color:this.AmountColor
|
|
145767
|
+
};
|
|
145768
|
+
|
|
145769
|
+
if (!IFrameSplitOperator.IsNumber(amount)) return item;
|
|
145770
|
+
|
|
145771
|
+
item.Text=IFrameSplitOperator.FormatValueString(amount,2,this.LanguageID);
|
|
145772
|
+
|
|
145773
|
+
return item;
|
|
145774
|
+
}
|
|
145775
|
+
|
|
145776
|
+
this.FormatIncrease=function(price, yClose, defaultfloatPrecision, TitleID)
|
|
145777
|
+
{
|
|
145778
|
+
//涨幅
|
|
145779
|
+
var item=
|
|
145780
|
+
{
|
|
145781
|
+
Title:g_JSChartLocalization.GetText(TitleID,this.LanguageID),
|
|
145782
|
+
Text:"--.--",
|
|
145783
|
+
Color:this.ValueColor
|
|
145784
|
+
};
|
|
145785
|
+
|
|
145786
|
+
if (!IFrameSplitOperator.IsNumber(price) || !IFrameSplitOperator.IsNumber(yClose)) return item;
|
|
145787
|
+
|
|
145788
|
+
var diffValue=price-yClose;
|
|
145789
|
+
var value=(price-yClose)/yClose;
|
|
145790
|
+
|
|
145791
|
+
item.Text=`${(value*100).toFixed(2)}%`;
|
|
145792
|
+
item.Color=this.GetColor(value,0);
|
|
145793
|
+
|
|
145794
|
+
return item;
|
|
145795
|
+
}
|
|
145796
|
+
|
|
145797
|
+
this.FormatRisefall=function(price, yClose, defaultfloatPrecision, TitleID)
|
|
145798
|
+
{
|
|
145799
|
+
//涨跌
|
|
145800
|
+
var item=
|
|
145801
|
+
{
|
|
145802
|
+
Title:g_JSChartLocalization.GetText(TitleID,this.LanguageID),
|
|
145803
|
+
Text:"--.--",
|
|
145804
|
+
Color:this.ValueColor
|
|
145805
|
+
};
|
|
145806
|
+
|
|
145807
|
+
if (!IFrameSplitOperator.IsNumber(price) || !IFrameSplitOperator.IsNumber(yClose)) return item;
|
|
145808
|
+
|
|
145809
|
+
var value=price-yClose;
|
|
145810
|
+
item.Text=`${value.toFixed(defaultfloatPrecision)}`;
|
|
145811
|
+
item.Color=this.GetColor(value,0);
|
|
145812
|
+
|
|
145813
|
+
return item;
|
|
145814
|
+
}
|
|
145815
|
+
|
|
145816
|
+
this.FormatAmplitude=function(high, low, yClose, defaultfloatPrecision, TitleID)
|
|
145817
|
+
{
|
|
145818
|
+
//振幅
|
|
145819
|
+
var item=
|
|
145820
|
+
{
|
|
145821
|
+
Title:g_JSChartLocalization.GetText(TitleID,this.LanguageID),
|
|
145822
|
+
Text:"--.--",
|
|
145823
|
+
Color:this.ValueColor
|
|
145824
|
+
};
|
|
145825
|
+
|
|
145826
|
+
|
|
145827
|
+
if (!IFrameSplitOperator.IsNumber(high) || !IFrameSplitOperator.IsNumber(low) || !IFrameSplitOperator.IsNumber(yClose)) return item;
|
|
145828
|
+
|
|
145829
|
+
var diffValue=high-low;
|
|
145830
|
+
var value=(diffValue)/yClose;
|
|
145831
|
+
item.Text=`${(value*100).toFixed(2)}%`;
|
|
145832
|
+
item.Color=this.GetColor(value,0);
|
|
145833
|
+
|
|
145834
|
+
return item;
|
|
145835
|
+
}
|
|
145836
|
+
|
|
145837
|
+
this.ForamtDate=function(date, format, TitleID)
|
|
145838
|
+
{
|
|
145839
|
+
//日期
|
|
145840
|
+
var item=
|
|
145841
|
+
{
|
|
145842
|
+
Title:g_JSChartLocalization.GetText('DialogTooltip-Date',this.LanguageID),
|
|
145843
|
+
Text:"----/--/--",
|
|
145844
|
+
Color:this.DateTimeColor
|
|
145845
|
+
}
|
|
145846
|
+
|
|
145847
|
+
if (!IFrameSplitOperator.IsNumber(date)) return item;
|
|
145848
|
+
|
|
145849
|
+
item.Text=IFrameSplitOperator.FormatDateString(date,format);
|
|
145850
|
+
|
|
145851
|
+
return item;
|
|
145852
|
+
}
|
|
145853
|
+
|
|
145854
|
+
this.FormatTime=function(time, period, format, TitleID)
|
|
145855
|
+
{
|
|
145856
|
+
//时间
|
|
145857
|
+
var item=
|
|
145858
|
+
{
|
|
145859
|
+
Title:g_JSChartLocalization.GetText(TitleID,this.LanguageID),
|
|
145860
|
+
Text:'--:--',
|
|
145861
|
+
Color:this.DateTimeColor
|
|
145862
|
+
};
|
|
145863
|
+
|
|
145864
|
+
if (!IFrameSplitOperator.IsNumber(time)) return item;
|
|
145865
|
+
if (!format)
|
|
145866
|
+
{
|
|
145867
|
+
format="HH:MM";
|
|
145868
|
+
if (ChartData.IsMinutePeriod(period,true)) format='HH:MM'; // 分钟周期
|
|
145869
|
+
else if (ChartData.IsSecondPeriod(period)) format='HH:MM:SS';
|
|
145870
|
+
else if (ChartData.IsMilliSecondPeriod(period)) format='HH:MM:SS.fff';
|
|
145871
|
+
}
|
|
145872
|
+
|
|
145873
|
+
item.Text=IFrameSplitOperator.FormatTimeString(time,format);
|
|
145874
|
+
|
|
145875
|
+
return item;
|
|
145876
|
+
}
|
|
145877
|
+
|
|
145878
|
+
//换手率 成交量/流通股本
|
|
145879
|
+
this.FormatExchange=function(vol, flowCapital, TitleID)
|
|
145880
|
+
{
|
|
145881
|
+
//换手率
|
|
145882
|
+
var item=
|
|
145883
|
+
{
|
|
145884
|
+
Title:g_JSChartLocalization.GetText(TitleID,this.LanguageID),
|
|
145885
|
+
Text:'--.--',
|
|
145886
|
+
Color:this.DateTimeColor
|
|
145887
|
+
};
|
|
145888
|
+
|
|
145889
|
+
if (!IFrameSplitOperator.IsNumber(vol) || !IFrameSplitOperator.IsNumber(flowCapital) || flowCapital==0) return item;
|
|
145890
|
+
|
|
145891
|
+
var value=vol/flowCapital*100;
|
|
145892
|
+
item.Text=value.toFixed(2)+'%';
|
|
145893
|
+
|
|
145894
|
+
return item;
|
|
145895
|
+
}
|
|
145896
|
+
|
|
145897
|
+
|
|
145898
|
+
//持仓
|
|
145899
|
+
this.FormatPosition=function(position, TitleID)
|
|
145900
|
+
{
|
|
145901
|
+
//持仓
|
|
145902
|
+
var item=
|
|
145903
|
+
{
|
|
145904
|
+
Title:g_JSChartLocalization.GetText(TitleID,this.LanguageID),
|
|
145905
|
+
Text:'--.--',
|
|
145906
|
+
Color:this.PositionColor
|
|
145907
|
+
};
|
|
145908
|
+
|
|
145909
|
+
if (!IFrameSplitOperator.IsNumber(position)) return item;
|
|
145910
|
+
|
|
145911
|
+
item.Text=position.toFixed(0);
|
|
145912
|
+
|
|
145913
|
+
return item;
|
|
145914
|
+
}
|
|
145915
|
+
|
|
145916
|
+
//结算价
|
|
145917
|
+
this.ForamtFClose=function(value, defaultfloatPrecision, TitleID)
|
|
145918
|
+
{
|
|
145919
|
+
var item=
|
|
145920
|
+
{
|
|
145921
|
+
Title:g_JSChartLocalization.GetText(TitleID,this.LanguageID),
|
|
145922
|
+
Text:'--.--',
|
|
145923
|
+
Color:this.DateTimeColor
|
|
145924
|
+
};
|
|
145925
|
+
|
|
145926
|
+
if (!IFrameSplitOperator.IsNumber(value)) return item;
|
|
145927
|
+
|
|
145928
|
+
item.Text=value.toFixed(defaultfloatPrecision);
|
|
145929
|
+
|
|
145930
|
+
return item;
|
|
145931
|
+
}
|
|
145932
|
+
|
|
145933
|
+
this.GetColor=function(price,yClose)
|
|
145934
|
+
{
|
|
145935
|
+
if(price>yClose) return this.UpColor;
|
|
145936
|
+
else if (price<yClose) return this.DownColor;
|
|
145937
|
+
else return this.UnchangeColor;
|
|
145938
|
+
}
|
|
145939
|
+
|
|
145940
|
+
|
|
145941
|
+
//配色修改
|
|
145942
|
+
this.ReloadResource=function(option)
|
|
145943
|
+
{
|
|
145944
|
+
this.UpColor=g_JSChartResource.UpTextColor;
|
|
145945
|
+
this.DownColor=g_JSChartResource.DownTextColor;
|
|
145946
|
+
this.UnchangeColor=g_JSChartResource.UnchagneTextColor;
|
|
145947
|
+
|
|
145948
|
+
this.BGColor=g_JSChartResource.FloatTooltip.BGColor;
|
|
145949
|
+
this.BorderColor=g_JSChartResource.FloatTooltip.BorderColor;
|
|
145950
|
+
|
|
145951
|
+
this.TextColor=g_JSChartResource.FloatTooltip.TextColor;
|
|
145952
|
+
this.ValueColor=g_JSChartResource.FloatTooltip.ValueColor;
|
|
145953
|
+
|
|
145954
|
+
this.VolColor=g_JSChartResource.FloatTooltip.VolColor;
|
|
145955
|
+
this.AmountColor=g_JSChartResource.FloatTooltip.AmountColor;
|
|
145956
|
+
this.TurnoverRateColor=g_JSChartResource.FloatTooltip.TurnoverRateColor;
|
|
145957
|
+
this.PositionColor=g_JSChartResource.FloatTooltip.PositionColor;
|
|
145958
|
+
this.DateTimeColor=g_JSChartResource.FloatTooltip.DateTimeColor;
|
|
145959
|
+
|
|
145960
|
+
if (!this.DivDialog) return;
|
|
145961
|
+
|
|
145962
|
+
this.UpdateStyle();
|
|
145963
|
+
}
|
|
145964
|
+
}
|
|
145047
145965
|
/*
|
|
145048
145966
|
Copyright (c) 2018 jones
|
|
145049
145967
|
|
|
@@ -146029,7 +146947,7 @@ function HQChartScriptWorker()
|
|
|
146029
146947
|
|
|
146030
146948
|
|
|
146031
146949
|
|
|
146032
|
-
var HQCHART_VERSION="1.1.
|
|
146950
|
+
var HQCHART_VERSION="1.1.14049";
|
|
146033
146951
|
|
|
146034
146952
|
function PrintHQChartVersion()
|
|
146035
146953
|
{
|