hqchart 1.1.13909 → 1.1.13911
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 +72 -22
- package/package.json +1 -1
- package/src/jscommon/umychart.DialogTooltip.js +422 -0
- package/src/jscommon/umychart.js +170 -0
- package/src/jscommon/umychart.resource/css/tools.css +77 -0
- package/src/jscommon/umychart.style.js +13 -1
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +184 -2
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.vue.js +606 -3
|
@@ -4420,6 +4420,7 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
4420
4420
|
|
|
4421
4421
|
if (IFrameSplitOperator.IsNumber(item.PriceFormatType)) chart.ChartCorssCursor.StringFormatY.PriceFormatType=item.PriceFormatType;
|
|
4422
4422
|
if (IFrameSplitOperator.IsNumber(item.DataFormatType)) chart.ChartCorssCursor.StringFormatY.DataFormatType=item.DataFormatType;
|
|
4423
|
+
if (IFrameSplitOperator.IsBool(item.EnableKeyboard)) chart.ChartCorssCursor.EnableKeyboard=item.EnableKeyboard;
|
|
4423
4424
|
|
|
4424
4425
|
}
|
|
4425
4426
|
|
|
@@ -5643,6 +5644,9 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
5643
5644
|
if (option.EnableDrawToolDialogV2===true) chart.InitalDrawToolDialog();
|
|
5644
5645
|
if (option.EnableModifyDrawDialogV2===true) chart.InitalModifyDrawDialog();
|
|
5645
5646
|
|
|
5647
|
+
//K线tooltip
|
|
5648
|
+
if (option.EnableTooltipDialog===true) chart.InitalTooltipDialog();
|
|
5649
|
+
|
|
5646
5650
|
//注册事件
|
|
5647
5651
|
if (option.EventCallback)
|
|
5648
5652
|
{
|
|
@@ -6944,6 +6948,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
6944
6948
|
this.DialogDrawTool; //画图工具
|
|
6945
6949
|
this.DialogModifyDraw; //画图修改
|
|
6946
6950
|
|
|
6951
|
+
this.DialogTooltip; //tooltip信息
|
|
6952
|
+
|
|
6947
6953
|
|
|
6948
6954
|
this.ClearStockCache=function()
|
|
6949
6955
|
{
|
|
@@ -6967,6 +6973,15 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
6967
6973
|
this.DialogDrawTool.Create();
|
|
6968
6974
|
}
|
|
6969
6975
|
|
|
6976
|
+
this.InitalTooltipDialog=function()
|
|
6977
|
+
{
|
|
6978
|
+
if (this.DialogTooltip) return;
|
|
6979
|
+
|
|
6980
|
+
this.DialogTooltip=new JSDialogTooltip();
|
|
6981
|
+
this.DialogTooltip.Inital(this);
|
|
6982
|
+
this.DialogTooltip.Create();
|
|
6983
|
+
}
|
|
6984
|
+
|
|
6970
6985
|
this.InitalModifyDrawDialog=function()
|
|
6971
6986
|
{
|
|
6972
6987
|
if ( this.DialogModifyDraw) return;
|
|
@@ -7023,6 +7038,22 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
7023
7038
|
this.DialogModifyDraw.Close();
|
|
7024
7039
|
}
|
|
7025
7040
|
|
|
7041
|
+
this.IsShowTooltipDialog=function()
|
|
7042
|
+
{
|
|
7043
|
+
if (!this.DialogTooltip) return false;
|
|
7044
|
+
|
|
7045
|
+
return this.DialogTooltip.IsShow();
|
|
7046
|
+
}
|
|
7047
|
+
|
|
7048
|
+
this.CloseTooltipDialog=function()
|
|
7049
|
+
{
|
|
7050
|
+
if (!this.DialogTooltip) return;
|
|
7051
|
+
|
|
7052
|
+
this.DialogTooltip.Close();
|
|
7053
|
+
}
|
|
7054
|
+
|
|
7055
|
+
|
|
7056
|
+
|
|
7026
7057
|
//obj={ Element:, Canvas: }
|
|
7027
7058
|
this.SetCorssCursorElement=function(obj)
|
|
7028
7059
|
{
|
|
@@ -9392,6 +9423,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
9392
9423
|
{
|
|
9393
9424
|
this.ChartCorssCursor.Canvas=this.Canvas;
|
|
9394
9425
|
}
|
|
9426
|
+
|
|
9427
|
+
this.DrawTooltipDialog();
|
|
9395
9428
|
}
|
|
9396
9429
|
|
|
9397
9430
|
ptPosition=this.Frame.PtInFrame(this.LastPoint.X, this.LastPoint.Y);
|
|
@@ -9841,6 +9874,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
9841
9874
|
{
|
|
9842
9875
|
this.ChartCorssCursor.Canvas=this.Canvas;
|
|
9843
9876
|
}
|
|
9877
|
+
|
|
9878
|
+
this.DrawTooltipDialog();
|
|
9844
9879
|
}
|
|
9845
9880
|
|
|
9846
9881
|
var ptPosition=null; //鼠标位置 null 无效 -1 在外面 >=0 对应的指标窗口中ID
|
|
@@ -10363,6 +10398,15 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
10363
10398
|
}
|
|
10364
10399
|
|
|
10365
10400
|
var keyID = e.keyCode ? e.keyCode :e.which;
|
|
10401
|
+
|
|
10402
|
+
var draw=false;
|
|
10403
|
+
if (this.ChartCorssCursor && this.ChartCorssCursor.OnKeyDown) //十字光标 隐藏显示
|
|
10404
|
+
{
|
|
10405
|
+
var sendData={ e:e, KeyID:keyID, Draw:false, PreventDefault:false };
|
|
10406
|
+
this.ChartCorssCursor.OnKeyDown(sendData);
|
|
10407
|
+
draw=sendData.Draw;
|
|
10408
|
+
}
|
|
10409
|
+
|
|
10366
10410
|
switch(keyID)
|
|
10367
10411
|
{
|
|
10368
10412
|
case 37: //left
|
|
@@ -10505,6 +10549,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
10505
10549
|
return;
|
|
10506
10550
|
}
|
|
10507
10551
|
|
|
10552
|
+
if (draw) this.DrawDynamicInfo();
|
|
10553
|
+
|
|
10508
10554
|
//不让滚动条滚动
|
|
10509
10555
|
if(e.preventDefault) e.preventDefault();
|
|
10510
10556
|
else e.returnValue = false;
|
|
@@ -10812,6 +10858,11 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
10812
10858
|
this.ShowTooltip(this.LastPoint.X/pixelTatio,this.LastPoint.Y/pixelTatio,toolTip);
|
|
10813
10859
|
}
|
|
10814
10860
|
|
|
10861
|
+
this.DrawTooltipDialog=function()
|
|
10862
|
+
{
|
|
10863
|
+
|
|
10864
|
+
}
|
|
10865
|
+
|
|
10815
10866
|
this.ShowTooltip=function(x,y,toolTip)
|
|
10816
10867
|
{
|
|
10817
10868
|
if (!this.IsShowTooltip) return;
|
|
@@ -11921,6 +11972,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
11921
11972
|
else if (option.Draw==true) this.Draw(); //是否立即重绘
|
|
11922
11973
|
|
|
11923
11974
|
if (this.PopMinuteChart) this.PopMinuteChart.ReloadResource(option);
|
|
11975
|
+
if (this.DialogTooltip) this.DialogTooltip.ReloadResource(option);
|
|
11924
11976
|
}
|
|
11925
11977
|
|
|
11926
11978
|
this.ReloadBorder=function(option) //根据页面缩放调整对应边框的尺长
|
|
@@ -13910,6 +13962,19 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
13910
13962
|
item.Status=OVERLAY_STATUS_ID.STATUS_NONE_ID;
|
|
13911
13963
|
}
|
|
13912
13964
|
}
|
|
13965
|
+
|
|
13966
|
+
//十字光标状态变动
|
|
13967
|
+
this.OnChangeCorssCursorStatus=function(data, obj)
|
|
13968
|
+
{
|
|
13969
|
+
if (data.Type==1)
|
|
13970
|
+
{
|
|
13971
|
+
if (!data.IsShowCorss) //十字光标隐藏
|
|
13972
|
+
{
|
|
13973
|
+
this.HideTooltip();
|
|
13974
|
+
this.CloseTooltipDialog();
|
|
13975
|
+
}
|
|
13976
|
+
}
|
|
13977
|
+
}
|
|
13913
13978
|
}
|
|
13914
13979
|
|
|
13915
13980
|
function GetDevicePixelRatio()
|
|
@@ -54594,6 +54659,9 @@ function ChartCorssCursor()
|
|
|
54594
54659
|
this.IsShowClose=false; //Y轴始终显示收盘价
|
|
54595
54660
|
this.ClientPos=-1;
|
|
54596
54661
|
this.CallAcutionXOperator;
|
|
54662
|
+
|
|
54663
|
+
this.EnableKeyboard=false; //是否支持键盘隐藏显示
|
|
54664
|
+
this.OnChangeStatusCallback; //状态切换以后回调
|
|
54597
54665
|
|
|
54598
54666
|
|
|
54599
54667
|
this.RightButton=
|
|
@@ -55772,6 +55840,29 @@ function ChartCorssCursor()
|
|
|
55772
55840
|
|
|
55773
55841
|
this.Status=1;
|
|
55774
55842
|
}
|
|
55843
|
+
|
|
55844
|
+
//data={ e:e, PreventDefault:false, KeyID, Draw:是否需要重绘 }
|
|
55845
|
+
this.OnKeyDown=function(data)
|
|
55846
|
+
{
|
|
55847
|
+
if (!this.EnableKeyboard) return;
|
|
55848
|
+
|
|
55849
|
+
var keyID=data.KeyID;
|
|
55850
|
+
if (keyID==27) //ESC 隐藏十字线
|
|
55851
|
+
{
|
|
55852
|
+
if (!this.IsShowCorss) return;
|
|
55853
|
+
this.IsShowCorss=false;
|
|
55854
|
+
data.Draw=true;
|
|
55855
|
+
if (this.OnChangeStatusCallback) this.OnChangeStatusCallback({ Type:1, IsShowCorss:this.IsShowCorss }, this);
|
|
55856
|
+
}
|
|
55857
|
+
else if (keyID==37 || keyID==39) //left, right 显示十字线
|
|
55858
|
+
{
|
|
55859
|
+
if (this.IsShowCorss) return;
|
|
55860
|
+
this.IsShowCorss=true;
|
|
55861
|
+
data.Draw=true;
|
|
55862
|
+
if (this.OnChangeStatusCallback) this.OnChangeStatusCallback({ Type:1, IsShowCorss:this.IsShowCorss }, this);
|
|
55863
|
+
}
|
|
55864
|
+
}
|
|
55865
|
+
|
|
55775
55866
|
}
|
|
55776
55867
|
|
|
55777
55868
|
|
|
@@ -72822,6 +72913,18 @@ function JSChartResource()
|
|
|
72822
72913
|
LineHeight:25 //单行高度
|
|
72823
72914
|
};
|
|
72824
72915
|
|
|
72916
|
+
this.DialogTooltip=
|
|
72917
|
+
{
|
|
72918
|
+
BGColor:'rgb(250,250,250)', //背景色
|
|
72919
|
+
BorderColor:'rgb(20,20,20)', //边框颜色
|
|
72920
|
+
TitleColor:'rgb(0,0,0)', //标题颜色
|
|
72921
|
+
VolColor:"rgb(255, 185, 15)", //标题成交量
|
|
72922
|
+
AmountColor:"rgb(79, 79, 79)", //成交金额
|
|
72923
|
+
DateTimeColor:'rgb(60,60,60)',
|
|
72924
|
+
TurnoverRateColor:'rgb(43,54,69)', //换手率
|
|
72925
|
+
PositionColor:"rgb(43,54,69)" //持仓
|
|
72926
|
+
}
|
|
72927
|
+
|
|
72825
72928
|
//弹幕
|
|
72826
72929
|
this.Barrage= {
|
|
72827
72930
|
Font:16*GetDevicePixelRatio() +'px 微软雅黑', //字体
|
|
@@ -73804,6 +73907,21 @@ function JSChartResource()
|
|
|
73804
73907
|
if (item.AmountColor) this.PCTooltipPaint.AmountColor=item.AmountColor;
|
|
73805
73908
|
}
|
|
73806
73909
|
|
|
73910
|
+
if (style.DialogTooltip)
|
|
73911
|
+
{
|
|
73912
|
+
var item=style.DialogTooltip;
|
|
73913
|
+
if (item.BGColor) this.DialogTooltip.BGColor=item.BGColor;
|
|
73914
|
+
if (item.BorderColor) this.DialogTooltip.BorderColor=item.BorderColor;
|
|
73915
|
+
if (item.TitleColor) this.DialogTooltip.TitleColor=item.TitleColor;
|
|
73916
|
+
if (item.DateTimeColor) this.DialogTooltip.DateTimeColor=item.DateTimeColor;
|
|
73917
|
+
|
|
73918
|
+
if (item.VolColor) this.DialogTooltip.VolColor=item.VolColor;
|
|
73919
|
+
if (item.AmountColor) this.DialogTooltip.AmountColor=item.AmountColor;
|
|
73920
|
+
if (item.TurnoverRateColor) this.DialogTooltip.TurnoverRateColor=item.TurnoverRateColor;
|
|
73921
|
+
if (item.PositionColor) this.DialogTooltip.PositionColor=item.PositionColor;
|
|
73922
|
+
|
|
73923
|
+
}
|
|
73924
|
+
|
|
73807
73925
|
if (style.MinuteInfo)
|
|
73808
73926
|
{
|
|
73809
73927
|
var item=style.MinuteInfo;
|
|
@@ -74747,6 +74865,20 @@ function JSChartLocalization()
|
|
|
74747
74865
|
['DivTooltip-Position', {CN:'持仓:', EN:'Position:', TC:'持倉'}],
|
|
74748
74866
|
['DivTooltip-Price', {CN:'价格:', EN:'Open:', TC:'價格'}],
|
|
74749
74867
|
|
|
74868
|
+
['DialogTooltip-Date', {CN:'日期', EN:'Date', TC:'日期'}],
|
|
74869
|
+
['DialogTooltip-Time', {CN:'时间', EN:'Time', TC:'時間'}],
|
|
74870
|
+
['DialogTooltip-Open', {CN:'开盘价', EN:'Open', TC:'開盤價'}],
|
|
74871
|
+
['DialogTooltip-High', {CN:'最高价', EN:'High', TC:'最高價'}],
|
|
74872
|
+
['DialogTooltip-Low', {CN:'最低价', EN:'Low', TC:'最低價'}],
|
|
74873
|
+
['DialogTooltip-Close', {CN:'收盘价', EN:'Close', TC:'收盤價'}],
|
|
74874
|
+
['DialogTooltip-Increase', {CN:'涨幅', EN:'Increase', TC:'漲幅'}],
|
|
74875
|
+
['DialogTooltip-Vol', {CN:'成交量', EN:'Volume', TC:'數量'}],
|
|
74876
|
+
['DialogTooltip-Amount', {CN:'成交额', EN:'Amount', TC:'金額'}],
|
|
74877
|
+
['DialogTooltip-Exchange', {CN:'换手率', EN:'Exchange', TC:'換手'}],
|
|
74878
|
+
['DialogTooltip-Position', {CN:'持仓量', EN:'Position', TC:'持倉'}],
|
|
74879
|
+
['DialogTooltip-Price', {CN:'价格', EN:'Open', TC:'價格'}],
|
|
74880
|
+
['DialogTooltip-Amplitude', {CN:'振幅', EN:'amplitude', TC:'價格'}],
|
|
74881
|
+
|
|
74750
74882
|
//走势图PC tooltip
|
|
74751
74883
|
['PCTooltip-Date', {CN:'日期', EN:'Date', TC:"日期"}],
|
|
74752
74884
|
['PCTooltip-Time', {CN:'时间', EN:'Time', TC:"時間"}],
|
|
@@ -76497,6 +76629,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
76497
76629
|
this.ChartCorssCursor.StringFormatY.LanguageID=this.LanguageID;
|
|
76498
76630
|
this.ChartCorssCursor.StringFormatY.ExtendChartPaint=this.ExtendChartPaint;
|
|
76499
76631
|
this.ChartCorssCursor.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
76632
|
+
this.ChartCorssCursor.OnChangeStatusCallback=(data, obj)=>{ this.OnChangeCorssCursorStatus(data,obj); }
|
|
76500
76633
|
|
|
76501
76634
|
//创建等待提示
|
|
76502
76635
|
this.ChartSplashPaint = new ChartSplashPaint();
|
|
@@ -83031,6 +83164,42 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
83031
83164
|
|
|
83032
83165
|
this.Draw();
|
|
83033
83166
|
}
|
|
83167
|
+
|
|
83168
|
+
this.DrawTooltipDialog=function()
|
|
83169
|
+
{
|
|
83170
|
+
if (!this.DialogTooltip) return;
|
|
83171
|
+
|
|
83172
|
+
this.UpdateTooltipDialog();
|
|
83173
|
+
}
|
|
83174
|
+
|
|
83175
|
+
this.UpdateTooltipDialog=function()
|
|
83176
|
+
{
|
|
83177
|
+
if (!this.DialogTooltip) return false;
|
|
83178
|
+
if (!this.ChartCorssCursor) return false;
|
|
83179
|
+
|
|
83180
|
+
var kItem=null;
|
|
83181
|
+
if (this.ChartCorssCursor.ClientPos>=0)
|
|
83182
|
+
{
|
|
83183
|
+
var hisData=this.ChartOperator_Temp_GetHistroyData();;
|
|
83184
|
+
if (!hisData) return false; //数据还没有到达
|
|
83185
|
+
|
|
83186
|
+
var dataIndex=hisData.DataOffset+this.ChartCorssCursor.CursorIndex;
|
|
83187
|
+
var kItem=hisData.Data[dataIndex];
|
|
83188
|
+
}
|
|
83189
|
+
|
|
83190
|
+
var sendData=
|
|
83191
|
+
{
|
|
83192
|
+
ClientPos:this.ChartCorssCursor.ClientPos, //位置
|
|
83193
|
+
IsShowCorss:this.ChartCorssCursor.IsShowCorss, //是否显示十字线
|
|
83194
|
+
KItem:kItem,
|
|
83195
|
+
Symbol:this.Symbol, Name:this.Name,
|
|
83196
|
+
};
|
|
83197
|
+
|
|
83198
|
+
|
|
83199
|
+
this.DialogTooltip.Update(sendData);
|
|
83200
|
+
|
|
83201
|
+
return true;
|
|
83202
|
+
}
|
|
83034
83203
|
}
|
|
83035
83204
|
|
|
83036
83205
|
//API 返回数据 转化为array[]
|
|
@@ -84711,6 +84880,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
84711
84880
|
}
|
|
84712
84881
|
|
|
84713
84882
|
var keyID = e.keyCode ? e.keyCode :e.which;
|
|
84883
|
+
|
|
84714
84884
|
switch(keyID)
|
|
84715
84885
|
{
|
|
84716
84886
|
case 37: //left
|
|
@@ -125065,7 +125235,19 @@ function GetBlackStyle()
|
|
|
125065
125235
|
VolColor:"rgb(161,154,3)", //标题成交量
|
|
125066
125236
|
AmountColor:"rgb(161,154,3)", //成交金额
|
|
125067
125237
|
},
|
|
125068
|
-
|
|
125238
|
+
|
|
125239
|
+
DialogTooltip:
|
|
125240
|
+
{
|
|
125241
|
+
BGColor:'rgb(20,20,20)', //背景色
|
|
125242
|
+
BorderColor:'rgb(170,170,170)', //边框颜色
|
|
125243
|
+
TitleColor:'rgb(210,210,210)', //标题颜色
|
|
125244
|
+
VolColor:"rgb(255, 185, 15)", //标题成交量
|
|
125245
|
+
AmountColor:"rgb(210,210,210)", //成交金额
|
|
125246
|
+
DateTimeColor:'rgb(210,210,210)',
|
|
125247
|
+
TurnoverRateColor:'rgb(43,54,69)', //换手率
|
|
125248
|
+
PositionColor:"rgb(43,54,69)" //持仓
|
|
125249
|
+
},
|
|
125250
|
+
|
|
125069
125251
|
//走势图 信息地雷
|
|
125070
125252
|
MinuteInfo:
|
|
125071
125253
|
{
|
|
@@ -138507,7 +138689,7 @@ function ScrollBarBGChart()
|
|
|
138507
138689
|
|
|
138508
138690
|
|
|
138509
138691
|
|
|
138510
|
-
var HQCHART_VERSION="1.1.
|
|
138692
|
+
var HQCHART_VERSION="1.1.13910";
|
|
138511
138693
|
|
|
138512
138694
|
function PrintHQChartVersion()
|
|
138513
138695
|
{
|