hqchart 1.1.13191 → 1.1.13197
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 +160 -152
- package/package.json +1 -1
- package/src/jscommon/umychart.js +92 -36
- package/src/jscommon/umychart.popMenu.js +53 -15
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +93 -37
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.vue.js +146 -52
package/package.json
CHANGED
package/src/jscommon/umychart.js
CHANGED
|
@@ -2119,10 +2119,19 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
2119
2119
|
{
|
|
2120
2120
|
if(this.JSChartContainer && typeof(this.JSChartContainer.PopupMenuByTab)=='function')
|
|
2121
2121
|
{
|
|
2122
|
-
JSConsole.Chart.Log('[JSChart:
|
|
2122
|
+
JSConsole.Chart.Log('[JSChart:PopupMenuByTab] ');
|
|
2123
2123
|
return this.JSChartContainer.PopupMenuByTab(menuData, rtTab);
|
|
2124
2124
|
}
|
|
2125
2125
|
}
|
|
2126
|
+
|
|
2127
|
+
this.PopupMenuByDrapdown=function(menuData, rtButton)
|
|
2128
|
+
{
|
|
2129
|
+
if(this.JSChartContainer && typeof(this.JSChartContainer.PopupMenuByDrapdown)=='function')
|
|
2130
|
+
{
|
|
2131
|
+
JSConsole.Chart.Log('[JSChart:PopupMenuByDrapdown] ');
|
|
2132
|
+
return this.JSChartContainer.PopupMenuByDrapdown(menuData, rtButton);
|
|
2133
|
+
}
|
|
2134
|
+
}
|
|
2126
2135
|
}
|
|
2127
2136
|
|
|
2128
2137
|
JSChart.LastVersion=null; //最新的版本号
|
|
@@ -2506,7 +2515,9 @@ var JSCHART_EVENT_ID=
|
|
|
2506
2515
|
ON_CLICK_TREPORT_ROW:127, //左键点击点击T型报价列表
|
|
2507
2516
|
|
|
2508
2517
|
|
|
2509
|
-
ON_CHANGE_INDEX:150,
|
|
2518
|
+
ON_CHANGE_INDEX:150, //切换指标
|
|
2519
|
+
ON_MENU_COMMAND:151, //菜单时间回调
|
|
2520
|
+
ON_CREATE_RIGHT_MENU:152, //创建右键菜单
|
|
2510
2521
|
}
|
|
2511
2522
|
|
|
2512
2523
|
var JSCHART_OPERATOR_ID=
|
|
@@ -9006,6 +9017,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
9006
9017
|
}
|
|
9007
9018
|
}
|
|
9008
9019
|
|
|
9020
|
+
//点tab弹菜单
|
|
9009
9021
|
this.PopupMenuByTab=function(menuData, rtTab)
|
|
9010
9022
|
{
|
|
9011
9023
|
if (!this.JSPopMenu) return;
|
|
@@ -9029,7 +9041,32 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
9029
9041
|
this.JSPopMenu.PopupMenuByTab(rtCell);
|
|
9030
9042
|
}
|
|
9031
9043
|
|
|
9032
|
-
|
|
9044
|
+
//下拉菜单
|
|
9045
|
+
this.PopupMenuByDrapdown=function(menuData, rtButton)
|
|
9046
|
+
{
|
|
9047
|
+
if (!this.JSPopMenu) return;
|
|
9048
|
+
|
|
9049
|
+
var pixelRatio=GetDevicePixelRatio();
|
|
9050
|
+
var rtCell={ Left:rtButton.Left/pixelRatio, Right:rtButton.Right/pixelRatio, Bottom:rtButton.Bottom/pixelRatio, Top:rtButton.Top/pixelRatio };
|
|
9051
|
+
rtCell.Width=rtCell.Right-rtCell.Left;
|
|
9052
|
+
rtCell.Height=rtCell.Bottom-rtCell.Top;
|
|
9053
|
+
|
|
9054
|
+
var rtClient=this.UIElement.getBoundingClientRect();
|
|
9055
|
+
var rtScroll=GetScrollPosition();
|
|
9056
|
+
|
|
9057
|
+
var offsetLeft=rtClient.left+rtScroll.Left;
|
|
9058
|
+
var offsetTop=rtClient.top+rtScroll.Top;
|
|
9059
|
+
rtCell.Left+=offsetLeft;
|
|
9060
|
+
rtCell.Right+=offsetLeft;
|
|
9061
|
+
rtCell.Top+=offsetTop;
|
|
9062
|
+
rtCell.Bottom+=offsetTop;
|
|
9063
|
+
|
|
9064
|
+
this.JSPopMenu.CreatePopMenu(menuData);
|
|
9065
|
+
this.JSPopMenu.PopupMenuByDrapdown(rtCell);
|
|
9066
|
+
}
|
|
9067
|
+
|
|
9068
|
+
//右键菜单
|
|
9069
|
+
this.PopupMenuByRClick=function(menuData, x, y)
|
|
9033
9070
|
{
|
|
9034
9071
|
var rtClient=this.UIElement.getBoundingClientRect();
|
|
9035
9072
|
var rtScroll=GetScrollPosition();
|
|
@@ -9041,14 +9078,11 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
9041
9078
|
this.JSPopMenu.PopupMenuByRight(x,y);
|
|
9042
9079
|
}
|
|
9043
9080
|
|
|
9044
|
-
|
|
9045
|
-
this.
|
|
9081
|
+
//菜单命令
|
|
9082
|
+
this.ExecuteMenuCommand=function(cmdID, aryArgs)
|
|
9046
9083
|
{
|
|
9047
|
-
JSConsole.Chart.Log('[JSChartContainer::
|
|
9048
|
-
if (!data || !data.Data) return;
|
|
9084
|
+
JSConsole.Chart.Log('[JSChartContainer::ExecuteMenuCommand] cmdID=, aryArgs=', cmdID,aryArgs);
|
|
9049
9085
|
|
|
9050
|
-
var cmdID=data.Data.ID; //命令ID
|
|
9051
|
-
var aryArgs=data.Data.Args; //参数
|
|
9052
9086
|
var param=null, srcParam=null; //原始值
|
|
9053
9087
|
if (IFrameSplitOperator.IsNonEmptyArray(aryArgs))
|
|
9054
9088
|
{
|
|
@@ -9224,6 +9258,44 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
9224
9258
|
break;
|
|
9225
9259
|
}
|
|
9226
9260
|
}
|
|
9261
|
+
|
|
9262
|
+
//点击右键菜单
|
|
9263
|
+
this.OnClickRightMenu=function(data)
|
|
9264
|
+
{
|
|
9265
|
+
JSConsole.Chart.Log('[JSChartContainer::OnClickRightMenu] ',data);
|
|
9266
|
+
if (!data || !data.Data) return;
|
|
9267
|
+
|
|
9268
|
+
var cmdID=data.Data.ID; //命令ID
|
|
9269
|
+
var aryArgs=data.Data.Args; //参数
|
|
9270
|
+
|
|
9271
|
+
var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_MENU_COMMAND); //回调通知外部
|
|
9272
|
+
if (event && event.Callback)
|
|
9273
|
+
{
|
|
9274
|
+
var data={ PreventDefault:false, CommandID:cmdID, Args:aryArgs, SrcData:data };
|
|
9275
|
+
event.Callback(event,data,this);
|
|
9276
|
+
if (data.PreventDefault) return;
|
|
9277
|
+
}
|
|
9278
|
+
|
|
9279
|
+
this.ExecuteMenuCommand(cmdID, aryArgs);
|
|
9280
|
+
}
|
|
9281
|
+
|
|
9282
|
+
this.PopupRightMenuV2=function(data,e)
|
|
9283
|
+
{
|
|
9284
|
+
if (!this.JSPopMenu) return;
|
|
9285
|
+
var x=data.X, y=data.Y;
|
|
9286
|
+
var frameID=data.FrameID;
|
|
9287
|
+
var menuData={ Menu:this.GetRightMenuData(frameID), Position:JSPopMenu.POSITION_ID.RIGHT_MENU_ID };
|
|
9288
|
+
menuData.ClickCallback=(data)=>{ this.OnClickRightMenu(data); }
|
|
9289
|
+
|
|
9290
|
+
var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CREATE_RIGHT_MENU);
|
|
9291
|
+
if (event && event.Callback)
|
|
9292
|
+
{
|
|
9293
|
+
var sendData={ MenuData:menuData, FrameID:frameID };
|
|
9294
|
+
event.Callback(event, sendData, this);
|
|
9295
|
+
}
|
|
9296
|
+
|
|
9297
|
+
this.PopupMenuByRClick(menuData, x, y);
|
|
9298
|
+
}
|
|
9227
9299
|
}
|
|
9228
9300
|
|
|
9229
9301
|
function GetDevicePixelRatio()
|
|
@@ -12450,7 +12522,7 @@ function MinuteFrame()
|
|
|
12450
12522
|
for(var i=0;i<this.CustomToolbar.length;++i)
|
|
12451
12523
|
{
|
|
12452
12524
|
var item=this.CustomToolbar[i];
|
|
12453
|
-
if (item.ID && item.Style) aryButton.push({ ID:item.ID, Style:item.Style, TooltipText:item.TooltipText });
|
|
12525
|
+
if (item.ID && item.Style) aryButton.push({ ID:item.ID, Style:item.Style, TooltipText:item.TooltipText, Data:item.Data });
|
|
12454
12526
|
}
|
|
12455
12527
|
}
|
|
12456
12528
|
|
|
@@ -14580,7 +14652,7 @@ function KLineFrame()
|
|
|
14580
14652
|
var item=this.CustomToolbar[i];
|
|
14581
14653
|
if (item.ID && item.Style)
|
|
14582
14654
|
{
|
|
14583
|
-
var btnItem={ ID:item.ID, Style:item.Style, TooltipText:item.TooltipText};
|
|
14655
|
+
var btnItem={ ID:item.ID, Style:item.Style, TooltipText:item.TooltipText, Data:item.Data };
|
|
14584
14656
|
|
|
14585
14657
|
if (item.IsLeft===true) //左侧按钮
|
|
14586
14658
|
{
|
|
@@ -14646,7 +14718,7 @@ function KLineFrame()
|
|
|
14646
14718
|
var item=this.CustomToolbar[i];
|
|
14647
14719
|
if (item.ID && item.Style)
|
|
14648
14720
|
{
|
|
14649
|
-
var btnItem={ ID:item.ID, Style:item.Style, TooltipText:item.TooltipText};
|
|
14721
|
+
var btnItem={ ID:item.ID, Style:item.Style, TooltipText:item.TooltipText, Data:item.Data };
|
|
14650
14722
|
if (item.IsLeft===true) aryLeftButton.push(btnItem); //左侧按钮
|
|
14651
14723
|
}
|
|
14652
14724
|
}
|
|
@@ -53652,7 +53724,7 @@ function DynamicChartTitlePainting()
|
|
|
53652
53724
|
var rtButton={ Left:left, YCenter:yCenter };
|
|
53653
53725
|
this.DrawButton(item, rtButton, moveonPoint, mouseStatus);
|
|
53654
53726
|
|
|
53655
|
-
this.Buttons.push({ ID:item.ID, Rect:rtButton, FrameID:this.Frame.Identify, Type:0 }); //Type 0=主图按钮 1=附图按钮 2=主图指标名字按钮
|
|
53727
|
+
this.Buttons.push({ ID:item.ID, Rect:rtButton, FrameID:this.Frame.Identify, Type:0, Data:item.Data }); //Type 0=主图按钮 1=附图按钮 2=主图指标名字按钮
|
|
53656
53728
|
|
|
53657
53729
|
left=rtButton.Right;
|
|
53658
53730
|
|
|
@@ -53713,7 +53785,7 @@ function DynamicChartTitlePainting()
|
|
|
53713
53785
|
var rect=item.Rect;
|
|
53714
53786
|
if (x>rect.Left && x<rect.Right && y>rect.Top && y<rect.Bottom)
|
|
53715
53787
|
{
|
|
53716
|
-
var result= { ID:item.ID, Rect:rect, FrameID:item.FrameID, Type:item.Type };
|
|
53788
|
+
var result= { ID:item.ID, Rect:rect, FrameID:item.FrameID, Type:item.Type, Data:item.Data };
|
|
53717
53789
|
if (item.Type==1)
|
|
53718
53790
|
{
|
|
53719
53791
|
result.Title=item.Title;
|
|
@@ -55963,8 +56035,11 @@ function ChartDrawHLine()
|
|
|
55963
56035
|
{
|
|
55964
56036
|
var item=option.Button;
|
|
55965
56037
|
if (item.CloseIcon) this.Button.CloseIcon=CloneData(item.CloseIcon);
|
|
56038
|
+
else if (item.CloseIcon===null) this.Button.CloseIcon=null;
|
|
55966
56039
|
if (item.SettingIcon) this.Button.SettingIcon=CloneData(item.SettingIcon);
|
|
56040
|
+
else if (item.SettingIcon===null) this.Button.SettingIcon=null;
|
|
55967
56041
|
}
|
|
56042
|
+
|
|
55968
56043
|
if (option.ExtendData) this.ExtendData=option.ExtendData;
|
|
55969
56044
|
|
|
55970
56045
|
if (IFrameSplitOperator.IsNonEmptyArray(option.IsShowPriceText))
|
|
@@ -72610,6 +72685,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
72610
72685
|
{ Name:"均线", Data:{ ID: JSCHART_MENU_ID.CMD_CHANGE_INDEX_ID, Args:[frameID, "均线"]}},
|
|
72611
72686
|
{ Name:"BOLL", Data:{ ID: JSCHART_MENU_ID.CMD_CHANGE_INDEX_ID, Args:[frameID, "BOLL"]}},
|
|
72612
72687
|
{ Name:"MACD", Data:{ ID: JSCHART_MENU_ID.CMD_CHANGE_INDEX_ID, Args:[frameID, "MACD"]}},
|
|
72688
|
+
{ Name:"MACD(粗)", Data:{ ID: JSCHART_MENU_ID.CMD_CHANGE_INDEX_ID, Args:[frameID, "MACD2"]}},
|
|
72613
72689
|
{ Name:"KDJ", Data:{ ID: JSCHART_MENU_ID.CMD_CHANGE_INDEX_ID, Args:[frameID, "KDJ"]}},
|
|
72614
72690
|
{ Name:"VOL", Data:{ ID: JSCHART_MENU_ID.CMD_CHANGE_INDEX_ID, Args:[frameID, "VOL"]}},
|
|
72615
72691
|
{ Name:"RSI", Data:{ ID: JSCHART_MENU_ID.CMD_CHANGE_INDEX_ID, Args:[frameID, "RSI"]}},
|
|
@@ -72804,16 +72880,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
72804
72880
|
return aryMenu;
|
|
72805
72881
|
}
|
|
72806
72882
|
|
|
72807
|
-
this.PopupRightMenuV2=function(data,e)
|
|
72808
|
-
{
|
|
72809
|
-
if (!this.JSPopMenu) return;
|
|
72810
|
-
var x=data.X, y=data.Y;
|
|
72811
|
-
var frameID=data.FrameID;
|
|
72812
|
-
var menuData={ Menu:this.GetRightMenuData(frameID), Position:JSPopMenu.POSITION_ID.RIGHT_MENU_ID };
|
|
72813
|
-
menuData.ClickCallback=(data)=>{ this.OnClickRightMenu(data); }
|
|
72814
72883
|
|
|
72815
|
-
this.PopuMenuByRClick(menuData, x, y);
|
|
72816
|
-
}
|
|
72817
72884
|
|
|
72818
72885
|
this.PopupSelectRectMenuV2=function(data, e)
|
|
72819
72886
|
{
|
|
@@ -72826,7 +72893,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
72826
72893
|
var menuData={ Menu:aryMenu, Position:JSPopMenu.POSITION_ID.RIGHT_MENU_ID };
|
|
72827
72894
|
menuData.ClickCallback=(data)=>{ this.OnClickRightMenu(data); }
|
|
72828
72895
|
var x=data.X, y=data.Y;
|
|
72829
|
-
this.
|
|
72896
|
+
this.PopupMenuByRClick(menuData, x, y);
|
|
72830
72897
|
}
|
|
72831
72898
|
|
|
72832
72899
|
//重新加载画图工具(切换股票|周期)
|
|
@@ -74215,7 +74282,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
74215
74282
|
var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_TITLE_BUTTON);
|
|
74216
74283
|
if (event && event.Callback)
|
|
74217
74284
|
{
|
|
74218
|
-
var data={ Info:button, PreventDefault:false
|
|
74285
|
+
var data={ Info:button, PreventDefault:false, e:e }; //PreventDefault 是否阻止内置的点击处理
|
|
74219
74286
|
event.Callback(event,data,this);
|
|
74220
74287
|
if (data.PreventDefault) return;
|
|
74221
74288
|
}
|
|
@@ -76312,17 +76379,6 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
76312
76379
|
return aryMenu;
|
|
76313
76380
|
}
|
|
76314
76381
|
|
|
76315
|
-
this.PopupRightMenuV2=function(data,e)
|
|
76316
|
-
{
|
|
76317
|
-
if (!this.JSPopMenu) return;
|
|
76318
|
-
var x=data.X, y=data.Y;
|
|
76319
|
-
var frameID=data.FrameID;
|
|
76320
|
-
var menuData={ Menu:this.GetRightMenuData(frameID), Position:JSPopMenu.POSITION_ID.RIGHT_MENU_ID };
|
|
76321
|
-
menuData.ClickCallback=(data)=>{ this.OnClickRightMenu(data); }
|
|
76322
|
-
|
|
76323
|
-
this.PopuMenuByRClick(menuData, x, y);
|
|
76324
|
-
}
|
|
76325
|
-
|
|
76326
76382
|
this.OnWheel=function(e)
|
|
76327
76383
|
{
|
|
76328
76384
|
JSConsole.Chart.Log('[MinuteChartContainer::OnWheel]',e);
|
|
@@ -41,6 +41,8 @@ function JSPopMenu()
|
|
|
41
41
|
{
|
|
42
42
|
this.Clear();
|
|
43
43
|
|
|
44
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(data.Menu)) return;
|
|
45
|
+
|
|
44
46
|
var root=document.createElement("div");
|
|
45
47
|
root.className="UMyChart_PopMenu";
|
|
46
48
|
|
|
@@ -57,6 +59,13 @@ function JSPopMenu()
|
|
|
57
59
|
for(var i=0;i<data.Menu.length;++i)
|
|
58
60
|
{
|
|
59
61
|
var item=data.Menu[i];
|
|
62
|
+
if (item.Name==JSPopMenu.SEPARATOR_LINE_NAME)
|
|
63
|
+
{
|
|
64
|
+
var trSeparator=this.CreateSeparatorTr();
|
|
65
|
+
if (trSeparator) tbody.appendChild(trSeparator);
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
|
|
60
69
|
var trDom=this.CreateMenu(rootData, item);
|
|
61
70
|
tbody.appendChild(trDom);
|
|
62
71
|
}
|
|
@@ -153,21 +162,8 @@ function JSPopMenu()
|
|
|
153
162
|
var subItem=item.SubMenu[i];
|
|
154
163
|
if (subItem.Name==JSPopMenu.SEPARATOR_LINE_NAME)
|
|
155
164
|
{
|
|
156
|
-
var trSeparator=
|
|
157
|
-
trSeparator.
|
|
158
|
-
var tdDom=document.createElement("td");
|
|
159
|
-
tdDom.className="UMyChart_MenuItem_Td_Status_Separator";
|
|
160
|
-
trSeparator.appendChild(tdDom);
|
|
161
|
-
var tdDom=document.createElement("td");
|
|
162
|
-
tdDom.className="UMyChart_MenuItem_Td_Separator";
|
|
163
|
-
trSeparator.appendChild(tdDom);
|
|
164
|
-
var tdDom=document.createElement("td");
|
|
165
|
-
tdDom.className="UMyChart_MenuItem_Td_Separator";
|
|
166
|
-
trSeparator.appendChild(tdDom);
|
|
167
|
-
var tdDom=document.createElement("td");
|
|
168
|
-
tdDom.className="UMyChart_MenuItem_Td_Separator";
|
|
169
|
-
trSeparator.appendChild(tdDom);
|
|
170
|
-
subTbody.appendChild(trSeparator);
|
|
165
|
+
var trSeparator=this.CreateSeparatorTr();
|
|
166
|
+
if (trSeparator) subTbody.appendChild(trSeparator);
|
|
171
167
|
continue;
|
|
172
168
|
}
|
|
173
169
|
|
|
@@ -189,6 +185,30 @@ function JSPopMenu()
|
|
|
189
185
|
return trDom;
|
|
190
186
|
}
|
|
191
187
|
|
|
188
|
+
this.CreateSeparatorTr=function()
|
|
189
|
+
{
|
|
190
|
+
var trSeparator=document.createElement("tr");
|
|
191
|
+
trSeparator.className='UMyChart_MenuItem_Tr_Separator';
|
|
192
|
+
|
|
193
|
+
var tdDom=document.createElement("td");
|
|
194
|
+
tdDom.className="UMyChart_MenuItem_Td_Status_Separator";
|
|
195
|
+
trSeparator.appendChild(tdDom);
|
|
196
|
+
|
|
197
|
+
var tdDom=document.createElement("td");
|
|
198
|
+
tdDom.className="UMyChart_MenuItem_Td_Separator";
|
|
199
|
+
trSeparator.appendChild(tdDom);
|
|
200
|
+
|
|
201
|
+
var tdDom=document.createElement("td");
|
|
202
|
+
tdDom.className="UMyChart_MenuItem_Td_Separator";
|
|
203
|
+
trSeparator.appendChild(tdDom);
|
|
204
|
+
|
|
205
|
+
var tdDom=document.createElement("td");
|
|
206
|
+
tdDom.className="UMyChart_MenuItem_Td_Separator";
|
|
207
|
+
trSeparator.appendChild(tdDom);
|
|
208
|
+
|
|
209
|
+
return trSeparator;
|
|
210
|
+
}
|
|
211
|
+
|
|
192
212
|
//弹tab菜单
|
|
193
213
|
this.PopupMenuByTab=function(rtTab)
|
|
194
214
|
{
|
|
@@ -225,6 +245,24 @@ function JSPopMenu()
|
|
|
225
245
|
this.RootDOM.style.left = x + "px";
|
|
226
246
|
}
|
|
227
247
|
|
|
248
|
+
//下拉菜单
|
|
249
|
+
this.PopupMenuByDrapdown=function(rtButton)
|
|
250
|
+
{
|
|
251
|
+
if (!this.RootDOM) return;
|
|
252
|
+
if (!rtButton) return;
|
|
253
|
+
|
|
254
|
+
var xLeft=rtButton.Left;
|
|
255
|
+
var yTop=rtButton.Bottom;
|
|
256
|
+
var menuHeight=this.RootDOM.offsetHeight;
|
|
257
|
+
var yMenuBottom=yTop+menuHeight;
|
|
258
|
+
var yBottom=window.innerHeight-15;
|
|
259
|
+
if (yMenuBottom>yBottom) yTop=rtButton.Top-menuHeight;
|
|
260
|
+
|
|
261
|
+
this.RootDOM.style.visibility='visible';
|
|
262
|
+
this.RootDOM.style.top = yTop + "px";
|
|
263
|
+
this.RootDOM.style.left = xLeft + "px";
|
|
264
|
+
}
|
|
265
|
+
|
|
228
266
|
this.OnClickMenu=function(e, item, bSubMenu)
|
|
229
267
|
{
|
|
230
268
|
console.log("[JSPopMenu::OnClickMenu] e=, item=, bSubMenu", e, item, bSubMenu);
|
|
@@ -6011,10 +6011,19 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
6011
6011
|
{
|
|
6012
6012
|
if(this.JSChartContainer && typeof(this.JSChartContainer.PopupMenuByTab)=='function')
|
|
6013
6013
|
{
|
|
6014
|
-
JSConsole.Chart.Log('[JSChart:
|
|
6014
|
+
JSConsole.Chart.Log('[JSChart:PopupMenuByTab] ');
|
|
6015
6015
|
return this.JSChartContainer.PopupMenuByTab(menuData, rtTab);
|
|
6016
6016
|
}
|
|
6017
6017
|
}
|
|
6018
|
+
|
|
6019
|
+
this.PopupMenuByDrapdown=function(menuData, rtButton)
|
|
6020
|
+
{
|
|
6021
|
+
if(this.JSChartContainer && typeof(this.JSChartContainer.PopupMenuByDrapdown)=='function')
|
|
6022
|
+
{
|
|
6023
|
+
JSConsole.Chart.Log('[JSChart:PopupMenuByDrapdown] ');
|
|
6024
|
+
return this.JSChartContainer.PopupMenuByDrapdown(menuData, rtButton);
|
|
6025
|
+
}
|
|
6026
|
+
}
|
|
6018
6027
|
}
|
|
6019
6028
|
|
|
6020
6029
|
JSChart.LastVersion=null; //最新的版本号
|
|
@@ -6398,7 +6407,9 @@ var JSCHART_EVENT_ID=
|
|
|
6398
6407
|
ON_CLICK_TREPORT_ROW:127, //左键点击点击T型报价列表
|
|
6399
6408
|
|
|
6400
6409
|
|
|
6401
|
-
ON_CHANGE_INDEX:150,
|
|
6410
|
+
ON_CHANGE_INDEX:150, //切换指标
|
|
6411
|
+
ON_MENU_COMMAND:151, //菜单时间回调
|
|
6412
|
+
ON_CREATE_RIGHT_MENU:152, //创建右键菜单
|
|
6402
6413
|
}
|
|
6403
6414
|
|
|
6404
6415
|
var JSCHART_OPERATOR_ID=
|
|
@@ -12898,6 +12909,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
12898
12909
|
}
|
|
12899
12910
|
}
|
|
12900
12911
|
|
|
12912
|
+
//点tab弹菜单
|
|
12901
12913
|
this.PopupMenuByTab=function(menuData, rtTab)
|
|
12902
12914
|
{
|
|
12903
12915
|
if (!this.JSPopMenu) return;
|
|
@@ -12921,7 +12933,32 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
12921
12933
|
this.JSPopMenu.PopupMenuByTab(rtCell);
|
|
12922
12934
|
}
|
|
12923
12935
|
|
|
12924
|
-
|
|
12936
|
+
//下拉菜单
|
|
12937
|
+
this.PopupMenuByDrapdown=function(menuData, rtButton)
|
|
12938
|
+
{
|
|
12939
|
+
if (!this.JSPopMenu) return;
|
|
12940
|
+
|
|
12941
|
+
var pixelRatio=GetDevicePixelRatio();
|
|
12942
|
+
var rtCell={ Left:rtButton.Left/pixelRatio, Right:rtButton.Right/pixelRatio, Bottom:rtButton.Bottom/pixelRatio, Top:rtButton.Top/pixelRatio };
|
|
12943
|
+
rtCell.Width=rtCell.Right-rtCell.Left;
|
|
12944
|
+
rtCell.Height=rtCell.Bottom-rtCell.Top;
|
|
12945
|
+
|
|
12946
|
+
var rtClient=this.UIElement.getBoundingClientRect();
|
|
12947
|
+
var rtScroll=GetScrollPosition();
|
|
12948
|
+
|
|
12949
|
+
var offsetLeft=rtClient.left+rtScroll.Left;
|
|
12950
|
+
var offsetTop=rtClient.top+rtScroll.Top;
|
|
12951
|
+
rtCell.Left+=offsetLeft;
|
|
12952
|
+
rtCell.Right+=offsetLeft;
|
|
12953
|
+
rtCell.Top+=offsetTop;
|
|
12954
|
+
rtCell.Bottom+=offsetTop;
|
|
12955
|
+
|
|
12956
|
+
this.JSPopMenu.CreatePopMenu(menuData);
|
|
12957
|
+
this.JSPopMenu.PopupMenuByDrapdown(rtCell);
|
|
12958
|
+
}
|
|
12959
|
+
|
|
12960
|
+
//右键菜单
|
|
12961
|
+
this.PopupMenuByRClick=function(menuData, x, y)
|
|
12925
12962
|
{
|
|
12926
12963
|
var rtClient=this.UIElement.getBoundingClientRect();
|
|
12927
12964
|
var rtScroll=GetScrollPosition();
|
|
@@ -12933,14 +12970,11 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
12933
12970
|
this.JSPopMenu.PopupMenuByRight(x,y);
|
|
12934
12971
|
}
|
|
12935
12972
|
|
|
12936
|
-
|
|
12937
|
-
this.
|
|
12973
|
+
//菜单命令
|
|
12974
|
+
this.ExecuteMenuCommand=function(cmdID, aryArgs)
|
|
12938
12975
|
{
|
|
12939
|
-
JSConsole.Chart.Log('[JSChartContainer::
|
|
12940
|
-
if (!data || !data.Data) return;
|
|
12976
|
+
JSConsole.Chart.Log('[JSChartContainer::ExecuteMenuCommand] cmdID=, aryArgs=', cmdID,aryArgs);
|
|
12941
12977
|
|
|
12942
|
-
var cmdID=data.Data.ID; //命令ID
|
|
12943
|
-
var aryArgs=data.Data.Args; //参数
|
|
12944
12978
|
var param=null, srcParam=null; //原始值
|
|
12945
12979
|
if (IFrameSplitOperator.IsNonEmptyArray(aryArgs))
|
|
12946
12980
|
{
|
|
@@ -13116,6 +13150,44 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
13116
13150
|
break;
|
|
13117
13151
|
}
|
|
13118
13152
|
}
|
|
13153
|
+
|
|
13154
|
+
//点击右键菜单
|
|
13155
|
+
this.OnClickRightMenu=function(data)
|
|
13156
|
+
{
|
|
13157
|
+
JSConsole.Chart.Log('[JSChartContainer::OnClickRightMenu] ',data);
|
|
13158
|
+
if (!data || !data.Data) return;
|
|
13159
|
+
|
|
13160
|
+
var cmdID=data.Data.ID; //命令ID
|
|
13161
|
+
var aryArgs=data.Data.Args; //参数
|
|
13162
|
+
|
|
13163
|
+
var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_MENU_COMMAND); //回调通知外部
|
|
13164
|
+
if (event && event.Callback)
|
|
13165
|
+
{
|
|
13166
|
+
var data={ PreventDefault:false, CommandID:cmdID, Args:aryArgs, SrcData:data };
|
|
13167
|
+
event.Callback(event,data,this);
|
|
13168
|
+
if (data.PreventDefault) return;
|
|
13169
|
+
}
|
|
13170
|
+
|
|
13171
|
+
this.ExecuteMenuCommand(cmdID, aryArgs);
|
|
13172
|
+
}
|
|
13173
|
+
|
|
13174
|
+
this.PopupRightMenuV2=function(data,e)
|
|
13175
|
+
{
|
|
13176
|
+
if (!this.JSPopMenu) return;
|
|
13177
|
+
var x=data.X, y=data.Y;
|
|
13178
|
+
var frameID=data.FrameID;
|
|
13179
|
+
var menuData={ Menu:this.GetRightMenuData(frameID), Position:JSPopMenu.POSITION_ID.RIGHT_MENU_ID };
|
|
13180
|
+
menuData.ClickCallback=(data)=>{ this.OnClickRightMenu(data); }
|
|
13181
|
+
|
|
13182
|
+
var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CREATE_RIGHT_MENU);
|
|
13183
|
+
if (event && event.Callback)
|
|
13184
|
+
{
|
|
13185
|
+
var sendData={ MenuData:menuData, FrameID:frameID };
|
|
13186
|
+
event.Callback(event, sendData, this);
|
|
13187
|
+
}
|
|
13188
|
+
|
|
13189
|
+
this.PopupMenuByRClick(menuData, x, y);
|
|
13190
|
+
}
|
|
13119
13191
|
}
|
|
13120
13192
|
|
|
13121
13193
|
function GetDevicePixelRatio()
|
|
@@ -16342,7 +16414,7 @@ function MinuteFrame()
|
|
|
16342
16414
|
for(var i=0;i<this.CustomToolbar.length;++i)
|
|
16343
16415
|
{
|
|
16344
16416
|
var item=this.CustomToolbar[i];
|
|
16345
|
-
if (item.ID && item.Style) aryButton.push({ ID:item.ID, Style:item.Style, TooltipText:item.TooltipText });
|
|
16417
|
+
if (item.ID && item.Style) aryButton.push({ ID:item.ID, Style:item.Style, TooltipText:item.TooltipText, Data:item.Data });
|
|
16346
16418
|
}
|
|
16347
16419
|
}
|
|
16348
16420
|
|
|
@@ -18472,7 +18544,7 @@ function KLineFrame()
|
|
|
18472
18544
|
var item=this.CustomToolbar[i];
|
|
18473
18545
|
if (item.ID && item.Style)
|
|
18474
18546
|
{
|
|
18475
|
-
var btnItem={ ID:item.ID, Style:item.Style, TooltipText:item.TooltipText};
|
|
18547
|
+
var btnItem={ ID:item.ID, Style:item.Style, TooltipText:item.TooltipText, Data:item.Data };
|
|
18476
18548
|
|
|
18477
18549
|
if (item.IsLeft===true) //左侧按钮
|
|
18478
18550
|
{
|
|
@@ -18538,7 +18610,7 @@ function KLineFrame()
|
|
|
18538
18610
|
var item=this.CustomToolbar[i];
|
|
18539
18611
|
if (item.ID && item.Style)
|
|
18540
18612
|
{
|
|
18541
|
-
var btnItem={ ID:item.ID, Style:item.Style, TooltipText:item.TooltipText};
|
|
18613
|
+
var btnItem={ ID:item.ID, Style:item.Style, TooltipText:item.TooltipText, Data:item.Data };
|
|
18542
18614
|
if (item.IsLeft===true) aryLeftButton.push(btnItem); //左侧按钮
|
|
18543
18615
|
}
|
|
18544
18616
|
}
|
|
@@ -57544,7 +57616,7 @@ function DynamicChartTitlePainting()
|
|
|
57544
57616
|
var rtButton={ Left:left, YCenter:yCenter };
|
|
57545
57617
|
this.DrawButton(item, rtButton, moveonPoint, mouseStatus);
|
|
57546
57618
|
|
|
57547
|
-
this.Buttons.push({ ID:item.ID, Rect:rtButton, FrameID:this.Frame.Identify, Type:0 }); //Type 0=主图按钮 1=附图按钮 2=主图指标名字按钮
|
|
57619
|
+
this.Buttons.push({ ID:item.ID, Rect:rtButton, FrameID:this.Frame.Identify, Type:0, Data:item.Data }); //Type 0=主图按钮 1=附图按钮 2=主图指标名字按钮
|
|
57548
57620
|
|
|
57549
57621
|
left=rtButton.Right;
|
|
57550
57622
|
|
|
@@ -57605,7 +57677,7 @@ function DynamicChartTitlePainting()
|
|
|
57605
57677
|
var rect=item.Rect;
|
|
57606
57678
|
if (x>rect.Left && x<rect.Right && y>rect.Top && y<rect.Bottom)
|
|
57607
57679
|
{
|
|
57608
|
-
var result= { ID:item.ID, Rect:rect, FrameID:item.FrameID, Type:item.Type };
|
|
57680
|
+
var result= { ID:item.ID, Rect:rect, FrameID:item.FrameID, Type:item.Type, Data:item.Data };
|
|
57609
57681
|
if (item.Type==1)
|
|
57610
57682
|
{
|
|
57611
57683
|
result.Title=item.Title;
|
|
@@ -59855,8 +59927,11 @@ function ChartDrawHLine()
|
|
|
59855
59927
|
{
|
|
59856
59928
|
var item=option.Button;
|
|
59857
59929
|
if (item.CloseIcon) this.Button.CloseIcon=CloneData(item.CloseIcon);
|
|
59930
|
+
else if (item.CloseIcon===null) this.Button.CloseIcon=null;
|
|
59858
59931
|
if (item.SettingIcon) this.Button.SettingIcon=CloneData(item.SettingIcon);
|
|
59932
|
+
else if (item.SettingIcon===null) this.Button.SettingIcon=null;
|
|
59859
59933
|
}
|
|
59934
|
+
|
|
59860
59935
|
if (option.ExtendData) this.ExtendData=option.ExtendData;
|
|
59861
59936
|
|
|
59862
59937
|
if (IFrameSplitOperator.IsNonEmptyArray(option.IsShowPriceText))
|
|
@@ -76502,6 +76577,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
76502
76577
|
{ Name:"均线", Data:{ ID: JSCHART_MENU_ID.CMD_CHANGE_INDEX_ID, Args:[frameID, "均线"]}},
|
|
76503
76578
|
{ Name:"BOLL", Data:{ ID: JSCHART_MENU_ID.CMD_CHANGE_INDEX_ID, Args:[frameID, "BOLL"]}},
|
|
76504
76579
|
{ Name:"MACD", Data:{ ID: JSCHART_MENU_ID.CMD_CHANGE_INDEX_ID, Args:[frameID, "MACD"]}},
|
|
76580
|
+
{ Name:"MACD(粗)", Data:{ ID: JSCHART_MENU_ID.CMD_CHANGE_INDEX_ID, Args:[frameID, "MACD2"]}},
|
|
76505
76581
|
{ Name:"KDJ", Data:{ ID: JSCHART_MENU_ID.CMD_CHANGE_INDEX_ID, Args:[frameID, "KDJ"]}},
|
|
76506
76582
|
{ Name:"VOL", Data:{ ID: JSCHART_MENU_ID.CMD_CHANGE_INDEX_ID, Args:[frameID, "VOL"]}},
|
|
76507
76583
|
{ Name:"RSI", Data:{ ID: JSCHART_MENU_ID.CMD_CHANGE_INDEX_ID, Args:[frameID, "RSI"]}},
|
|
@@ -76696,16 +76772,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
76696
76772
|
return aryMenu;
|
|
76697
76773
|
}
|
|
76698
76774
|
|
|
76699
|
-
this.PopupRightMenuV2=function(data,e)
|
|
76700
|
-
{
|
|
76701
|
-
if (!this.JSPopMenu) return;
|
|
76702
|
-
var x=data.X, y=data.Y;
|
|
76703
|
-
var frameID=data.FrameID;
|
|
76704
|
-
var menuData={ Menu:this.GetRightMenuData(frameID), Position:JSPopMenu.POSITION_ID.RIGHT_MENU_ID };
|
|
76705
|
-
menuData.ClickCallback=(data)=>{ this.OnClickRightMenu(data); }
|
|
76706
76775
|
|
|
76707
|
-
this.PopuMenuByRClick(menuData, x, y);
|
|
76708
|
-
}
|
|
76709
76776
|
|
|
76710
76777
|
this.PopupSelectRectMenuV2=function(data, e)
|
|
76711
76778
|
{
|
|
@@ -76718,7 +76785,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
76718
76785
|
var menuData={ Menu:aryMenu, Position:JSPopMenu.POSITION_ID.RIGHT_MENU_ID };
|
|
76719
76786
|
menuData.ClickCallback=(data)=>{ this.OnClickRightMenu(data); }
|
|
76720
76787
|
var x=data.X, y=data.Y;
|
|
76721
|
-
this.
|
|
76788
|
+
this.PopupMenuByRClick(menuData, x, y);
|
|
76722
76789
|
}
|
|
76723
76790
|
|
|
76724
76791
|
//重新加载画图工具(切换股票|周期)
|
|
@@ -78107,7 +78174,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
78107
78174
|
var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_TITLE_BUTTON);
|
|
78108
78175
|
if (event && event.Callback)
|
|
78109
78176
|
{
|
|
78110
|
-
var data={ Info:button, PreventDefault:false
|
|
78177
|
+
var data={ Info:button, PreventDefault:false, e:e }; //PreventDefault 是否阻止内置的点击处理
|
|
78111
78178
|
event.Callback(event,data,this);
|
|
78112
78179
|
if (data.PreventDefault) return;
|
|
78113
78180
|
}
|
|
@@ -80204,17 +80271,6 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
80204
80271
|
return aryMenu;
|
|
80205
80272
|
}
|
|
80206
80273
|
|
|
80207
|
-
this.PopupRightMenuV2=function(data,e)
|
|
80208
|
-
{
|
|
80209
|
-
if (!this.JSPopMenu) return;
|
|
80210
|
-
var x=data.X, y=data.Y;
|
|
80211
|
-
var frameID=data.FrameID;
|
|
80212
|
-
var menuData={ Menu:this.GetRightMenuData(frameID), Position:JSPopMenu.POSITION_ID.RIGHT_MENU_ID };
|
|
80213
|
-
menuData.ClickCallback=(data)=>{ this.OnClickRightMenu(data); }
|
|
80214
|
-
|
|
80215
|
-
this.PopuMenuByRClick(menuData, x, y);
|
|
80216
|
-
}
|
|
80217
|
-
|
|
80218
80274
|
this.OnWheel=function(e)
|
|
80219
80275
|
{
|
|
80220
80276
|
JSConsole.Chart.Log('[MinuteChartContainer::OnWheel]',e);
|
|
@@ -131789,7 +131845,7 @@ function ScrollBarBGChart()
|
|
|
131789
131845
|
|
|
131790
131846
|
|
|
131791
131847
|
|
|
131792
|
-
var HQCHART_VERSION="1.1.
|
|
131848
|
+
var HQCHART_VERSION="1.1.13196";
|
|
131793
131849
|
|
|
131794
131850
|
function PrintHQChartVersion()
|
|
131795
131851
|
{
|