hqchart 1.1.15696 → 1.1.15708
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 +46 -29
- package/package.json +1 -1
- package/src/jscommon/umychart.DialogTooltip.js +53 -1
- package/src/jscommon/umychart.StockInfo.js +123 -14
- package/src/jscommon/umychart.complier.js +10 -0
- package/src/jscommon/umychart.js +107 -86
- package/src/jscommon/umychart.style.js +2 -2
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +120 -89
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.vue.js +296 -104
|
@@ -5358,6 +5358,7 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
5358
5358
|
}
|
|
5359
5359
|
|
|
5360
5360
|
chart.SetSubFrameAttribute(chart.Frame.SubFrame[index],item, null);
|
|
5361
|
+
chart.UpdateIndexTemporaryAttribute(i, item.AryTemporaryAttribute); //指标临时属性
|
|
5361
5362
|
}
|
|
5362
5363
|
}
|
|
5363
5364
|
|
|
@@ -17017,6 +17018,88 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
17017
17018
|
|
|
17018
17019
|
script.RecvSubscribeData(data,this,overlayIndex.WindowIndex,kData);
|
|
17019
17020
|
}
|
|
17021
|
+
|
|
17022
|
+
this.UpdateIndexTemporaryAttribute=function(windowIndex, aryAttribute)
|
|
17023
|
+
{
|
|
17024
|
+
if (windowIndex<0) return;
|
|
17025
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(aryAttribute)) return;
|
|
17026
|
+
if (!this.Frame || !IFrameSplitOperator.IsNonEmptyArray(this.Frame.SubFrame)) return;
|
|
17027
|
+
var mainFrame=this.Frame.SubFrame[windowIndex].Frame;
|
|
17028
|
+
|
|
17029
|
+
this.IndexTemporaryAttribute[windowIndex]=[];
|
|
17030
|
+
var aryTemporaryAttribute=this.IndexTemporaryAttribute[windowIndex];
|
|
17031
|
+
|
|
17032
|
+
for(var i=0;i<aryAttribute.length;++i)
|
|
17033
|
+
{
|
|
17034
|
+
var item=aryAttribute[i];
|
|
17035
|
+
if (item.Name==JSCHART_TEMPORARY_ATTRIBUTE.MAINFRAME.BOTTOMSPACE)
|
|
17036
|
+
{
|
|
17037
|
+
var backup=mainFrame.ChartBorder.BottomSpace;
|
|
17038
|
+
mainFrame.ChartBorder.BottomSpace=item.Value;
|
|
17039
|
+
aryTemporaryAttribute.push({ Name:item.Name, Value:item.Value, BackupValue:backup });
|
|
17040
|
+
}
|
|
17041
|
+
else if (item.Name==JSCHART_TEMPORARY_ATTRIBUTE.MAINFRAME.TOPSPACE)
|
|
17042
|
+
{
|
|
17043
|
+
var backup=mainFrame.ChartBorder.TopSpace;
|
|
17044
|
+
mainFrame.ChartBorder.TopSpace=item.Value;
|
|
17045
|
+
aryTemporaryAttribute.push({ Name:item.Name, Value:item.Value, BackupValue:backup });
|
|
17046
|
+
}
|
|
17047
|
+
else if (item.Name==JSCHART_TEMPORARY_ATTRIBUTE.MAINFRAME.SHOWLEFTTEXT)
|
|
17048
|
+
{
|
|
17049
|
+
var backup=mainFrame.YSplitOperator.IsShowLeftText;
|
|
17050
|
+
mainFrame.YSplitOperator.IsShowLeftText=item.Value;
|
|
17051
|
+
aryTemporaryAttribute.push({ Name:item.Name, Value:item.Value, BackupValue:backup });
|
|
17052
|
+
}
|
|
17053
|
+
else if (item.Name==JSCHART_TEMPORARY_ATTRIBUTE.MAINFRAME.SHOWRIGHTTEXT)
|
|
17054
|
+
{
|
|
17055
|
+
var backup=mainFrame.YSplitOperator.IsShowRightText;
|
|
17056
|
+
mainFrame.YSplitOperator.IsShowRightText=item.Value;
|
|
17057
|
+
aryTemporaryAttribute.push({ Name:item.Name, Value:item.Value, BackupValue:backup });
|
|
17058
|
+
}
|
|
17059
|
+
else if (item.Name==JSCHART_TEMPORARY_ATTRIBUTE.MAINFRAME.SPLITTYPE)
|
|
17060
|
+
{
|
|
17061
|
+
var backup=mainFrame.YSplitOperator.SplitType;
|
|
17062
|
+
mainFrame.YSplitOperator.SplitType=item.Value;
|
|
17063
|
+
aryTemporaryAttribute.push({ Name:item.Name, Value:item.Value, BackupValue:backup });
|
|
17064
|
+
}
|
|
17065
|
+
|
|
17066
|
+
}
|
|
17067
|
+
}
|
|
17068
|
+
|
|
17069
|
+
this.RestoreIndexTemporaryAttribute=function(windowIndex)
|
|
17070
|
+
{
|
|
17071
|
+
if (windowIndex<0) return;
|
|
17072
|
+
if (!this.Frame || !IFrameSplitOperator.IsNonEmptyArray(this.Frame.SubFrame)) return;
|
|
17073
|
+
var aryTemporaryAttribute=this.IndexTemporaryAttribute[windowIndex];
|
|
17074
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(aryTemporaryAttribute)) return;
|
|
17075
|
+
var mainFrame=this.Frame.SubFrame[windowIndex].Frame;
|
|
17076
|
+
|
|
17077
|
+
for(var i=0;i<aryTemporaryAttribute.length;++i)
|
|
17078
|
+
{
|
|
17079
|
+
var item=aryTemporaryAttribute[i];
|
|
17080
|
+
if (item.Name==JSCHART_TEMPORARY_ATTRIBUTE.MAINFRAME.BOTTOMSPACE)
|
|
17081
|
+
{
|
|
17082
|
+
mainFrame.ChartBorder.BottomSpace=item.BackupValue;
|
|
17083
|
+
}
|
|
17084
|
+
else if (item.Name==JSCHART_TEMPORARY_ATTRIBUTE.MAINFRAME.TOPSPACE)
|
|
17085
|
+
{
|
|
17086
|
+
mainFrame.ChartBorder.TopSpace=item.BackupValue;
|
|
17087
|
+
}
|
|
17088
|
+
else if (item.Name==JSCHART_TEMPORARY_ATTRIBUTE.MAINFRAME.SHOWLEFTTEXT)
|
|
17089
|
+
{
|
|
17090
|
+
mainFrame.YSplitOperator.IsShowLeftText=item.BackupValue;
|
|
17091
|
+
}
|
|
17092
|
+
else if (item.Name==JSCHART_TEMPORARY_ATTRIBUTE.MAINFRAME.SHOWRIGHTTEXT)
|
|
17093
|
+
{
|
|
17094
|
+
mainFrame.YSplitOperator.IsShowRightText=item.BackupValue;
|
|
17095
|
+
}
|
|
17096
|
+
else if (item.Name==JSCHART_TEMPORARY_ATTRIBUTE.MAINFRAME.SPLITTYPE)
|
|
17097
|
+
{
|
|
17098
|
+
mainFrame.YSplitOperator.SplitType=item.BackupValue;
|
|
17099
|
+
}
|
|
17100
|
+
}
|
|
17101
|
+
|
|
17102
|
+
}
|
|
17020
17103
|
}
|
|
17021
17104
|
|
|
17022
17105
|
function GetDevicePixelRatio()
|
|
@@ -83902,7 +83985,7 @@ function JSChartResource()
|
|
|
83902
83985
|
{
|
|
83903
83986
|
BuyColor:"rgb(242,54,69)",
|
|
83904
83987
|
SellColor:"rgb(8,153,129)",
|
|
83905
|
-
BarWidth:
|
|
83988
|
+
BarWidth:2*GetDevicePixelRatio(),
|
|
83906
83989
|
MaxBarWidth:120,
|
|
83907
83990
|
YOffset:1,
|
|
83908
83991
|
Font:`${12*GetDevicePixelRatio()}px 微软雅黑`,
|
|
@@ -97116,88 +97199,6 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
97116
97199
|
|
|
97117
97200
|
this.Draw();
|
|
97118
97201
|
}
|
|
97119
|
-
|
|
97120
|
-
this.UpdateIndexTemporaryAttribute=function(windowIndex, aryAttribute)
|
|
97121
|
-
{
|
|
97122
|
-
if (windowIndex<0) return;
|
|
97123
|
-
if (!IFrameSplitOperator.IsNonEmptyArray(aryAttribute)) return;
|
|
97124
|
-
if (!this.Frame || !IFrameSplitOperator.IsNonEmptyArray(this.Frame.SubFrame)) return;
|
|
97125
|
-
var mainFrame=this.Frame.SubFrame[windowIndex].Frame;
|
|
97126
|
-
|
|
97127
|
-
this.IndexTemporaryAttribute[windowIndex]=[];
|
|
97128
|
-
var aryTemporaryAttribute=this.IndexTemporaryAttribute[windowIndex];
|
|
97129
|
-
|
|
97130
|
-
for(var i=0;i<aryAttribute.length;++i)
|
|
97131
|
-
{
|
|
97132
|
-
var item=aryAttribute[i];
|
|
97133
|
-
if (item.Name==JSCHART_TEMPORARY_ATTRIBUTE.MAINFRAME.BOTTOMSPACE)
|
|
97134
|
-
{
|
|
97135
|
-
var backup=mainFrame.ChartBorder.BottomSpace;
|
|
97136
|
-
mainFrame.ChartBorder.BottomSpace=item.Value;
|
|
97137
|
-
aryTemporaryAttribute.push({ Name:item.Name, Value:item.Value, BackupValue:backup });
|
|
97138
|
-
}
|
|
97139
|
-
else if (item.Name==JSCHART_TEMPORARY_ATTRIBUTE.MAINFRAME.TOPSPACE)
|
|
97140
|
-
{
|
|
97141
|
-
var backup=mainFrame.ChartBorder.TopSpace;
|
|
97142
|
-
mainFrame.ChartBorder.TopSpace=item.Value;
|
|
97143
|
-
aryTemporaryAttribute.push({ Name:item.Name, Value:item.Value, BackupValue:backup });
|
|
97144
|
-
}
|
|
97145
|
-
else if (item.Name==JSCHART_TEMPORARY_ATTRIBUTE.MAINFRAME.SHOWLEFTTEXT)
|
|
97146
|
-
{
|
|
97147
|
-
var backup=mainFrame.YSplitOperator.IsShowLeftText;
|
|
97148
|
-
mainFrame.YSplitOperator.IsShowLeftText=item.Value;
|
|
97149
|
-
aryTemporaryAttribute.push({ Name:item.Name, Value:item.Value, BackupValue:backup });
|
|
97150
|
-
}
|
|
97151
|
-
else if (item.Name==JSCHART_TEMPORARY_ATTRIBUTE.MAINFRAME.SHOWRIGHTTEXT)
|
|
97152
|
-
{
|
|
97153
|
-
var backup=mainFrame.YSplitOperator.IsShowRightText;
|
|
97154
|
-
mainFrame.YSplitOperator.IsShowRightText=item.Value;
|
|
97155
|
-
aryTemporaryAttribute.push({ Name:item.Name, Value:item.Value, BackupValue:backup });
|
|
97156
|
-
}
|
|
97157
|
-
else if (item.Name==JSCHART_TEMPORARY_ATTRIBUTE.MAINFRAME.SPLITTYPE)
|
|
97158
|
-
{
|
|
97159
|
-
var backup=mainFrame.YSplitOperator.SplitType;
|
|
97160
|
-
mainFrame.YSplitOperator.SplitType=item.Value;
|
|
97161
|
-
aryTemporaryAttribute.push({ Name:item.Name, Value:item.Value, BackupValue:backup });
|
|
97162
|
-
}
|
|
97163
|
-
|
|
97164
|
-
}
|
|
97165
|
-
}
|
|
97166
|
-
|
|
97167
|
-
this.RestoreIndexTemporaryAttribute=function(windowIndex)
|
|
97168
|
-
{
|
|
97169
|
-
if (windowIndex<0) return;
|
|
97170
|
-
if (!this.Frame || !IFrameSplitOperator.IsNonEmptyArray(this.Frame.SubFrame)) return;
|
|
97171
|
-
var aryTemporaryAttribute=this.IndexTemporaryAttribute[windowIndex];
|
|
97172
|
-
if (!IFrameSplitOperator.IsNonEmptyArray(aryTemporaryAttribute)) return;
|
|
97173
|
-
var mainFrame=this.Frame.SubFrame[windowIndex].Frame;
|
|
97174
|
-
|
|
97175
|
-
for(var i=0;i<aryTemporaryAttribute.length;++i)
|
|
97176
|
-
{
|
|
97177
|
-
var item=aryTemporaryAttribute[i];
|
|
97178
|
-
if (item.Name==JSCHART_TEMPORARY_ATTRIBUTE.MAINFRAME.BOTTOMSPACE)
|
|
97179
|
-
{
|
|
97180
|
-
mainFrame.ChartBorder.BottomSpace=item.BackupValue;
|
|
97181
|
-
}
|
|
97182
|
-
else if (item.Name==JSCHART_TEMPORARY_ATTRIBUTE.MAINFRAME.TOPSPACE)
|
|
97183
|
-
{
|
|
97184
|
-
mainFrame.ChartBorder.TopSpace=item.BackupValue;
|
|
97185
|
-
}
|
|
97186
|
-
else if (item.Name==JSCHART_TEMPORARY_ATTRIBUTE.MAINFRAME.SHOWLEFTTEXT)
|
|
97187
|
-
{
|
|
97188
|
-
mainFrame.YSplitOperator.IsShowLeftText=item.BackupValue;
|
|
97189
|
-
}
|
|
97190
|
-
else if (item.Name==JSCHART_TEMPORARY_ATTRIBUTE.MAINFRAME.SHOWRIGHTTEXT)
|
|
97191
|
-
{
|
|
97192
|
-
mainFrame.YSplitOperator.IsShowRightText=item.BackupValue;
|
|
97193
|
-
}
|
|
97194
|
-
else if (item.Name==JSCHART_TEMPORARY_ATTRIBUTE.MAINFRAME.SPLITTYPE)
|
|
97195
|
-
{
|
|
97196
|
-
mainFrame.YSplitOperator.SplitType=item.BackupValue;
|
|
97197
|
-
}
|
|
97198
|
-
}
|
|
97199
|
-
|
|
97200
|
-
}
|
|
97201
97202
|
}
|
|
97202
97203
|
|
|
97203
97204
|
//API 返回数据 转化为array[]
|
|
@@ -97614,7 +97615,8 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
97614
97615
|
delete this.newMethod;
|
|
97615
97616
|
|
|
97616
97617
|
this.ClassName='MinuteChartContainer';
|
|
97617
|
-
this.WindowIndex=
|
|
97618
|
+
this.WindowIndex=[];
|
|
97619
|
+
this.IndexTemporaryAttribute=[]; //指标临时属性,切换指标时会清除
|
|
97618
97620
|
this.Symbol;
|
|
97619
97621
|
this.AryDate; //日期列表[]
|
|
97620
97622
|
this.Name;
|
|
@@ -100453,8 +100455,17 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
100453
100455
|
this.ChangeScriptIndex=function(windowIndex,indexData,option)
|
|
100454
100456
|
{
|
|
100455
100457
|
this.DeleteIndexPaint(windowIndex, true);
|
|
100458
|
+
this.RestoreIndexTemporaryAttribute(windowIndex); //恢复临时属性
|
|
100456
100459
|
this.WindowIndex[windowIndex]=new ScriptIndex(indexData.Name,indexData.Script,indexData.Args,indexData); //脚本执行
|
|
100457
100460
|
|
|
100461
|
+
if (option)
|
|
100462
|
+
{
|
|
100463
|
+
if (option.AryTemporaryAttribute)
|
|
100464
|
+
{
|
|
100465
|
+
this.UpdateIndexTemporaryAttribute(windowIndex, option.AryTemporaryAttribute); //指标临时属性
|
|
100466
|
+
}
|
|
100467
|
+
}
|
|
100468
|
+
|
|
100458
100469
|
var bindData=this.SourceData;
|
|
100459
100470
|
this.BindIndexData(windowIndex,bindData); //执行脚本
|
|
100460
100471
|
|
|
@@ -100467,6 +100478,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
100467
100478
|
this.ChangeAPIIndex=function(windowIndex,indexData)
|
|
100468
100479
|
{
|
|
100469
100480
|
this.DeleteIndexPaint(windowIndex, true);
|
|
100481
|
+
this.RestoreIndexTemporaryAttribute(windowIndex); //恢复临时属性
|
|
100470
100482
|
//使用API挂接指标数据 API:{ Name:指标名字, Script:指标脚本可以为空, Args:参数可以为空, Url:指标执行地址 }
|
|
100471
100483
|
var apiItem=indexData.API;
|
|
100472
100484
|
this.WindowIndex[windowIndex]=new APIScriptIndex(apiItem.Name,apiItem.Script,apiItem.Args,indexData);
|
|
@@ -100474,6 +100486,11 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
100474
100486
|
if (indexData)
|
|
100475
100487
|
{
|
|
100476
100488
|
if (indexData.Window) this.SetFrameToolbar(windowIndex,indexData.Window);
|
|
100489
|
+
|
|
100490
|
+
if (indexData.AryTemporaryAttribute)
|
|
100491
|
+
{
|
|
100492
|
+
this.UpdateIndexTemporaryAttribute(windowIndex, indexData.AryTemporaryAttribute); //指标临时属性
|
|
100493
|
+
}
|
|
100477
100494
|
}
|
|
100478
100495
|
|
|
100479
100496
|
this.Frame.ClearUpDonwFrameYData({ Index:windowIndex });
|
|
@@ -100607,11 +100624,12 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
100607
100624
|
var bRefreshData= (dayCount!=null || symbol!=null);
|
|
100608
100625
|
|
|
100609
100626
|
//清空所有的指标图型
|
|
100610
|
-
for(var i=0;i<
|
|
100627
|
+
for(var i=0;i<currentLength;++i)
|
|
100611
100628
|
{
|
|
100612
100629
|
this.DeleteIndexPaint(i);
|
|
100613
100630
|
var frame=this.Frame.SubFrame[i];
|
|
100614
100631
|
if (!frame) continue;
|
|
100632
|
+
this.RestoreIndexTemporaryAttribute(i); //恢复临时属性
|
|
100615
100633
|
frame.YSpecificMaxMin=null;
|
|
100616
100634
|
frame.YSplitScale = null;
|
|
100617
100635
|
}
|
|
@@ -100697,6 +100715,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
100697
100715
|
}
|
|
100698
100716
|
|
|
100699
100717
|
this.SetSubFrameAttribute(this.Frame.SubFrame[windowIndex], item, frameItem);
|
|
100718
|
+
if (item) this.UpdateIndexTemporaryAttribute(windowIndex, item.AryTemporaryAttribute); //指标临时属性
|
|
100700
100719
|
}
|
|
100701
100720
|
|
|
100702
100721
|
//清空叠加指标
|
|
@@ -108461,7 +108480,6 @@ function IMinuteInfo()
|
|
|
108461
108480
|
this.RequestData=function(hqChart)
|
|
108462
108481
|
{
|
|
108463
108482
|
var self = this;
|
|
108464
|
-
this.Data=[];
|
|
108465
108483
|
var param=
|
|
108466
108484
|
{
|
|
108467
108485
|
HQChart:hqChart
|
|
@@ -108513,6 +108531,7 @@ function MarketEventInfo()
|
|
|
108513
108531
|
|
|
108514
108532
|
this.RecvData=function(recvData,param)
|
|
108515
108533
|
{
|
|
108534
|
+
this.Data=[];
|
|
108516
108535
|
if (recvData && recvData.ver==3)
|
|
108517
108536
|
{
|
|
108518
108537
|
this.RecvDataV3(recvData,param);
|
|
@@ -108589,6 +108608,8 @@ function MinuteNewsInfo()
|
|
|
108589
108608
|
|
|
108590
108609
|
this.RecvData=function(recvData,param)
|
|
108591
108610
|
{
|
|
108611
|
+
this.Data=[];
|
|
108612
|
+
|
|
108592
108613
|
if (!recvData || !IFrameSplitOperator.IsNonEmptyArray(recvData.list)) return;
|
|
108593
108614
|
|
|
108594
108615
|
for(var i=0;i<recvData.list.length;++i)
|
|
@@ -140676,6 +140697,16 @@ function APIScriptIndex(name,script,args,option, isOverlay)
|
|
|
140676
140697
|
outVarItem.Draw=drawItem;
|
|
140677
140698
|
result.push(outVarItem);
|
|
140678
140699
|
}
|
|
140700
|
+
else if (draw.DrawType==SCRIPT_CHART_NAME.DRAW_HORIZONTAL_CHANNEL)
|
|
140701
|
+
{
|
|
140702
|
+
drawItem.Name=draw.Name;
|
|
140703
|
+
drawItem.Type=draw.Type;
|
|
140704
|
+
drawItem.DrawType=draw.DrawType;
|
|
140705
|
+
drawItem.DrawData=draw.DrawData;
|
|
140706
|
+
drawItem.Config=draw.Config;
|
|
140707
|
+
outVarItem.Draw=drawItem;
|
|
140708
|
+
result.push(outVarItem);
|
|
140709
|
+
}
|
|
140679
140710
|
else
|
|
140680
140711
|
{
|
|
140681
140712
|
var find=g_ScriptIndexChartFactory.Get(draw.DrawType); //外部挂接
|
|
@@ -141470,8 +141501,8 @@ function GetBlackStyle()
|
|
|
141470
141501
|
|
|
141471
141502
|
BuySellBar:
|
|
141472
141503
|
{
|
|
141473
|
-
BuyColor:"rgb(
|
|
141474
|
-
SellColor:"rgb(
|
|
141504
|
+
BuyColor:"rgb(255,0,0)",
|
|
141505
|
+
SellColor:"rgb(0,255,0)",
|
|
141475
141506
|
Font:`${12*GetDevicePixelRatio()}px 微软雅黑`,
|
|
141476
141507
|
TextColor:"rgb(220,220,220)",
|
|
141477
141508
|
}
|
|
@@ -167328,7 +167359,7 @@ function JSFloatTooltip()
|
|
|
167328
167359
|
if (!this.DivDialog) return;
|
|
167329
167360
|
this.LanguageID=this.HQChart.LanguageID;
|
|
167330
167361
|
|
|
167331
|
-
if (data.DataType==1)
|
|
167362
|
+
if (data.DataType==1) //K线图|分时图
|
|
167332
167363
|
{
|
|
167333
167364
|
var tooltipData=data.Tooltip;
|
|
167334
167365
|
if (!tooltipData) return;
|
|
@@ -167417,6 +167448,10 @@ function JSFloatTooltip()
|
|
|
167417
167448
|
this.DealItemTooltip(data);
|
|
167418
167449
|
}
|
|
167419
167450
|
}
|
|
167451
|
+
else if (data.DataType==6) //五档买卖盘
|
|
167452
|
+
{
|
|
167453
|
+
this.StockInfoTooltip(data);
|
|
167454
|
+
}
|
|
167420
167455
|
}
|
|
167421
167456
|
|
|
167422
167457
|
this.UpdateRealtimeHQTooltip=function(data)
|
|
@@ -167839,6 +167874,54 @@ function JSFloatTooltip()
|
|
|
167839
167874
|
|
|
167840
167875
|
this.ShowTooltip(data);
|
|
167841
167876
|
}
|
|
167877
|
+
|
|
167878
|
+
this.StockInfoTooltip=function(data)
|
|
167879
|
+
{
|
|
167880
|
+
var tooltipData=data.Tooltip;
|
|
167881
|
+
var cellData=null;
|
|
167882
|
+
if (tooltipData.Data && tooltipData.Data.Data) cellData=tooltipData.Data.Data;
|
|
167883
|
+
if (!cellData) return;
|
|
167884
|
+
if (cellData.Type!=3) return;
|
|
167885
|
+
var aryData=null; //买卖5档数据
|
|
167886
|
+
if (cellData.Value && cellData.Value.AryData) aryData=cellData.Value.AryData;
|
|
167887
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(aryData)) return;
|
|
167888
|
+
|
|
167889
|
+
var aryText=[]; //输出内容
|
|
167890
|
+
var totalVol=0, totalAmount=0;
|
|
167891
|
+
for(var i=0;i<aryData.length && i<=cellData.Value.Index;++i)
|
|
167892
|
+
{
|
|
167893
|
+
var item=aryData[i];
|
|
167894
|
+
if (IFrameSplitOperator.IsNumber(item.Vol) && IFrameSplitOperator.IsNumber(item.Price))
|
|
167895
|
+
{
|
|
167896
|
+
totalVol+=item.Vol;
|
|
167897
|
+
totalAmount+=item.Price*item.Vol;
|
|
167898
|
+
}
|
|
167899
|
+
}
|
|
167900
|
+
|
|
167901
|
+
var strPrice="--.---"; //均价
|
|
167902
|
+
var avPrice=null;
|
|
167903
|
+
if (totalVol>0)
|
|
167904
|
+
{
|
|
167905
|
+
avPrice=totalAmount/totalVol;
|
|
167906
|
+
strPrice=avPrice.toFixed(3);
|
|
167907
|
+
}
|
|
167908
|
+
|
|
167909
|
+
var strIncrease='--.--%' //涨幅
|
|
167910
|
+
if (IFrameSplitOperator.IsNumber(avPrice) && IFrameSplitOperator.IsPlusNumber(cellData.Value.YClose))
|
|
167911
|
+
{
|
|
167912
|
+
var value=(avPrice-cellData.Value.YClose)/cellData.Value.YClose*100;
|
|
167913
|
+
strIncrease=`${value.toFixed(2)}%`;
|
|
167914
|
+
}
|
|
167915
|
+
|
|
167916
|
+
|
|
167917
|
+
var text=` 前${cellData.Value.Index+1}档 幅度:${strIncrease} 委托总量:${totalVol} 均价:${strPrice} `;
|
|
167918
|
+
var item={ Title:text, Color:this.TextColor, IsMergeCell:true ,TitleClassName:this.TitleAlign.Center };
|
|
167919
|
+
aryText.push(item);
|
|
167920
|
+
|
|
167921
|
+
this.AryText=aryText;
|
|
167922
|
+
this.UpdateTableDOM();
|
|
167923
|
+
this.ShowTooltip(data);
|
|
167924
|
+
}
|
|
167842
167925
|
|
|
167843
167926
|
this.UpdateTableDOM=function()
|
|
167844
167927
|
{
|
|
@@ -172663,6 +172746,7 @@ function JSStockInfoChart(divElement)
|
|
|
172663
172746
|
|
|
172664
172747
|
if (option.EnableResize==true) this.CreateResizeListener();
|
|
172665
172748
|
if (option.EnablePopMenuV2===true) chart.InitalPopMenu();
|
|
172749
|
+
if (option.FloatTooltip && option.FloatTooltip.Enable) chart.InitalFloatTooltip(option.FloatTooltip); //提示信息
|
|
172666
172750
|
|
|
172667
172751
|
if (option.Symbol)
|
|
172668
172752
|
{
|
|
@@ -172865,9 +172949,12 @@ function JSStockInfoChartContainer(uielement)
|
|
|
172865
172949
|
this.AutoUpdateFrequency=15000; //15秒更新一次数据
|
|
172866
172950
|
|
|
172867
172951
|
this.JSPopMenu; //内置菜单
|
|
172952
|
+
this.FloatTooltip; //提示浮框
|
|
172868
172953
|
|
|
172869
172954
|
this.UIElement=uielement;
|
|
172870
|
-
|
|
172955
|
+
|
|
172956
|
+
this.LastMouseStatus={ MoveStatus:null, TooltipStatus:null, MouseOnStatus:null };
|
|
172957
|
+
|
|
172871
172958
|
this.IsDestroy=false; //是否已经销毁了
|
|
172872
172959
|
|
|
172873
172960
|
this.ChartDestroy=function() //销毁
|
|
@@ -172876,6 +172963,58 @@ function JSStockInfoChartContainer(uielement)
|
|
|
172876
172963
|
this.StopAutoUpdate();
|
|
172877
172964
|
|
|
172878
172965
|
this.DestroyPopMenu();
|
|
172966
|
+
this.DestroyFloatTooltip();
|
|
172967
|
+
}
|
|
172968
|
+
|
|
172969
|
+
//内置提示信息
|
|
172970
|
+
this.HideFloatTooltip=function()
|
|
172971
|
+
{
|
|
172972
|
+
if (!this.FloatTooltip) return;
|
|
172973
|
+
|
|
172974
|
+
this.FloatTooltip.Hide();
|
|
172975
|
+
}
|
|
172976
|
+
|
|
172977
|
+
this.DestroyFloatTooltip=function()
|
|
172978
|
+
{
|
|
172979
|
+
if (!this.FloatTooltip) return;
|
|
172980
|
+
|
|
172981
|
+
this.FloatTooltip.Destroy();
|
|
172982
|
+
this.FloatTooltip=null;
|
|
172983
|
+
}
|
|
172984
|
+
|
|
172985
|
+
this.InitalFloatTooltip=function(option)
|
|
172986
|
+
{
|
|
172987
|
+
if (this.FloatTooltip) return;
|
|
172988
|
+
|
|
172989
|
+
this.FloatTooltip=new JSFloatTooltip();
|
|
172990
|
+
this.FloatTooltip.Inital(this, option);
|
|
172991
|
+
this.FloatTooltip.Create();
|
|
172992
|
+
}
|
|
172993
|
+
|
|
172994
|
+
this.DrawFloatTooltip=function(point,toolTip)
|
|
172995
|
+
{
|
|
172996
|
+
if (!this.FloatTooltip) return;
|
|
172997
|
+
|
|
172998
|
+
this.UpdateFloatTooltip(point, toolTip)
|
|
172999
|
+
}
|
|
173000
|
+
|
|
173001
|
+
this.UpdateFloatTooltip=function(point, toolTip)
|
|
173002
|
+
{
|
|
173003
|
+
if (!this.FloatTooltip) return;
|
|
173004
|
+
|
|
173005
|
+
var sendData=
|
|
173006
|
+
{
|
|
173007
|
+
Tooltip:toolTip,
|
|
173008
|
+
Point:point,
|
|
173009
|
+
DataType:6,
|
|
173010
|
+
};
|
|
173011
|
+
|
|
173012
|
+
this.FloatTooltip.Update(sendData);
|
|
173013
|
+
}
|
|
173014
|
+
|
|
173015
|
+
this.HideAllTooltip=function()
|
|
173016
|
+
{
|
|
173017
|
+
this.HideFloatTooltip();
|
|
172879
173018
|
}
|
|
172880
173019
|
|
|
172881
173020
|
//设置事件回调
|
|
@@ -173246,11 +173385,39 @@ function JSStockInfoChartContainer(uielement)
|
|
|
173246
173385
|
var x = (e.clientX-this.UIElement.getBoundingClientRect().left)*pixelTatio;
|
|
173247
173386
|
var y = (e.clientY-this.UIElement.getBoundingClientRect().top)*pixelTatio;
|
|
173248
173387
|
|
|
173388
|
+
this.LastMouseStatus.OnMouseMove={ X:x, Y:y };
|
|
173389
|
+
|
|
173390
|
+
var bDrawTooltip=false;
|
|
173391
|
+
if (this.LastMouseStatus.TooltipStatus) bDrawTooltip=true;
|
|
173392
|
+
this.LastMouseStatus.TooltipStatus=null;
|
|
173393
|
+
|
|
173249
173394
|
var option={ Update:false };
|
|
173250
173395
|
|
|
173251
173396
|
this.OnChartMouseMove(x,y,e,option);
|
|
173252
173397
|
|
|
173398
|
+
var tooltipData=this.GetChartTooltipData(x, y);
|
|
173399
|
+
if (tooltipData && tooltipData.Data)
|
|
173400
|
+
{
|
|
173401
|
+
var item=tooltipData.Data;
|
|
173402
|
+
if (item.Data && item.Data.Type==3) //5档买卖盘名字
|
|
173403
|
+
{
|
|
173404
|
+
this.LastMouseStatus.TooltipStatus={ X:x, Y:y, Data:tooltipData, ClientX:e.clientX, ClientY:e.clientY };
|
|
173405
|
+
bDrawTooltip=true;
|
|
173406
|
+
}
|
|
173407
|
+
}
|
|
173408
|
+
|
|
173253
173409
|
if (option.Update===true) this.Draw();
|
|
173410
|
+
|
|
173411
|
+
if (this.LastMouseStatus.TooltipStatus)
|
|
173412
|
+
{
|
|
173413
|
+
var xTooltip = e.clientX-this.UIElement.getBoundingClientRect().left;
|
|
173414
|
+
var yTooltip = e.clientY-this.UIElement.getBoundingClientRect().top;
|
|
173415
|
+
this.DrawFloatTooltip({X:xTooltip, Y:yTooltip, YMove:20/pixelTatio},this.LastMouseStatus.TooltipStatus.Data);
|
|
173416
|
+
}
|
|
173417
|
+
else
|
|
173418
|
+
{
|
|
173419
|
+
this.HideFloatTooltip();
|
|
173420
|
+
}
|
|
173254
173421
|
}
|
|
173255
173422
|
|
|
173256
173423
|
this.OnChartMouseMove=function(x, y, e, option)
|
|
@@ -173267,6 +173434,20 @@ function JSStockInfoChartContainer(uielement)
|
|
|
173267
173434
|
return false;
|
|
173268
173435
|
}
|
|
173269
173436
|
|
|
173437
|
+
this.GetChartTooltipData=function(x, y)
|
|
173438
|
+
{
|
|
173439
|
+
var toolTip=new TooltipData();
|
|
173440
|
+
for(var i=0;i<this.ChartPaint.length;++i)
|
|
173441
|
+
{
|
|
173442
|
+
var item=this.ChartPaint[i];
|
|
173443
|
+
if (item.GetTooltipData(x,y,toolTip))
|
|
173444
|
+
{
|
|
173445
|
+
return toolTip;
|
|
173446
|
+
}
|
|
173447
|
+
}
|
|
173448
|
+
return null;
|
|
173449
|
+
}
|
|
173450
|
+
|
|
173270
173451
|
this.TryClickPaintEvent=function(eventID, ptClick, e)
|
|
173271
173452
|
{
|
|
173272
173453
|
var event=this.GetEventCallback(eventID);
|
|
@@ -173304,6 +173485,8 @@ function JSStockInfoChartContainer(uielement)
|
|
|
173304
173485
|
this.ChartClearMouseOnData(option);
|
|
173305
173486
|
|
|
173306
173487
|
if (option.Update===true) this.Draw();
|
|
173488
|
+
|
|
173489
|
+
this.HideAllTooltip();
|
|
173307
173490
|
}
|
|
173308
173491
|
|
|
173309
173492
|
this.UIOnMounseOut=function(e)
|
|
@@ -173314,7 +173497,7 @@ function JSStockInfoChartContainer(uielement)
|
|
|
173314
173497
|
|
|
173315
173498
|
if (option.Update===true) this.Draw();
|
|
173316
173499
|
|
|
173317
|
-
|
|
173500
|
+
this.HideAllTooltip();
|
|
173318
173501
|
}
|
|
173319
173502
|
|
|
173320
173503
|
this.ChartClearMouseOnData=function(option)
|
|
@@ -173834,7 +174017,7 @@ function ChartStockData()
|
|
|
173834
174017
|
{
|
|
173835
174018
|
xText=left;
|
|
173836
174019
|
var item=this.Data.Sells[i];
|
|
173837
|
-
this.DrawBuySellItem(item, xText, yText, cellWidth, cellHeight, { Type:
|
|
174020
|
+
this.DrawBuySellItem(item, xText, yText, cellWidth, cellHeight, { Type:2, Index:i});
|
|
173838
174021
|
if (IFrameSplitOperator.IsNumber(item.Vol)) sellVol+=item.Vol;
|
|
173839
174022
|
yText+=cellHeight;
|
|
173840
174023
|
}
|
|
@@ -173853,7 +174036,7 @@ function ChartStockData()
|
|
|
173853
174036
|
{
|
|
173854
174037
|
xText=left;
|
|
173855
174038
|
var item=this.Data.Buys[i];
|
|
173856
|
-
this.DrawBuySellItem(item, xText, yText, cellWidth, cellHeight, { Type:
|
|
174039
|
+
this.DrawBuySellItem(item, xText, yText, cellWidth, cellHeight, { Type:1, Index:i});
|
|
173857
174040
|
if (IFrameSplitOperator.IsNumber(item.Vol)) buyVol+=item.Vol;
|
|
173858
174041
|
yText+=cellHeight;
|
|
173859
174042
|
}
|
|
@@ -173929,6 +174112,13 @@ function ChartStockData()
|
|
|
173929
174112
|
{
|
|
173930
174113
|
this.Canvas.fillStyle=config.TitleColor;
|
|
173931
174114
|
this.Canvas.fillText(item.Name,xText+config.CellMargin.Left,yBottom);
|
|
174115
|
+
var textWidth=this.Canvas.measureText(item.Name).width+2;
|
|
174116
|
+
var rtCell={ Left:xText+config.CellMargin.Left, Top:top, Height:cellHeight, Width:textWidth };
|
|
174117
|
+
rtCell.Right=rtCell.Left+rtCell.Width;
|
|
174118
|
+
rtCell.Bottom=rtCell.Top+rtCell.Height;
|
|
174119
|
+
|
|
174120
|
+
var key=`${itemInfo.Type==1?"BUY":"SELL"}_NAME_${itemInfo.Index}`;
|
|
174121
|
+
this.AryCellRect.push({ Rect:rtCell, Data:{ Type:3, Key:key, Value:{ Index:itemInfo.Index, Type:itemInfo.Type, YClose:this.GetYClose(), AryData:itemInfo.Type==1?this.Data.Buys:this.Data.Sells } }});
|
|
173932
174122
|
}
|
|
173933
174123
|
xText+=cellWidth;
|
|
173934
174124
|
|
|
@@ -174146,19 +174336,21 @@ function ChartStockData()
|
|
|
174146
174336
|
}
|
|
174147
174337
|
|
|
174148
174338
|
this.GetPriceColor=function(price)
|
|
174339
|
+
{
|
|
174340
|
+
var yClose=this.GetYClose();
|
|
174341
|
+
if (!IFrameSplitOperator.IsNumber(yClose)) return this.UnchangeColor;
|
|
174342
|
+
return this.GetUpDownColor(price, yClose);
|
|
174343
|
+
}
|
|
174344
|
+
|
|
174345
|
+
this.GetYClose=function()
|
|
174149
174346
|
{
|
|
174150
174347
|
var upperSymbol=null;
|
|
174151
174348
|
if (this.Data.Symbol) upperSymbol=this.Data.Symbol.toUpperCase();
|
|
174152
|
-
|
|
174153
|
-
|
|
174154
|
-
|
|
174155
|
-
|
|
174156
|
-
|
|
174157
|
-
else
|
|
174158
|
-
{
|
|
174159
|
-
if (!IFrameSplitOperator.IsNumber(this.Data.YClose)) return this.UnchangeColor;
|
|
174160
|
-
return this.GetUpDownColor(price, this.Data.YClose);
|
|
174161
|
-
}
|
|
174349
|
+
var price=null;
|
|
174350
|
+
if (MARKET_SUFFIX_NAME.IsChinaFutures(upperSymbol)) price=this.Data.YFClose;
|
|
174351
|
+
else price=this.Data.YClose;
|
|
174352
|
+
|
|
174353
|
+
return price;
|
|
174162
174354
|
}
|
|
174163
174355
|
|
|
174164
174356
|
this.GetUpDownColor=function(price, price2)
|
|
@@ -175265,7 +175457,7 @@ function ChartScrollText()
|
|
|
175265
175457
|
|
|
175266
175458
|
|
|
175267
175459
|
|
|
175268
|
-
var HQCHART_VERSION="1.1.
|
|
175460
|
+
var HQCHART_VERSION="1.1.15707";
|
|
175269
175461
|
|
|
175270
175462
|
function PrintHQChartVersion()
|
|
175271
175463
|
{
|