hqchart 1.1.13182 → 1.1.13194
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 +154 -211
- package/package.json +1 -1
- package/src/jscommon/umychart.js +186 -1546
- package/src/jscommon/umychart.popMenu.js +67 -4
- package/src/jscommon/umychart.resource/css/tools.css +135 -0
- package/src/jscommon/umychart.resource/css/umychart.popmenu.css +47 -10
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +187 -1547
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.vue.js +256 -1552
|
@@ -4215,9 +4215,8 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
4215
4215
|
var pixelRatio=GetDevicePixelRatio();
|
|
4216
4216
|
|
|
4217
4217
|
//右键菜单
|
|
4218
|
-
if (option.IsShowRightMenu
|
|
4218
|
+
if (IFrameSplitOperator.IsBool(option.IsShowRightMenu)) chart.IsShowRightMenu=option.IsShowRightMenu;
|
|
4219
4219
|
if (option.ScriptError) chart.ScriptErrorCallback=option.ScriptError;
|
|
4220
|
-
chart.SelectRectRightMenu=new KLineSelectRightMenu(this.DivElement);
|
|
4221
4220
|
if (option.EnableScrollUpDown==true) chart.EnableScrollUpDown=option.EnableScrollUpDown;
|
|
4222
4221
|
if (option.DisableMouse==true) chart.DisableMouse=option.DisableMouse;
|
|
4223
4222
|
if (option.TouchMoveMinAngle) chart.TouchMoveMinAngle=option.TouchMoveMinAngle;
|
|
@@ -4631,7 +4630,7 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
4631
4630
|
chart.MinuteDialog=this.MinuteDialog;
|
|
4632
4631
|
|
|
4633
4632
|
//右键菜单
|
|
4634
|
-
if (option.IsShowRightMenu
|
|
4633
|
+
if (IFrameSplitOperator.IsBool(option.IsShowRightMenu)) chart.IsShowRightMenu=option.IsShowRightMenu;
|
|
4635
4634
|
|
|
4636
4635
|
if (option.KLine) //k线图的属性设置
|
|
4637
4636
|
{
|
|
@@ -4851,7 +4850,7 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
4851
4850
|
|
|
4852
4851
|
if (option.MinuteInfo) chart.CreateMinuteInfo(option.MinuteInfo);
|
|
4853
4852
|
|
|
4854
|
-
if (option.IsShowRightMenu
|
|
4853
|
+
if (IFrameSplitOperator.IsBool(option.IsShowRightMenu)) chart.IsShowRightMenu=option.IsShowRightMenu;
|
|
4855
4854
|
|
|
4856
4855
|
if (IFrameSplitOperator.IsNumber(option.DayCount)) chart.DayCount=option.DayCount;
|
|
4857
4856
|
|
|
@@ -5570,6 +5569,7 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
5570
5569
|
if (!chart) return false;
|
|
5571
5570
|
|
|
5572
5571
|
this.JSChartContainer=chart;
|
|
5572
|
+
chart.DivElement=this.DivElement;
|
|
5573
5573
|
|
|
5574
5574
|
if (option.DefaultCursor) chart.DefaultCursor=option.DefaultCursor;
|
|
5575
5575
|
if (option.OnCreatedCallback) option.OnCreatedCallback(chart);
|
|
@@ -5577,13 +5577,10 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
5577
5577
|
//是否自动更新
|
|
5578
5578
|
if (option.IsAutoUpdate!=null) chart.IsAutoUpdate=option.IsAutoUpdate;
|
|
5579
5579
|
if (option.AutoUpdateFrequency>0) chart.AutoUpdateFrequency=option.AutoUpdateFrequency;
|
|
5580
|
+
|
|
5580
5581
|
//内置菜单
|
|
5581
|
-
if (option.EnablePopMenuV2===true)
|
|
5582
|
-
|
|
5583
|
-
chart.JSPopMenu=new JSPopMenu();
|
|
5584
|
-
chart.JSPopMenu.Inital();
|
|
5585
|
-
chart.EnablePopMenuV2=true;
|
|
5586
|
-
}
|
|
5582
|
+
if (option.EnablePopMenuV2===true) chart.InitalPopMenu();
|
|
5583
|
+
|
|
5587
5584
|
//注册事件
|
|
5588
5585
|
if (option.EventCallback)
|
|
5589
5586
|
{
|
|
@@ -6058,10 +6055,19 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
6058
6055
|
{
|
|
6059
6056
|
if(this.JSChartContainer && typeof(this.JSChartContainer.PopupMenuByTab)=='function')
|
|
6060
6057
|
{
|
|
6061
|
-
JSConsole.Chart.Log('[JSChart:
|
|
6058
|
+
JSConsole.Chart.Log('[JSChart:PopupMenuByTab] ');
|
|
6062
6059
|
return this.JSChartContainer.PopupMenuByTab(menuData, rtTab);
|
|
6063
6060
|
}
|
|
6064
6061
|
}
|
|
6062
|
+
|
|
6063
|
+
this.PopupMenuByDrapdown=function(menuData, rtButton)
|
|
6064
|
+
{
|
|
6065
|
+
if(this.JSChartContainer && typeof(this.JSChartContainer.PopupMenuByDrapdown)=='function')
|
|
6066
|
+
{
|
|
6067
|
+
JSConsole.Chart.Log('[JSChart:PopupMenuByDrapdown] ');
|
|
6068
|
+
return this.JSChartContainer.PopupMenuByDrapdown(menuData, rtButton);
|
|
6069
|
+
}
|
|
6070
|
+
}
|
|
6065
6071
|
}
|
|
6066
6072
|
|
|
6067
6073
|
JSChart.LastVersion=null; //最新的版本号
|
|
@@ -6586,6 +6592,10 @@ var JSCHART_MENU_ID=
|
|
|
6586
6592
|
|
|
6587
6593
|
CMD_ENABLE_SELECT_RECT_ID:22, //启动区间选择
|
|
6588
6594
|
CMD_CHANGE_DAY_COUNT_ID:23, //切换天数
|
|
6595
|
+
CMD_SHOW_BEFORE_DATA_ID:24, //显示|隐藏集合竞价
|
|
6596
|
+
|
|
6597
|
+
CMD_SELECTED_ZOOM_ID:25, //选中放大
|
|
6598
|
+
CMD_SELECTED_SUMMARY_ID:26, //区间统计
|
|
6589
6599
|
}
|
|
6590
6600
|
|
|
6591
6601
|
|
|
@@ -6673,11 +6683,6 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
6673
6683
|
this.LoadDataSplashTitle="数据加载中"; //下载数据提示信息
|
|
6674
6684
|
this.DefaultCursor="default"; //crosshair , default 默认手型
|
|
6675
6685
|
|
|
6676
|
-
this.EnablePopMenuV2=false;
|
|
6677
|
-
this.JSPopMenu; //内置菜单
|
|
6678
|
-
//this.JSPopMenu=new JSPopMenu(); //内置菜单
|
|
6679
|
-
//this.JSPopMenu.Inital();
|
|
6680
|
-
|
|
6681
6686
|
//绘图缓存
|
|
6682
6687
|
this.CacheCanvas=null;
|
|
6683
6688
|
this.CacheElement=null;
|
|
@@ -6756,9 +6761,6 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
6756
6761
|
this.SelectRect.oncontextmenu=function() { return false; }; //屏蔽选中区域系统右键菜单
|
|
6757
6762
|
uielement.parentNode.appendChild(this.SelectRect);
|
|
6758
6763
|
|
|
6759
|
-
//区间选择右键菜单
|
|
6760
|
-
this.SelectRectRightMenu;
|
|
6761
|
-
|
|
6762
6764
|
//坐标轴风格方法 double-更加数值型分割 price-更加股票价格分割
|
|
6763
6765
|
this.FrameSplitData=new Map();
|
|
6764
6766
|
this.FrameSplitData.set("double",new SplitData());
|
|
@@ -6818,12 +6820,23 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
6818
6820
|
|
|
6819
6821
|
this.StockCache={ Data:null }; //扩展数据缓存数据
|
|
6820
6822
|
|
|
6823
|
+
this.JSPopMenu; //内置菜单
|
|
6824
|
+
this.IsShowRightMenu=true; //显示右键菜单
|
|
6825
|
+
|
|
6821
6826
|
|
|
6822
6827
|
this.ClearStockCache=function()
|
|
6823
6828
|
{
|
|
6824
6829
|
this.StockCache.Data=null;
|
|
6825
6830
|
}
|
|
6826
6831
|
|
|
6832
|
+
this.InitalPopMenu=function() //初始化弹出窗口
|
|
6833
|
+
{
|
|
6834
|
+
if (this.JSPopMenu) return;
|
|
6835
|
+
|
|
6836
|
+
this.JSPopMenu=new JSPopMenu(); //内置菜单
|
|
6837
|
+
this.JSPopMenu.Inital();
|
|
6838
|
+
}
|
|
6839
|
+
|
|
6827
6840
|
//obj={ Element:, Canvas: }
|
|
6828
6841
|
this.SetCorssCursorElement=function(obj)
|
|
6829
6842
|
{
|
|
@@ -6992,6 +7005,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
6992
7005
|
this.UIOnContextMenu=function(e)
|
|
6993
7006
|
{
|
|
6994
7007
|
if (this.ChartSplashPaint && this.ChartSplashPaint.IsEnableSplash == true) return;
|
|
7008
|
+
if (!this.IsShowRightMenu) return;
|
|
6995
7009
|
|
|
6996
7010
|
var x = e.clientX-this.UIElement.getBoundingClientRect().left;
|
|
6997
7011
|
var y = e.clientY-this.UIElement.getBoundingClientRect().top;
|
|
@@ -7233,7 +7247,6 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
7233
7247
|
}
|
|
7234
7248
|
|
|
7235
7249
|
this.HideSelectRect();
|
|
7236
|
-
if (this.SelectRectRightMenu) this.SelectRectRightMenu.Hide();
|
|
7237
7250
|
if (this.ChartPictureMenu) this.ChartPictureMenu.Hide();
|
|
7238
7251
|
|
|
7239
7252
|
var paint=this.GetRectSelectPaint();
|
|
@@ -7873,17 +7886,19 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
7873
7886
|
}
|
|
7874
7887
|
else
|
|
7875
7888
|
{
|
|
7876
|
-
if (isShowMenu
|
|
7889
|
+
if (isShowMenu)
|
|
7877
7890
|
{
|
|
7878
|
-
|
|
7879
|
-
{
|
|
7891
|
+
var data=
|
|
7892
|
+
{
|
|
7880
7893
|
Chart:this,
|
|
7881
7894
|
X:drag.LastMove.X-uielement.getBoundingClientRect().left,
|
|
7882
7895
|
Y:drag.LastMove.Y-uielement.getBoundingClientRect().top,
|
|
7883
7896
|
SelectData:selectData, //区间选择的数据
|
|
7884
7897
|
RectSelectPaint:paint //区间选择背景
|
|
7885
7898
|
};
|
|
7886
|
-
|
|
7899
|
+
|
|
7900
|
+
e.data=data;
|
|
7901
|
+
this.PopupSelectRectMenuV2(data, e);
|
|
7887
7902
|
}
|
|
7888
7903
|
}
|
|
7889
7904
|
}
|
|
@@ -12936,6 +12951,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
12936
12951
|
}
|
|
12937
12952
|
}
|
|
12938
12953
|
|
|
12954
|
+
//点tab弹菜单
|
|
12939
12955
|
this.PopupMenuByTab=function(menuData, rtTab)
|
|
12940
12956
|
{
|
|
12941
12957
|
if (!this.JSPopMenu) return;
|
|
@@ -12959,7 +12975,32 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
12959
12975
|
this.JSPopMenu.PopupMenuByTab(rtCell);
|
|
12960
12976
|
}
|
|
12961
12977
|
|
|
12962
|
-
|
|
12978
|
+
//下拉菜单
|
|
12979
|
+
this.PopupMenuByDrapdown=function(menuData, rtButton)
|
|
12980
|
+
{
|
|
12981
|
+
if (!this.JSPopMenu) return;
|
|
12982
|
+
|
|
12983
|
+
var pixelRatio=GetDevicePixelRatio();
|
|
12984
|
+
var rtCell={ Left:rtButton.Left/pixelRatio, Right:rtButton.Right/pixelRatio, Bottom:rtButton.Bottom/pixelRatio, Top:rtButton.Top/pixelRatio };
|
|
12985
|
+
rtCell.Width=rtCell.Right-rtCell.Left;
|
|
12986
|
+
rtCell.Height=rtCell.Bottom-rtCell.Top;
|
|
12987
|
+
|
|
12988
|
+
var rtClient=this.UIElement.getBoundingClientRect();
|
|
12989
|
+
var rtScroll=GetScrollPosition();
|
|
12990
|
+
|
|
12991
|
+
var offsetLeft=rtClient.left+rtScroll.Left;
|
|
12992
|
+
var offsetTop=rtClient.top+rtScroll.Top;
|
|
12993
|
+
rtCell.Left+=offsetLeft;
|
|
12994
|
+
rtCell.Right+=offsetLeft;
|
|
12995
|
+
rtCell.Top+=offsetTop;
|
|
12996
|
+
rtCell.Bottom+=offsetTop;
|
|
12997
|
+
|
|
12998
|
+
this.JSPopMenu.CreatePopMenu(menuData);
|
|
12999
|
+
this.JSPopMenu.PopupMenuByDrapdown(rtCell);
|
|
13000
|
+
}
|
|
13001
|
+
|
|
13002
|
+
//右键菜单
|
|
13003
|
+
this.PopupMenuByRClick=function(menuData, x, y)
|
|
12963
13004
|
{
|
|
12964
13005
|
var rtClient=this.UIElement.getBoundingClientRect();
|
|
12965
13006
|
var rtScroll=GetScrollPosition();
|
|
@@ -13140,6 +13181,18 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
13140
13181
|
if (this.ChangeDayCount && param!=null)
|
|
13141
13182
|
this.ChangeDayCount(param);
|
|
13142
13183
|
break;
|
|
13184
|
+
case JSCHART_MENU_ID.CMD_SHOW_BEFORE_DATA_ID:
|
|
13185
|
+
if (this.ShowCallAuctionData && IFrameSplitOperator.IsBool(srcParam))
|
|
13186
|
+
this.ShowCallAuctionData({ Left:srcParam, MultiDay:{ Left:srcParam }});
|
|
13187
|
+
break;
|
|
13188
|
+
|
|
13189
|
+
case JSCHART_MENU_ID.CMD_SELECTED_ZOOM_ID:
|
|
13190
|
+
if (this.ShowSelectData && srcParam) this.ShowSelectData(srcParam);
|
|
13191
|
+
break;
|
|
13192
|
+
case JSCHART_MENU_ID.CMD_SELECTED_SUMMARY_ID:
|
|
13193
|
+
var dlg=new KLineSelectRectDialog(this.DivElement);
|
|
13194
|
+
dlg.DoModal(srcParam);
|
|
13195
|
+
break;
|
|
13143
13196
|
}
|
|
13144
13197
|
}
|
|
13145
13198
|
}
|
|
@@ -16368,7 +16421,7 @@ function MinuteFrame()
|
|
|
16368
16421
|
for(var i=0;i<this.CustomToolbar.length;++i)
|
|
16369
16422
|
{
|
|
16370
16423
|
var item=this.CustomToolbar[i];
|
|
16371
|
-
if (item.ID && item.Style) aryButton.push({ ID:item.ID, Style:item.Style, TooltipText:item.TooltipText });
|
|
16424
|
+
if (item.ID && item.Style) aryButton.push({ ID:item.ID, Style:item.Style, TooltipText:item.TooltipText, Data:item.Data });
|
|
16372
16425
|
}
|
|
16373
16426
|
}
|
|
16374
16427
|
|
|
@@ -18498,7 +18551,7 @@ function KLineFrame()
|
|
|
18498
18551
|
var item=this.CustomToolbar[i];
|
|
18499
18552
|
if (item.ID && item.Style)
|
|
18500
18553
|
{
|
|
18501
|
-
var btnItem={ ID:item.ID, Style:item.Style, TooltipText:item.TooltipText};
|
|
18554
|
+
var btnItem={ ID:item.ID, Style:item.Style, TooltipText:item.TooltipText, Data:item.Data };
|
|
18502
18555
|
|
|
18503
18556
|
if (item.IsLeft===true) //左侧按钮
|
|
18504
18557
|
{
|
|
@@ -18564,7 +18617,7 @@ function KLineFrame()
|
|
|
18564
18617
|
var item=this.CustomToolbar[i];
|
|
18565
18618
|
if (item.ID && item.Style)
|
|
18566
18619
|
{
|
|
18567
|
-
var btnItem={ ID:item.ID, Style:item.Style, TooltipText:item.TooltipText};
|
|
18620
|
+
var btnItem={ ID:item.ID, Style:item.Style, TooltipText:item.TooltipText, Data:item.Data };
|
|
18568
18621
|
if (item.IsLeft===true) aryLeftButton.push(btnItem); //左侧按钮
|
|
18569
18622
|
}
|
|
18570
18623
|
}
|
|
@@ -57570,7 +57623,7 @@ function DynamicChartTitlePainting()
|
|
|
57570
57623
|
var rtButton={ Left:left, YCenter:yCenter };
|
|
57571
57624
|
this.DrawButton(item, rtButton, moveonPoint, mouseStatus);
|
|
57572
57625
|
|
|
57573
|
-
this.Buttons.push({ ID:item.ID, Rect:rtButton, FrameID:this.Frame.Identify, Type:0 }); //Type 0=主图按钮 1=附图按钮 2=主图指标名字按钮
|
|
57626
|
+
this.Buttons.push({ ID:item.ID, Rect:rtButton, FrameID:this.Frame.Identify, Type:0, Data:item.Data }); //Type 0=主图按钮 1=附图按钮 2=主图指标名字按钮
|
|
57574
57627
|
|
|
57575
57628
|
left=rtButton.Right;
|
|
57576
57629
|
|
|
@@ -57631,7 +57684,7 @@ function DynamicChartTitlePainting()
|
|
|
57631
57684
|
var rect=item.Rect;
|
|
57632
57685
|
if (x>rect.Left && x<rect.Right && y>rect.Top && y<rect.Bottom)
|
|
57633
57686
|
{
|
|
57634
|
-
var result= { ID:item.ID, Rect:rect, FrameID:item.FrameID, Type:item.Type };
|
|
57687
|
+
var result= { ID:item.ID, Rect:rect, FrameID:item.FrameID, Type:item.Type, Data:item.Data };
|
|
57635
57688
|
if (item.Type==1)
|
|
57636
57689
|
{
|
|
57637
57690
|
result.Title=item.Title;
|
|
@@ -59837,8 +59890,9 @@ function ChartDrawHLine()
|
|
|
59837
59890
|
|
|
59838
59891
|
this.Button=
|
|
59839
59892
|
{
|
|
59840
|
-
CloseIcon: { Text:'\ue62b', Color:'rgb(255,255,255)', Family:"iconfont", Size:16 },
|
|
59841
|
-
SettingIcon: { Text:'\ue623',Color:'rgb(255,255,255)', Family:"iconfont", Size:16 }
|
|
59893
|
+
CloseIcon: { Text:'\ue62b', Color:'rgb(255,255,255)', Family:"iconfont", Size:16, ID:JSCHART_BUTTON_ID.DRAW_PICTURE_DELETE, TooltipText:null },
|
|
59894
|
+
SettingIcon: { Text:'\ue623',Color:'rgb(255,255,255)', Family:"iconfont", Size:16, ID:JSCHART_BUTTON_ID.DRAW_PICTURE_SETTING, TooltipText:null }
|
|
59895
|
+
//修改ID, Text , TooltipText 可以外部定制按钮
|
|
59842
59896
|
}
|
|
59843
59897
|
|
|
59844
59898
|
this.AryButton=[];
|
|
@@ -60032,6 +60086,7 @@ function ChartDrawHLine()
|
|
|
60032
60086
|
this.CalculateButtonSize();
|
|
60033
60087
|
this.DrawValueText(drawPoint[0].Y, rtDraw, labInfo);
|
|
60034
60088
|
if (labInfo) this.DrawRightLab(labInfo, rtDraw);
|
|
60089
|
+
if (labInfo) this.DrawCustomHLine(labInfo, drawPoint[0].Y);
|
|
60035
60090
|
}
|
|
60036
60091
|
|
|
60037
60092
|
|
|
@@ -60171,6 +60226,53 @@ function ChartDrawHLine()
|
|
|
60171
60226
|
}
|
|
60172
60227
|
}
|
|
60173
60228
|
|
|
60229
|
+
this.DrawCustomHLine=function(labInfo, yLine)
|
|
60230
|
+
{
|
|
60231
|
+
if (!labInfo) return;
|
|
60232
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(labInfo.AryLine)) return;
|
|
60233
|
+
|
|
60234
|
+
var left=this.Frame.ChartBorder.GetLeft();
|
|
60235
|
+
var right=this.Frame.ChartBorder.GetRight();
|
|
60236
|
+
var pixelRatio=GetDevicePixelRatio();
|
|
60237
|
+
|
|
60238
|
+
var yMax=yLine, yMin=yLine;
|
|
60239
|
+
for(var i=0;i<labInfo.AryLine.length;++i)
|
|
60240
|
+
{
|
|
60241
|
+
var item=labInfo.AryLine[i];
|
|
60242
|
+
if (!IFrameSplitOperator.IsNumber(item.Value)) continue;
|
|
60243
|
+
|
|
60244
|
+
var y=this.Frame.GetYFromData(item.Value);
|
|
60245
|
+
var yFixed=ToFixedPoint(y);
|
|
60246
|
+
var xRight=right;
|
|
60247
|
+
if (IFrameSplitOperator.IsNumber(item.Width)) xRight=left+item.Width*pixelRatio;
|
|
60248
|
+
if (item.Color) this.Canvas.strokeStyle=item.Color;
|
|
60249
|
+
else this.Canvas.strokeStyle=this.LineColor;
|
|
60250
|
+
|
|
60251
|
+
this.Canvas.beginPath();
|
|
60252
|
+
this.Canvas.moveTo(left,yFixed);
|
|
60253
|
+
this.Canvas.lineTo(xRight,yFixed);
|
|
60254
|
+
this.Canvas.stroke();
|
|
60255
|
+
|
|
60256
|
+
if (yMax<yFixed) yMax=yFixed;
|
|
60257
|
+
if (yMin>yFixed) yMin=yFixed;
|
|
60258
|
+
}
|
|
60259
|
+
|
|
60260
|
+
if (yMax!=yMin && labInfo.VLine)
|
|
60261
|
+
{
|
|
60262
|
+
var item=labInfo.VLine;
|
|
60263
|
+
var x=left+20*pixelRatio;
|
|
60264
|
+
if (IFrameSplitOperator.IsNumber(item.XOffset)) x=left+item.XOffset*pixelRatio;
|
|
60265
|
+
x=ToFixedPoint(x);
|
|
60266
|
+
if (item.Color) this.Canvas.strokeStyle=item.Color;
|
|
60267
|
+
else this.Canvas.strokeStyle=this.LineColor;
|
|
60268
|
+
|
|
60269
|
+
this.Canvas.beginPath();
|
|
60270
|
+
this.Canvas.moveTo(x,yMax);
|
|
60271
|
+
this.Canvas.lineTo(x,yMin);
|
|
60272
|
+
this.Canvas.stroke();
|
|
60273
|
+
}
|
|
60274
|
+
}
|
|
60275
|
+
|
|
60174
60276
|
this.DrawValueText=function(y, rtDraw, labInfo)
|
|
60175
60277
|
{
|
|
60176
60278
|
var left=this.Frame.ChartBorder.GetLeft();
|
|
@@ -60315,7 +60417,7 @@ function ChartDrawHLine()
|
|
|
60315
60417
|
this.Canvas.fillStyle=icon.Color;
|
|
60316
60418
|
this.Canvas.fillText(this.Button.SettingIcon.Text,xCenter,yCenter);
|
|
60317
60419
|
|
|
60318
|
-
this.AryButton.push({Rect:rtButton, ID:
|
|
60420
|
+
this.AryButton.push({Rect:rtButton, ID:icon.ID, TooltipText:icon.TooltipText});
|
|
60319
60421
|
|
|
60320
60422
|
/*
|
|
60321
60423
|
if (this.ColseButtonSize>0)
|
|
@@ -60347,7 +60449,7 @@ function ChartDrawHLine()
|
|
|
60347
60449
|
this.Canvas.fillStyle=icon.Color;
|
|
60348
60450
|
this.Canvas.fillText(this.Button.CloseIcon.Text,xCenter,yCenter);
|
|
60349
60451
|
|
|
60350
|
-
this.AryButton.push({Rect:rtButton,ID:
|
|
60452
|
+
this.AryButton.push({Rect:rtButton,ID:icon.ID, TooltipText:icon.TooltipText });
|
|
60351
60453
|
|
|
60352
60454
|
left=rtButton.Right;
|
|
60353
60455
|
}
|
|
@@ -72347,10 +72449,9 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
72347
72449
|
isShowMenu=data.IsShowMenu;
|
|
72348
72450
|
}
|
|
72349
72451
|
|
|
72350
|
-
|
|
72351
|
-
if (isShowMenu && this.SelectRectRightMenu)
|
|
72452
|
+
if (isShowMenu)
|
|
72352
72453
|
{
|
|
72353
|
-
|
|
72454
|
+
var data=
|
|
72354
72455
|
{
|
|
72355
72456
|
Chart:this,
|
|
72356
72457
|
X:x,
|
|
@@ -72358,8 +72459,9 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
72358
72459
|
SelectData:selectData, //区间选择的数据
|
|
72359
72460
|
RectSelectPaint:paint //区间选择背景
|
|
72360
72461
|
};
|
|
72462
|
+
e.data=data;
|
|
72361
72463
|
|
|
72362
|
-
this.
|
|
72464
|
+
this.PopupSelectRectMenuV2(data, e);
|
|
72363
72465
|
}
|
|
72364
72466
|
}
|
|
72365
72467
|
|
|
@@ -72394,7 +72496,6 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
72394
72496
|
this.ShowSelectData=function(selectData)
|
|
72395
72497
|
{
|
|
72396
72498
|
this.HideSelectRect();
|
|
72397
|
-
if (this.SelectRectRightMenu) this.SelectRectRightMenu.Hide();
|
|
72398
72499
|
|
|
72399
72500
|
JSConsole.Chart.Log('[KLineChartContainer::ShowSelectData] selectData', selectData);
|
|
72400
72501
|
var dataOffset=selectData.Start;
|
|
@@ -72479,9 +72580,9 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
72479
72580
|
isShowMenu=data.IsShowMenu;
|
|
72480
72581
|
}
|
|
72481
72582
|
|
|
72482
|
-
if (isShowMenu
|
|
72583
|
+
if (isShowMenu)
|
|
72483
72584
|
{
|
|
72484
|
-
|
|
72585
|
+
var data=
|
|
72485
72586
|
{
|
|
72486
72587
|
Chart:this,
|
|
72487
72588
|
X:corssCursor.LastPoint.X/pixelTatio,
|
|
@@ -72489,7 +72590,9 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
72489
72590
|
SelectData:selectData, //区间选择的数据
|
|
72490
72591
|
RectSelectPaint:paint //区间选择背景
|
|
72491
72592
|
};
|
|
72492
|
-
|
|
72593
|
+
e.data=data
|
|
72594
|
+
|
|
72595
|
+
this.PopupSelectRectMenuV2(data, e);
|
|
72493
72596
|
}
|
|
72494
72597
|
}
|
|
72495
72598
|
|
|
@@ -76400,22 +76503,12 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
76400
76503
|
this.OnRightMenu=function(x,y,e)
|
|
76401
76504
|
{
|
|
76402
76505
|
var pixelTatio = GetDevicePixelRatio(); //x,y 需要乘以放大倍速
|
|
76403
|
-
|
|
76404
|
-
{
|
|
76405
|
-
|
|
76406
|
-
this.PopuRightMenuV2({X:e.offsetX, Y:e.offsetY, FrameID:frameId}, e);
|
|
76407
|
-
}
|
|
76408
|
-
else if (this.RightMenu)
|
|
76409
|
-
{
|
|
76410
|
-
var frameId=this.Frame.PtInFrame(x*pixelTatio,y*pixelTatio);
|
|
76411
|
-
e.data={ Chart:this, FrameID:frameId };
|
|
76412
|
-
this.RightMenu.DoModal(e);
|
|
76413
|
-
}
|
|
76414
|
-
|
|
76506
|
+
var frameId=this.Frame.PtInFrame(x*pixelTatio,y*pixelTatio);
|
|
76507
|
+
this.PopupRightMenuV2({X:e.offsetX, Y:e.offsetY, FrameID:frameId}, e);
|
|
76508
|
+
|
|
76415
76509
|
var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CONTEXT_MENU);
|
|
76416
76510
|
if (event)
|
|
76417
76511
|
{
|
|
76418
|
-
var frameId=this.Frame.PtInFrame(x*pixelTatio,y*pixelTatio);
|
|
76419
76512
|
var data={ X:x, Y:y, Event:e, FrameID:frameId };
|
|
76420
76513
|
event.Callback(event,data,this);
|
|
76421
76514
|
}
|
|
@@ -76682,7 +76775,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
76682
76775
|
return aryMenu;
|
|
76683
76776
|
}
|
|
76684
76777
|
|
|
76685
|
-
this.
|
|
76778
|
+
this.PopupRightMenuV2=function(data,e)
|
|
76686
76779
|
{
|
|
76687
76780
|
if (!this.JSPopMenu) return;
|
|
76688
76781
|
var x=data.X, y=data.Y;
|
|
@@ -76690,7 +76783,21 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
76690
76783
|
var menuData={ Menu:this.GetRightMenuData(frameID), Position:JSPopMenu.POSITION_ID.RIGHT_MENU_ID };
|
|
76691
76784
|
menuData.ClickCallback=(data)=>{ this.OnClickRightMenu(data); }
|
|
76692
76785
|
|
|
76693
|
-
this.
|
|
76786
|
+
this.PopupMenuByRClick(menuData, x, y);
|
|
76787
|
+
}
|
|
76788
|
+
|
|
76789
|
+
this.PopupSelectRectMenuV2=function(data, e)
|
|
76790
|
+
{
|
|
76791
|
+
var aryMenu=
|
|
76792
|
+
[
|
|
76793
|
+
{ Name:"区间统计", Data:{ ID:JSCHART_MENU_ID.CMD_SELECTED_SUMMARY_ID, Args:[e] }},
|
|
76794
|
+
{ Name:"区间放大", Data:{ ID:JSCHART_MENU_ID.CMD_SELECTED_ZOOM_ID, Args:[data.SelectData] }}
|
|
76795
|
+
];
|
|
76796
|
+
|
|
76797
|
+
var menuData={ Menu:aryMenu, Position:JSPopMenu.POSITION_ID.RIGHT_MENU_ID };
|
|
76798
|
+
menuData.ClickCallback=(data)=>{ this.OnClickRightMenu(data); }
|
|
76799
|
+
var x=data.X, y=data.Y;
|
|
76800
|
+
this.PopupMenuByRClick(menuData, x, y);
|
|
76694
76801
|
}
|
|
76695
76802
|
|
|
76696
76803
|
//重新加载画图工具(切换股票|周期)
|
|
@@ -78079,7 +78186,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
78079
78186
|
var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_TITLE_BUTTON);
|
|
78080
78187
|
if (event && event.Callback)
|
|
78081
78188
|
{
|
|
78082
|
-
var data={ Info:button, PreventDefault:false
|
|
78189
|
+
var data={ Info:button, PreventDefault:false, e:e }; //PreventDefault 是否阻止内置的点击处理
|
|
78083
78190
|
event.Callback(event,data,this);
|
|
78084
78191
|
if (data.PreventDefault) return;
|
|
78085
78192
|
}
|
|
@@ -80059,22 +80166,12 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
80059
80166
|
this.OnRightMenu=function(x,y,e)
|
|
80060
80167
|
{
|
|
80061
80168
|
var pixelTatio = GetDevicePixelRatio(); //x,y 需要乘以放大倍速
|
|
80062
|
-
|
|
80063
|
-
{
|
|
80064
|
-
|
|
80065
|
-
this.PopuRightMenuV2({X:e.offsetX, Y:e.offsetY, FrameID:frameId}, e);
|
|
80066
|
-
}
|
|
80067
|
-
else if (this.RightMenu)
|
|
80068
|
-
{
|
|
80069
|
-
var frameId=this.Frame.PtInFrame(x,y);
|
|
80070
|
-
e.data={ Chart:this, FrameID:frameId };
|
|
80071
|
-
this.RightMenu.DoModal(e);
|
|
80072
|
-
}
|
|
80073
|
-
|
|
80169
|
+
var frameId=this.Frame.PtInFrame(x*pixelTatio,y*pixelTatio);
|
|
80170
|
+
this.PopupRightMenuV2({X:e.offsetX, Y:e.offsetY, FrameID:frameId}, e);
|
|
80171
|
+
|
|
80074
80172
|
var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CONTEXT_MENU);
|
|
80075
80173
|
if (event)
|
|
80076
80174
|
{
|
|
80077
|
-
var frameId=this.Frame.PtInFrame(x,y);
|
|
80078
80175
|
var data={ X:x, Y:y, Event:e, FrameID:frameId };
|
|
80079
80176
|
event.Callback(event,data,this);
|
|
80080
80177
|
}
|
|
@@ -80092,6 +80189,9 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
80092
80189
|
if (item && item.Symbol) aryOverlaySymbol.push(item.Symbol)
|
|
80093
80190
|
}
|
|
80094
80191
|
|
|
80192
|
+
var bShowDrawTool=false;
|
|
80193
|
+
if (this.GetExtendChartByClassName('DrawToolsButton')) bShowDrawTool=true; //画图工具
|
|
80194
|
+
|
|
80095
80195
|
var aryMenu=
|
|
80096
80196
|
[
|
|
80097
80197
|
{
|
|
@@ -80144,10 +80244,23 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
80144
80244
|
},
|
|
80145
80245
|
{
|
|
80146
80246
|
Name:"区间选择",Data:{ ID: JSCHART_MENU_ID.CMD_ENABLE_SELECT_RECT_ID, Args:[!this.EnableSelectRect]}, Checked:this.EnableSelectRect
|
|
80247
|
+
},
|
|
80248
|
+
{
|
|
80249
|
+
Name:"其他设置",
|
|
80250
|
+
SubMenu:
|
|
80251
|
+
[
|
|
80252
|
+
{ Name:"画图工具", Data:{ ID:bShowDrawTool?JSCHART_MENU_ID.CMD_HIDE_DRAWTOOL_ID:JSCHART_MENU_ID.CMD_SHOW_DRAWTOOL_ID, Args:[]}, Checked:bShowDrawTool},
|
|
80253
|
+
]
|
|
80147
80254
|
}
|
|
80148
80255
|
|
|
80149
80256
|
];
|
|
80150
80257
|
|
|
80258
|
+
if (MARKET_SUFFIX_NAME.IsSHSZStockA(this.Symbol))
|
|
80259
|
+
{
|
|
80260
|
+
var item={ Name:"集合竞价",Data:{ ID: JSCHART_MENU_ID.CMD_SHOW_BEFORE_DATA_ID, Args:[!this.IsShowBeforeData] }, Checked:this.IsShowBeforeData };
|
|
80261
|
+
aryMenu.splice(4,0,item);
|
|
80262
|
+
}
|
|
80263
|
+
|
|
80151
80264
|
|
|
80152
80265
|
//删除菜单
|
|
80153
80266
|
for(var i=0;i<aryMenu.length;++i)
|
|
@@ -80170,7 +80283,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
80170
80283
|
return aryMenu;
|
|
80171
80284
|
}
|
|
80172
80285
|
|
|
80173
|
-
this.
|
|
80286
|
+
this.PopupRightMenuV2=function(data,e)
|
|
80174
80287
|
{
|
|
80175
80288
|
if (!this.JSPopMenu) return;
|
|
80176
80289
|
var x=data.X, y=data.Y;
|
|
@@ -80178,7 +80291,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
80178
80291
|
var menuData={ Menu:this.GetRightMenuData(frameID), Position:JSPopMenu.POSITION_ID.RIGHT_MENU_ID };
|
|
80179
80292
|
menuData.ClickCallback=(data)=>{ this.OnClickRightMenu(data); }
|
|
80180
80293
|
|
|
80181
|
-
this.
|
|
80294
|
+
this.PopupMenuByRClick(menuData, x, y);
|
|
80182
80295
|
}
|
|
80183
80296
|
|
|
80184
80297
|
this.OnWheel=function(e)
|
|
@@ -90097,1479 +90210,6 @@ function WaitDialog(divElement)
|
|
|
90097
90210
|
}
|
|
90098
90211
|
}
|
|
90099
90212
|
|
|
90100
|
-
//K线右键菜单类
|
|
90101
|
-
//id:"kline"
|
|
90102
|
-
function KLineRightMenu(divElement)
|
|
90103
|
-
{
|
|
90104
|
-
this.newMethod=IDivDialog; //派生
|
|
90105
|
-
this.newMethod(divElement);
|
|
90106
|
-
delete this.newMethod;
|
|
90107
|
-
|
|
90108
|
-
this.option={};
|
|
90109
|
-
|
|
90110
|
-
this.Create = function () {
|
|
90111
|
-
var _self = this;
|
|
90112
|
-
|
|
90113
|
-
this.ID=Guid();
|
|
90114
|
-
|
|
90115
|
-
_self.BindData();
|
|
90116
|
-
_self.BindEvent();
|
|
90117
|
-
}
|
|
90118
|
-
this.BindData=function(){
|
|
90119
|
-
var _self = this;
|
|
90120
|
-
|
|
90121
|
-
var id=this.DivElement.id;
|
|
90122
|
-
var $body = $("#" + id);
|
|
90123
|
-
|
|
90124
|
-
$body.find("div[id^='topMenu_']").remove();
|
|
90125
|
-
$body.find("div[id^='childMenu_']").remove();
|
|
90126
|
-
|
|
90127
|
-
var $topMenu = $("<div />");
|
|
90128
|
-
$topMenu.attr("id", "topMenu_"+_self.ID).addClass("context-menu-wrapper topmenu").hide();
|
|
90129
|
-
$body.append($topMenu);
|
|
90130
|
-
|
|
90131
|
-
var $topTable = $("<table />");
|
|
90132
|
-
$topTable.attr({ id: "topTable_" + _self.ID, cellspacing: "0", cellpadding: "0" }).addClass("context-menu");
|
|
90133
|
-
$topMenu.append($topTable);
|
|
90134
|
-
|
|
90135
|
-
$topTable.append(_self.childrenList(_self.option.data));
|
|
90136
|
-
|
|
90137
|
-
for (var i = 0; i < _self.option.data.length; i++) {
|
|
90138
|
-
var isHasChildren = typeof _self.option.data[i].children != "undefined";
|
|
90139
|
-
|
|
90140
|
-
if (isHasChildren) {
|
|
90141
|
-
|
|
90142
|
-
var $childMenu = $("<div />");
|
|
90143
|
-
$childMenu.attr({ id: "childMenu_"+_self.ID + i, "data-index": i }).addClass("context-menu-wrapper").hide();
|
|
90144
|
-
$body.append($childMenu);
|
|
90145
|
-
|
|
90146
|
-
var $childTable = $("<table />");
|
|
90147
|
-
$childTable.attr({ id: "childTable_" + _self.ID + i, cellspacing: "0", cellpadding: "0" }).addClass("context-menu");
|
|
90148
|
-
$childMenu.append($childTable);
|
|
90149
|
-
|
|
90150
|
-
$childTable.append(_self.childrenList(_self.option.data[i].children));
|
|
90151
|
-
}
|
|
90152
|
-
}
|
|
90153
|
-
}
|
|
90154
|
-
|
|
90155
|
-
this.Update=function()
|
|
90156
|
-
{
|
|
90157
|
-
var _self = this;
|
|
90158
|
-
//var id=this.DivElement.id;
|
|
90159
|
-
//var $body=$("#"+id);
|
|
90160
|
-
//
|
|
90161
|
-
//var $topTable = $("#topTable_" + _self.ID);
|
|
90162
|
-
//$topTable.empty();
|
|
90163
|
-
//$topTable.append(_self.childrenList(_self.option.data));
|
|
90164
|
-
//
|
|
90165
|
-
//for (var i = 0; i < _self.option.data.length; i++) {
|
|
90166
|
-
// var isHasChildren = typeof _self.option.data[i].children != "undefined";
|
|
90167
|
-
//
|
|
90168
|
-
// if (isHasChildren) {
|
|
90169
|
-
// var $childTable = $("#childTable_" + _self.ID + i);
|
|
90170
|
-
// $childTable.empty();
|
|
90171
|
-
// $childTable.append(_self.childrenList(_self.option.data[i].children));
|
|
90172
|
-
// }
|
|
90173
|
-
//}
|
|
90174
|
-
|
|
90175
|
-
_self.BindData();
|
|
90176
|
-
_self.BindEvent();
|
|
90177
|
-
}
|
|
90178
|
-
|
|
90179
|
-
this.childrenList = function(list) {
|
|
90180
|
-
var result = [];
|
|
90181
|
-
|
|
90182
|
-
for (var i = 0; i < list.length; i++) {
|
|
90183
|
-
var isBorder = typeof list[i].isBorder != "undefined" && list[i].isBorder;
|
|
90184
|
-
|
|
90185
|
-
var $tr = $("<tr />");
|
|
90186
|
-
$tr.addClass("font_Arial context-menu");
|
|
90187
|
-
if (isBorder)
|
|
90188
|
-
$tr.addClass("border");
|
|
90189
|
-
|
|
90190
|
-
var $td1 = $("<td />");
|
|
90191
|
-
if(list[i].selected){
|
|
90192
|
-
$td1.addClass("spacer context-menu").html("√");
|
|
90193
|
-
}else{
|
|
90194
|
-
$td1.addClass("spacer context-menu");
|
|
90195
|
-
}
|
|
90196
|
-
|
|
90197
|
-
var $td2 = $("<td />");
|
|
90198
|
-
$td2.addClass("text").html(list[i].text);
|
|
90199
|
-
|
|
90200
|
-
var $td3 = $("<td />");
|
|
90201
|
-
$td3.addClass("right shortcut");
|
|
90202
|
-
|
|
90203
|
-
var $td4 = $("<td />");
|
|
90204
|
-
$td4.addClass(typeof list[i].children != "undefined" ? "submenu-arrow" : "context-menu spacer");
|
|
90205
|
-
|
|
90206
|
-
$tr.append($td1).append($td2).append($td3).append($td4);
|
|
90207
|
-
|
|
90208
|
-
result.push($tr);
|
|
90209
|
-
}
|
|
90210
|
-
return result;
|
|
90211
|
-
}
|
|
90212
|
-
|
|
90213
|
-
this.Show=function (obj) {
|
|
90214
|
-
var _self = this;
|
|
90215
|
-
$.extend(_self.option, obj);
|
|
90216
|
-
|
|
90217
|
-
if (!_self.ID) _self.Create(); //判断是否重复创建
|
|
90218
|
-
else _self.Update(); //更新菜单状态
|
|
90219
|
-
|
|
90220
|
-
var $topMenu = $("#topMenu_"+_self.ID),
|
|
90221
|
-
topWidth = $topMenu.outerWidth(),
|
|
90222
|
-
topHeight = $topMenu.outerHeight();
|
|
90223
|
-
|
|
90224
|
-
var x = _self.option.x,
|
|
90225
|
-
y = _self.option.y;
|
|
90226
|
-
|
|
90227
|
-
if (topWidth > _self.option.position.X + _self.option.position.W- x) //超过了右边距
|
|
90228
|
-
x = x - topWidth;
|
|
90229
|
-
|
|
90230
|
-
if (topHeight > _self.option.position.Y +_self.option.position.H - y)//超过了下边距
|
|
90231
|
-
y = y - topHeight;
|
|
90232
|
-
|
|
90233
|
-
$topMenu.hide();
|
|
90234
|
-
$topMenu.css({ position:"absolute",left: x + "px", top: y + "px" }).show();
|
|
90235
|
-
|
|
90236
|
-
this.isInit = true;
|
|
90237
|
-
}
|
|
90238
|
-
|
|
90239
|
-
this.Hide=function () {
|
|
90240
|
-
var _self = this;
|
|
90241
|
-
if (typeof($)=="undefined") return;
|
|
90242
|
-
$("#topMenu_" + _self.ID).hide();
|
|
90243
|
-
$("[id^='childMenu_" + _self.ID + "']").hide();
|
|
90244
|
-
}
|
|
90245
|
-
|
|
90246
|
-
this.BindEvent=function () {
|
|
90247
|
-
var _self = this;
|
|
90248
|
-
var $childMenu = $("[id^='childMenu_" + _self.ID + "']");
|
|
90249
|
-
|
|
90250
|
-
$("#topTable_" + _self.ID).find("tr").mouseenter(function () {
|
|
90251
|
-
var $this = $(this),
|
|
90252
|
-
index = $this.index(),
|
|
90253
|
-
$topMenu = $("#topMenu_" + _self.ID),
|
|
90254
|
-
$child = $("#childMenu_" + _self.ID + index),
|
|
90255
|
-
trWidth = $this.outerWidth(),
|
|
90256
|
-
trHeight = $this.outerHeight();
|
|
90257
|
-
|
|
90258
|
-
var left = $topMenu.position().left + trWidth + 1;
|
|
90259
|
-
var top = $topMenu.position().top + (trHeight * index);
|
|
90260
|
-
|
|
90261
|
-
if (trWidth > _self.option.position.X + _self.option.position.W - left) //超过了右边距
|
|
90262
|
-
left = left - trWidth - $topMenu.outerWidth() - 2;
|
|
90263
|
-
|
|
90264
|
-
if ($child.outerHeight() > _self.option.position.Y +_self.option.position.H - top)//超过了下边距
|
|
90265
|
-
top = $topMenu.position().top + $topMenu.outerHeight() - $child.outerHeight();
|
|
90266
|
-
|
|
90267
|
-
$childMenu.hide();
|
|
90268
|
-
$child.css({ left: left + "px", top: top + "px" }).show();
|
|
90269
|
-
}).mouseleave(function () {
|
|
90270
|
-
var index = $(this).index();
|
|
90271
|
-
setTimeout(function () {
|
|
90272
|
-
if ($("#childMenu_" + _self.ID + index).attr("data-isShow") != 1) {
|
|
90273
|
-
$("#childMenu_" + _self.ID + index).hide();
|
|
90274
|
-
}
|
|
90275
|
-
}, 10)
|
|
90276
|
-
|
|
90277
|
-
}).click(function () {
|
|
90278
|
-
var $this = $(this);
|
|
90279
|
-
var index = $this.index();
|
|
90280
|
-
|
|
90281
|
-
if ($.type(_self.option.data[index].click) == "function") {
|
|
90282
|
-
_self.option.data[index].click(_self.option.returnData);
|
|
90283
|
-
$this.hide();
|
|
90284
|
-
}
|
|
90285
|
-
}).contextmenu(function()
|
|
90286
|
-
{
|
|
90287
|
-
return false; //屏蔽系统右键菜单
|
|
90288
|
-
});
|
|
90289
|
-
|
|
90290
|
-
|
|
90291
|
-
$childMenu.mouseenter(function () {
|
|
90292
|
-
$(this).attr("data-isShow", "1");
|
|
90293
|
-
}).mouseleave(function () {
|
|
90294
|
-
$(this).attr("data-isShow", "0");
|
|
90295
|
-
}).contextmenu(function()
|
|
90296
|
-
{
|
|
90297
|
-
return false; //屏蔽系统右键菜单
|
|
90298
|
-
});
|
|
90299
|
-
|
|
90300
|
-
$childMenu.find("tr").click(function () {
|
|
90301
|
-
var $this = $(this);
|
|
90302
|
-
var divIndex = parseInt($this.closest("div").attr("data-index"));
|
|
90303
|
-
var trIndex = $this.index();
|
|
90304
|
-
|
|
90305
|
-
if ($.type(_self.option.data[divIndex].children[trIndex].click) == "function") {
|
|
90306
|
-
_self.option.data[divIndex].children[trIndex].click(_self.option.windowIndex || 1);
|
|
90307
|
-
$childMenu.hide();
|
|
90308
|
-
}
|
|
90309
|
-
});
|
|
90310
|
-
}
|
|
90311
|
-
|
|
90312
|
-
this.GetPeriod=function (chart)
|
|
90313
|
-
{
|
|
90314
|
-
var data=
|
|
90315
|
-
[
|
|
90316
|
-
{
|
|
90317
|
-
text: "日线", Value:0,
|
|
90318
|
-
click: function () { chart.ChangePeriod(0); }
|
|
90319
|
-
},
|
|
90320
|
-
{
|
|
90321
|
-
text: "周线",Value:1,
|
|
90322
|
-
click: function () { chart.ChangePeriod(1); }
|
|
90323
|
-
},
|
|
90324
|
-
{
|
|
90325
|
-
text: "双周线",Value:21,
|
|
90326
|
-
click: function () { chart.ChangePeriod(21); }
|
|
90327
|
-
},
|
|
90328
|
-
{
|
|
90329
|
-
text: "月线",Value:2,
|
|
90330
|
-
click: function () { chart.ChangePeriod(2); }
|
|
90331
|
-
},
|
|
90332
|
-
{
|
|
90333
|
-
text: "季线",Value:9,
|
|
90334
|
-
click: function () { chart.ChangePeriod(9); }
|
|
90335
|
-
},
|
|
90336
|
-
{
|
|
90337
|
-
text: "半年",Value:22,
|
|
90338
|
-
click: function () { chart.ChangePeriod(22); }
|
|
90339
|
-
},
|
|
90340
|
-
{
|
|
90341
|
-
text: "年线",Value:3,
|
|
90342
|
-
click: function () { chart.ChangePeriod(3); }
|
|
90343
|
-
},
|
|
90344
|
-
{
|
|
90345
|
-
text: "1分",Value:4,
|
|
90346
|
-
click: function () { chart.ChangePeriod(4); }
|
|
90347
|
-
},
|
|
90348
|
-
{
|
|
90349
|
-
text: "5分",Value:5,
|
|
90350
|
-
click: function () { chart.ChangePeriod(5); }
|
|
90351
|
-
},
|
|
90352
|
-
{
|
|
90353
|
-
text: "15分",Value:6,
|
|
90354
|
-
click: function () { chart.ChangePeriod(6); }
|
|
90355
|
-
},
|
|
90356
|
-
{
|
|
90357
|
-
text: "30分",Value:7,
|
|
90358
|
-
click: function () { chart.ChangePeriod(7); }
|
|
90359
|
-
},
|
|
90360
|
-
{
|
|
90361
|
-
text: "60分",Value:8,
|
|
90362
|
-
click: function () { chart.ChangePeriod(8); }
|
|
90363
|
-
},
|
|
90364
|
-
{
|
|
90365
|
-
text: "2小时",Value:11,
|
|
90366
|
-
click: function () { chart.ChangePeriod(11); }
|
|
90367
|
-
},
|
|
90368
|
-
{
|
|
90369
|
-
text: "4小时",Value:12,
|
|
90370
|
-
click: function () { chart.ChangePeriod(12); }
|
|
90371
|
-
},
|
|
90372
|
-
{
|
|
90373
|
-
text: "分笔",Value:10,
|
|
90374
|
-
click: function () { chart.ChangePeriod(10); }
|
|
90375
|
-
},
|
|
90376
|
-
{
|
|
90377
|
-
text: "自定义周期:3分钟",Value:20003,
|
|
90378
|
-
click: function () { chart.ChangePeriod(20003); }
|
|
90379
|
-
},
|
|
90380
|
-
{
|
|
90381
|
-
text: "自定义周期:35分钟",Value:20035,
|
|
90382
|
-
click: function () { chart.ChangePeriod(20035); }
|
|
90383
|
-
},
|
|
90384
|
-
{
|
|
90385
|
-
text: "自定义周期:8日",Value:40008,
|
|
90386
|
-
click: function () { chart.ChangePeriod(40008); }
|
|
90387
|
-
}
|
|
90388
|
-
];
|
|
90389
|
-
|
|
90390
|
-
for(var i in data)
|
|
90391
|
-
{
|
|
90392
|
-
var item=data[i];
|
|
90393
|
-
if (item.Value==chart.Period)
|
|
90394
|
-
{
|
|
90395
|
-
item.selected=true;
|
|
90396
|
-
break;
|
|
90397
|
-
}
|
|
90398
|
-
}
|
|
90399
|
-
|
|
90400
|
-
return data;
|
|
90401
|
-
}
|
|
90402
|
-
|
|
90403
|
-
this.GetRight=function(chart)
|
|
90404
|
-
{
|
|
90405
|
-
var data=
|
|
90406
|
-
[
|
|
90407
|
-
{
|
|
90408
|
-
text: "不复权",
|
|
90409
|
-
click: function () { chart.ChangeRight(0); }
|
|
90410
|
-
},
|
|
90411
|
-
{
|
|
90412
|
-
text: "前复权",
|
|
90413
|
-
click: function () { chart.ChangeRight(1); }
|
|
90414
|
-
},
|
|
90415
|
-
{
|
|
90416
|
-
text: "后复权",
|
|
90417
|
-
click: function () { chart.ChangeRight(2); }
|
|
90418
|
-
}
|
|
90419
|
-
];
|
|
90420
|
-
|
|
90421
|
-
if (chart.Right>=0 && chart.Right<data.length) data[chart.Right].selected=true;
|
|
90422
|
-
|
|
90423
|
-
return data;
|
|
90424
|
-
}
|
|
90425
|
-
|
|
90426
|
-
//指标
|
|
90427
|
-
this.GetIndex=function (chart)
|
|
90428
|
-
{
|
|
90429
|
-
return [{
|
|
90430
|
-
text: "均线",
|
|
90431
|
-
click: function (windowIndex) {
|
|
90432
|
-
chart.ChangeIndex(windowIndex, '均线')
|
|
90433
|
-
}
|
|
90434
|
-
}, {
|
|
90435
|
-
text: "BOLL",
|
|
90436
|
-
click: function (windowIndex) {
|
|
90437
|
-
chart.ChangeIndex(windowIndex, 'BOLL')
|
|
90438
|
-
},
|
|
90439
|
-
isBorder:true
|
|
90440
|
-
}, {
|
|
90441
|
-
text: "MACD",
|
|
90442
|
-
click: function (windowIndex) {
|
|
90443
|
-
chart.ChangeIndex(windowIndex, 'MACD')
|
|
90444
|
-
}
|
|
90445
|
-
}, {
|
|
90446
|
-
text: "KDJ",
|
|
90447
|
-
click: function (windowIndex) {
|
|
90448
|
-
chart.ChangeIndex(windowIndex, 'KDJ')
|
|
90449
|
-
}
|
|
90450
|
-
}, {
|
|
90451
|
-
text: "VOL",
|
|
90452
|
-
click: function (windowIndex) {
|
|
90453
|
-
chart.ChangeIndex(windowIndex, 'VOL')
|
|
90454
|
-
}
|
|
90455
|
-
}, {
|
|
90456
|
-
text: "RSI",
|
|
90457
|
-
click: function (windowIndex) {
|
|
90458
|
-
chart.ChangeIndex(windowIndex, 'RSI')
|
|
90459
|
-
}
|
|
90460
|
-
}, {
|
|
90461
|
-
text: "BRAR",
|
|
90462
|
-
click: function (windowIndex) {
|
|
90463
|
-
chart.ChangeIndex(windowIndex, 'BRAR')
|
|
90464
|
-
}
|
|
90465
|
-
}, {
|
|
90466
|
-
text: "WR",
|
|
90467
|
-
click: function (windowIndex) {
|
|
90468
|
-
chart.ChangeIndex(windowIndex, 'WR')
|
|
90469
|
-
}
|
|
90470
|
-
}, {
|
|
90471
|
-
text: "BIAS",
|
|
90472
|
-
click: function (windowIndex) {
|
|
90473
|
-
chart.ChangeIndex(windowIndex, 'BIAS')
|
|
90474
|
-
}
|
|
90475
|
-
}, {
|
|
90476
|
-
text: "OBV",
|
|
90477
|
-
click: function (windowIndex) {
|
|
90478
|
-
chart.ChangeIndex(windowIndex, 'OBV')
|
|
90479
|
-
}
|
|
90480
|
-
}, {
|
|
90481
|
-
text: "DMI",
|
|
90482
|
-
click: function (windowIndex) {
|
|
90483
|
-
chart.ChangeIndex(windowIndex, 'DMI')
|
|
90484
|
-
}
|
|
90485
|
-
}, {
|
|
90486
|
-
text: "CR",
|
|
90487
|
-
click: function (windowIndex) {
|
|
90488
|
-
chart.ChangeIndex(windowIndex, 'CR')
|
|
90489
|
-
}
|
|
90490
|
-
}, {
|
|
90491
|
-
text: "PSY",
|
|
90492
|
-
click: function (windowIndex) {
|
|
90493
|
-
chart.ChangeIndex(windowIndex, 'PSY')
|
|
90494
|
-
}
|
|
90495
|
-
}, {
|
|
90496
|
-
text: "CCI",
|
|
90497
|
-
click: function (windowIndex) {
|
|
90498
|
-
chart.ChangeIndex(windowIndex, 'CCI')
|
|
90499
|
-
}
|
|
90500
|
-
}, {
|
|
90501
|
-
text: "DMA",
|
|
90502
|
-
click: function (windowIndex) {
|
|
90503
|
-
chart.ChangeIndex(windowIndex, 'DMA')
|
|
90504
|
-
}
|
|
90505
|
-
}, {
|
|
90506
|
-
text: "TRIX",
|
|
90507
|
-
click: function (windowIndex) {
|
|
90508
|
-
chart.ChangeIndex(windowIndex, 'TRIX')
|
|
90509
|
-
}
|
|
90510
|
-
}, {
|
|
90511
|
-
text: "VR",
|
|
90512
|
-
click: function (windowIndex) {
|
|
90513
|
-
chart.ChangeIndex(windowIndex, 'VR')
|
|
90514
|
-
}
|
|
90515
|
-
}, {
|
|
90516
|
-
text: "EMV",
|
|
90517
|
-
click: function (windowIndex) {
|
|
90518
|
-
chart.ChangeIndex(windowIndex, 'EMV')
|
|
90519
|
-
}
|
|
90520
|
-
}, {
|
|
90521
|
-
text: "ROC",
|
|
90522
|
-
click: function (windowIndex) {
|
|
90523
|
-
chart.ChangeIndex(windowIndex, 'ROC')
|
|
90524
|
-
}
|
|
90525
|
-
}, {
|
|
90526
|
-
text: "MIM",
|
|
90527
|
-
click: function (windowIndex) {
|
|
90528
|
-
chart.ChangeIndex(windowIndex, 'MIM')
|
|
90529
|
-
}
|
|
90530
|
-
}, {
|
|
90531
|
-
text: "FSL",
|
|
90532
|
-
click: function (windowIndex) {
|
|
90533
|
-
chart.ChangeIndex(windowIndex, 'FSL')
|
|
90534
|
-
}
|
|
90535
|
-
} ]
|
|
90536
|
-
}
|
|
90537
|
-
|
|
90538
|
-
//五彩K线
|
|
90539
|
-
this.GetColorIndex=function (chart)
|
|
90540
|
-
{
|
|
90541
|
-
var data=
|
|
90542
|
-
[
|
|
90543
|
-
{
|
|
90544
|
-
text: "十字星",
|
|
90545
|
-
click: function (windowIndex) { chart.ChangeInstructionIndex('五彩K线-十字星') }
|
|
90546
|
-
},
|
|
90547
|
-
{
|
|
90548
|
-
text: "早晨之星",
|
|
90549
|
-
click: function (windowIndex) { chart.ChangeInstructionIndex('五彩K线-早晨之星') },
|
|
90550
|
-
},
|
|
90551
|
-
{
|
|
90552
|
-
text: "垂死十字",
|
|
90553
|
-
click: function (windowIndex) { chart.ChangeInstructionIndex('五彩K线-垂死十字') },
|
|
90554
|
-
},
|
|
90555
|
-
{
|
|
90556
|
-
text: "三只乌鸦",
|
|
90557
|
-
click: function (windowIndex) { chart.ChangeInstructionIndex('五彩K线-三只乌鸦') }
|
|
90558
|
-
},
|
|
90559
|
-
{
|
|
90560
|
-
text: "光脚阴线",
|
|
90561
|
-
click: function (windowIndex) { chart.ChangeInstructionIndex('五彩K线-光脚阴线') }
|
|
90562
|
-
},
|
|
90563
|
-
{
|
|
90564
|
-
text: "黄昏之星",
|
|
90565
|
-
click: function (windowIndex) { chart.ChangeInstructionIndex('五彩K线-黄昏之星') }
|
|
90566
|
-
}
|
|
90567
|
-
];
|
|
90568
|
-
|
|
90569
|
-
if (chart.ColorIndex)
|
|
90570
|
-
{
|
|
90571
|
-
data[data.length-1].isBorder=true;
|
|
90572
|
-
data.push(
|
|
90573
|
-
{
|
|
90574
|
-
text: "删除五彩K线",
|
|
90575
|
-
click: function (windowIndex) { chart.CancelInstructionIndex() }
|
|
90576
|
-
});
|
|
90577
|
-
}
|
|
90578
|
-
|
|
90579
|
-
return data;
|
|
90580
|
-
}
|
|
90581
|
-
|
|
90582
|
-
//专家系统
|
|
90583
|
-
this.GetTradeIndex=function(chart)
|
|
90584
|
-
{
|
|
90585
|
-
var data=
|
|
90586
|
-
[
|
|
90587
|
-
{
|
|
90588
|
-
text: "BIAS",
|
|
90589
|
-
click: function (windowIndex) { chart.ChangeInstructionIndex('交易系统-BIAS') }
|
|
90590
|
-
},
|
|
90591
|
-
{
|
|
90592
|
-
text: "CCI",
|
|
90593
|
-
click: function (windowIndex) { chart.ChangeInstructionIndex('交易系统-CCI') }
|
|
90594
|
-
},
|
|
90595
|
-
{
|
|
90596
|
-
text: "DMI",
|
|
90597
|
-
click: function (windowIndex) { chart.ChangeInstructionIndex('交易系统-DMI') }
|
|
90598
|
-
},
|
|
90599
|
-
{
|
|
90600
|
-
text: "KD",
|
|
90601
|
-
click: function (windowIndex) { chart.ChangeInstructionIndex('交易系统-KD') }
|
|
90602
|
-
},
|
|
90603
|
-
{
|
|
90604
|
-
text: "BOLL",
|
|
90605
|
-
click: function (windowIndex) { chart.ChangeInstructionIndex('交易系统-BOLL') }
|
|
90606
|
-
},
|
|
90607
|
-
{
|
|
90608
|
-
text: "KDJ",
|
|
90609
|
-
click: function (windowIndex) { chart.ChangeInstructionIndex('交易系统-KDJ') }
|
|
90610
|
-
}
|
|
90611
|
-
];
|
|
90612
|
-
|
|
90613
|
-
if (chart.TradeIndex)
|
|
90614
|
-
{
|
|
90615
|
-
data[data.length-1].isBorder=true;
|
|
90616
|
-
data.push(
|
|
90617
|
-
{
|
|
90618
|
-
text: "删除专家系统",
|
|
90619
|
-
click: function (windowIndex) { chart.CancelInstructionIndex()}
|
|
90620
|
-
});
|
|
90621
|
-
}
|
|
90622
|
-
return data;
|
|
90623
|
-
}
|
|
90624
|
-
|
|
90625
|
-
//叠加
|
|
90626
|
-
this.GetOverlay=function (chart)
|
|
90627
|
-
{
|
|
90628
|
-
var data=
|
|
90629
|
-
[
|
|
90630
|
-
{
|
|
90631
|
-
text: "上证指数",
|
|
90632
|
-
click: function () { chart.OverlaySymbol('000001.sh'); }
|
|
90633
|
-
},
|
|
90634
|
-
{
|
|
90635
|
-
text: "深证成指",
|
|
90636
|
-
click: function () { chart.OverlaySymbol('399001.sz'); }
|
|
90637
|
-
},
|
|
90638
|
-
{
|
|
90639
|
-
text: "中小板指",
|
|
90640
|
-
click: function () { chart.OverlaySymbol('399005.sz'); }
|
|
90641
|
-
},
|
|
90642
|
-
{
|
|
90643
|
-
text: "创业板指",
|
|
90644
|
-
click: function () { chart.OverlaySymbol('399006.sz'); }
|
|
90645
|
-
},
|
|
90646
|
-
{
|
|
90647
|
-
text: "沪深300",
|
|
90648
|
-
click: function () { chart.OverlaySymbol('000300.sh'); },
|
|
90649
|
-
}
|
|
90650
|
-
];
|
|
90651
|
-
|
|
90652
|
-
for(var i in chart.OverlayChartPaint)
|
|
90653
|
-
{
|
|
90654
|
-
var item=chart.OverlayChartPaint[i];
|
|
90655
|
-
var symbol=item.Symbol;
|
|
90656
|
-
const mapSymbol=new Map([['000001.sh',0],['399001.sz',1],['399005.sz',2],['399006.sz',3],['000300.sh',4]]);
|
|
90657
|
-
if (mapSymbol.has(symbol))
|
|
90658
|
-
{
|
|
90659
|
-
var menuItem=data[mapSymbol.get(symbol)];
|
|
90660
|
-
let delSymbol=symbol;
|
|
90661
|
-
menuItem.selected=true;
|
|
90662
|
-
menuItem.click=function () { chart.DeleteOverlaySymbol(delSymbol); };
|
|
90663
|
-
}
|
|
90664
|
-
}
|
|
90665
|
-
|
|
90666
|
-
if (chart.OverlayChartPaint && chart.OverlayChartPaint.length>0)
|
|
90667
|
-
{
|
|
90668
|
-
data[data.length-1].isBorder=true;
|
|
90669
|
-
data.push(
|
|
90670
|
-
{
|
|
90671
|
-
text: "取消叠加",
|
|
90672
|
-
click: function () { chart.ClearOverlaySymbol();}
|
|
90673
|
-
}
|
|
90674
|
-
);
|
|
90675
|
-
}
|
|
90676
|
-
|
|
90677
|
-
return data;
|
|
90678
|
-
}
|
|
90679
|
-
|
|
90680
|
-
//K线类型设置
|
|
90681
|
-
this.GetKLineType=function(chart)
|
|
90682
|
-
{
|
|
90683
|
-
var data=
|
|
90684
|
-
[
|
|
90685
|
-
{
|
|
90686
|
-
text: "K线(空心阳线)",
|
|
90687
|
-
click: function () { chart.ChangeKLineDrawType(3);}
|
|
90688
|
-
},
|
|
90689
|
-
{
|
|
90690
|
-
text: "K线(实心阳线)",
|
|
90691
|
-
click: function () { chart.ChangeKLineDrawType(0); }
|
|
90692
|
-
},
|
|
90693
|
-
{
|
|
90694
|
-
text: "美国线",
|
|
90695
|
-
click: function () { chart.ChangeKLineDrawType(2, true ,{ IsThinAKBar:false }); }
|
|
90696
|
-
},
|
|
90697
|
-
{
|
|
90698
|
-
text: "收盘线",
|
|
90699
|
-
click: function () { chart.ChangeKLineDrawType(1); }
|
|
90700
|
-
},
|
|
90701
|
-
{
|
|
90702
|
-
text: "收盘面积",
|
|
90703
|
-
click: function () { chart.ChangeKLineDrawType(4); }
|
|
90704
|
-
},
|
|
90705
|
-
{
|
|
90706
|
-
text: "K线(空心阳线阴线)",
|
|
90707
|
-
click: function () { chart.ChangeKLineDrawType(6);}
|
|
90708
|
-
},
|
|
90709
|
-
{
|
|
90710
|
-
text: "Heikin Ashi",
|
|
90711
|
-
click: function () { chart.ChangeKLineDrawType(11);}
|
|
90712
|
-
},
|
|
90713
|
-
{
|
|
90714
|
-
text: "Line Break",
|
|
90715
|
-
click: function () { chart.ChangeKLineDrawType(12);}
|
|
90716
|
-
},
|
|
90717
|
-
{
|
|
90718
|
-
text: "High-low",
|
|
90719
|
-
click: function () { chart.ChangeKLineDrawType(13);}
|
|
90720
|
-
},
|
|
90721
|
-
{
|
|
90722
|
-
text: "HLC Area",
|
|
90723
|
-
click: function () { chart.ChangeKLineDrawType(15);}
|
|
90724
|
-
}
|
|
90725
|
-
];
|
|
90726
|
-
|
|
90727
|
-
switch(chart.KLineDrawType)
|
|
90728
|
-
{
|
|
90729
|
-
case 0:
|
|
90730
|
-
data[1].selected=true;
|
|
90731
|
-
break;
|
|
90732
|
-
case 1:
|
|
90733
|
-
data[3].selected=true;
|
|
90734
|
-
break;
|
|
90735
|
-
case 2:
|
|
90736
|
-
data[2].selected=true;
|
|
90737
|
-
break;
|
|
90738
|
-
case 3:
|
|
90739
|
-
data[0].selected=true;
|
|
90740
|
-
break;
|
|
90741
|
-
case 4:
|
|
90742
|
-
data[4].selected=true;
|
|
90743
|
-
break;
|
|
90744
|
-
case 6:
|
|
90745
|
-
data[5].selected=true;
|
|
90746
|
-
break;
|
|
90747
|
-
case 11:
|
|
90748
|
-
data[6].selected=true;
|
|
90749
|
-
break;
|
|
90750
|
-
case 12:
|
|
90751
|
-
data[7].selected=true;
|
|
90752
|
-
break;
|
|
90753
|
-
case 13:
|
|
90754
|
-
data[8].selected=true;
|
|
90755
|
-
break;
|
|
90756
|
-
case 15:
|
|
90757
|
-
data[9].selected=true;
|
|
90758
|
-
break;
|
|
90759
|
-
}
|
|
90760
|
-
return data;
|
|
90761
|
-
}
|
|
90762
|
-
|
|
90763
|
-
//指标窗口个数
|
|
90764
|
-
this.GetIndexWindowCount=function(chart)
|
|
90765
|
-
{
|
|
90766
|
-
var data=
|
|
90767
|
-
[
|
|
90768
|
-
{
|
|
90769
|
-
text: "1个窗口",
|
|
90770
|
-
click: function () { chart.ChangeIndexWindowCount(1); }
|
|
90771
|
-
},
|
|
90772
|
-
{
|
|
90773
|
-
text: "2个窗口",
|
|
90774
|
-
click: function () { chart.ChangeIndexWindowCount(2); }
|
|
90775
|
-
},
|
|
90776
|
-
{
|
|
90777
|
-
text: "3个窗口",
|
|
90778
|
-
click: function () { chart.ChangeIndexWindowCount(3); }
|
|
90779
|
-
},
|
|
90780
|
-
{
|
|
90781
|
-
text: "4个窗口",
|
|
90782
|
-
click: function () { chart.ChangeIndexWindowCount(4); }
|
|
90783
|
-
},
|
|
90784
|
-
{
|
|
90785
|
-
text: "5个窗口",
|
|
90786
|
-
click: function () { chart.ChangeIndexWindowCount(5); }
|
|
90787
|
-
}
|
|
90788
|
-
];
|
|
90789
|
-
|
|
90790
|
-
var count=chart.Frame.SubFrame.length;
|
|
90791
|
-
if ((count-1)>=0 && (count-1)<data.length) data[count-1].selected=true; //选中
|
|
90792
|
-
|
|
90793
|
-
return data;
|
|
90794
|
-
}
|
|
90795
|
-
|
|
90796
|
-
//坐标类型
|
|
90797
|
-
this.GetCoordinateType=function(chart)
|
|
90798
|
-
{
|
|
90799
|
-
var data=
|
|
90800
|
-
[
|
|
90801
|
-
{
|
|
90802
|
-
text: "普通坐标",
|
|
90803
|
-
click: function () { chart.ChangeCoordinateType( {Type:0} ); }
|
|
90804
|
-
},
|
|
90805
|
-
{
|
|
90806
|
-
text: "百分比坐标",
|
|
90807
|
-
click: function () { chart.ChangeCoordinateType( {Type:1} ); }
|
|
90808
|
-
},
|
|
90809
|
-
{
|
|
90810
|
-
text: "反转坐标",
|
|
90811
|
-
click: function () { chart.ChangeCoordinateType( { IsReverse:true } ); }
|
|
90812
|
-
},
|
|
90813
|
-
{
|
|
90814
|
-
text: "对数坐标",
|
|
90815
|
-
click: function () { chart.ChangeCoordinateType( {Type:2} ); }
|
|
90816
|
-
},
|
|
90817
|
-
{
|
|
90818
|
-
text: "等比坐标",
|
|
90819
|
-
click: function () { chart.ChangeCoordinateType( {Type:3} ); }
|
|
90820
|
-
},
|
|
90821
|
-
{
|
|
90822
|
-
text: "等分坐标",
|
|
90823
|
-
click: function () { chart.ChangeCoordinateType( {Type:4} ); }
|
|
90824
|
-
},
|
|
90825
|
-
{
|
|
90826
|
-
text: "黄金分割",
|
|
90827
|
-
click: function () { chart.ChangeCoordinateType( {Type:5} ); }
|
|
90828
|
-
}
|
|
90829
|
-
];
|
|
90830
|
-
|
|
90831
|
-
if (chart.Frame && chart.Frame.SubFrame && chart.Frame.SubFrame.length>0)
|
|
90832
|
-
{
|
|
90833
|
-
if (chart.Frame.SubFrame[0].Frame.CoordinateType==1)
|
|
90834
|
-
{
|
|
90835
|
-
data[2].selected=true;
|
|
90836
|
-
data[2].click=function() { chart.ChangeCoordinateType( { IsReverse:false } ); } //取消反转
|
|
90837
|
-
}
|
|
90838
|
-
|
|
90839
|
-
if (chart.Frame.SubFrame[0].Frame.YSplitOperator.CoordinateType==1) data[1].selected=true; //百分比
|
|
90840
|
-
else if (chart.Frame.SubFrame[0].Frame.YSplitOperator.CoordinateType==0) data[0].selected=true; //普通坐标
|
|
90841
|
-
else if (chart.Frame.SubFrame[0].Frame.YSplitOperator.CoordinateType==2) data[3].selected=true; //对数
|
|
90842
|
-
else if (chart.Frame.SubFrame[0].Frame.YSplitOperator.CoordinateType==3) data[4].selected=true; //等比坐标
|
|
90843
|
-
else if (chart.Frame.SubFrame[0].Frame.YSplitOperator.CoordinateType==4) data[5].selected=true; //等分坐标
|
|
90844
|
-
else if (chart.Frame.SubFrame[0].Frame.YSplitOperator.CoordinateType==5) data[6].selected=true; //黄金分割
|
|
90845
|
-
}
|
|
90846
|
-
|
|
90847
|
-
return data;
|
|
90848
|
-
}
|
|
90849
|
-
|
|
90850
|
-
//拖拽模式
|
|
90851
|
-
this.GetDragModeType=function(chart)
|
|
90852
|
-
{
|
|
90853
|
-
var data=
|
|
90854
|
-
[
|
|
90855
|
-
{
|
|
90856
|
-
text: "禁止拖拽",
|
|
90857
|
-
click: function () { chart.DragMode=0; }
|
|
90858
|
-
},
|
|
90859
|
-
{
|
|
90860
|
-
text: "启动拖拽",
|
|
90861
|
-
click: function () { chart.DragMode=1; }
|
|
90862
|
-
},
|
|
90863
|
-
{
|
|
90864
|
-
text: "区间选择",
|
|
90865
|
-
click: function () { chart.DragMode=2; }
|
|
90866
|
-
}
|
|
90867
|
-
];
|
|
90868
|
-
|
|
90869
|
-
if (chart.DragMode>=0 && chart.DragMode<data.length) data[chart.DragMode].selected=true; //选中
|
|
90870
|
-
|
|
90871
|
-
return data;
|
|
90872
|
-
}
|
|
90873
|
-
|
|
90874
|
-
//工具
|
|
90875
|
-
this.GetTools=function(chart)
|
|
90876
|
-
{
|
|
90877
|
-
var data=[];
|
|
90878
|
-
var drawTools=chart.GetExtendChartByClassName('DrawToolsButton');
|
|
90879
|
-
if (drawTools)
|
|
90880
|
-
{
|
|
90881
|
-
data.push(
|
|
90882
|
-
{
|
|
90883
|
-
text: "关闭画图工具",
|
|
90884
|
-
click: function ()
|
|
90885
|
-
{
|
|
90886
|
-
var toolsWidth=drawTools.Chart.Width;
|
|
90887
|
-
var toolsIndex=parseInt(drawTools.Index);
|
|
90888
|
-
for(var i=toolsIndex+1; i<chart.ExtendChartPaint.length; ++i) //在画图工具后面创建的需要减去工具的宽度
|
|
90889
|
-
{
|
|
90890
|
-
var item=chart.ExtendChartPaint[i];
|
|
90891
|
-
if (item.ClassName=='StockChip')
|
|
90892
|
-
{
|
|
90893
|
-
item.Left-=toolsWidth;
|
|
90894
|
-
}
|
|
90895
|
-
}
|
|
90896
|
-
chart.DeleteExtendChart(drawTools);
|
|
90897
|
-
chart.Frame.ChartBorder.Right-=toolsWidth;
|
|
90898
|
-
chart.SetSizeChange(true);
|
|
90899
|
-
chart.Draw();
|
|
90900
|
-
}
|
|
90901
|
-
}
|
|
90902
|
-
);
|
|
90903
|
-
}
|
|
90904
|
-
else
|
|
90905
|
-
{
|
|
90906
|
-
data.push(
|
|
90907
|
-
{
|
|
90908
|
-
text: "画图工具",
|
|
90909
|
-
click: function () {
|
|
90910
|
-
var option={Name:'画图工具', Top:chart.Frame.ChartBorder.Top };
|
|
90911
|
-
var extendChart=chart.CreateExtendChart(option.Name, option); //创建扩展图形
|
|
90912
|
-
chart.SetSizeChange(true);
|
|
90913
|
-
chart.Draw();
|
|
90914
|
-
}
|
|
90915
|
-
}
|
|
90916
|
-
);
|
|
90917
|
-
}
|
|
90918
|
-
|
|
90919
|
-
var StockChip=chart.GetExtendChartByClassName('StockChip');
|
|
90920
|
-
if (StockChip)
|
|
90921
|
-
{
|
|
90922
|
-
data.push(
|
|
90923
|
-
{
|
|
90924
|
-
text: "关闭移动筹码",
|
|
90925
|
-
click: function ()
|
|
90926
|
-
{
|
|
90927
|
-
var chipWidth=StockChip.Chart.Width;
|
|
90928
|
-
var chipIndex=parseInt(StockChip.Index);
|
|
90929
|
-
for(var i=chipIndex+1; i<chart.ExtendChartPaint.length; ++i) //在筹码后面创建的需要筹码的宽度
|
|
90930
|
-
{
|
|
90931
|
-
var item=chart.ExtendChartPaint[i];
|
|
90932
|
-
if (item.ClassName=='DrawToolsButton')
|
|
90933
|
-
{
|
|
90934
|
-
item.Left-=chipWidth;
|
|
90935
|
-
}
|
|
90936
|
-
}
|
|
90937
|
-
chart.DeleteExtendChart(StockChip);
|
|
90938
|
-
chart.Frame.ChartBorder.Right-=chipWidth;
|
|
90939
|
-
chart.SetSizeChange(true);
|
|
90940
|
-
chart.Draw();
|
|
90941
|
-
}
|
|
90942
|
-
|
|
90943
|
-
}
|
|
90944
|
-
);
|
|
90945
|
-
}
|
|
90946
|
-
else
|
|
90947
|
-
{
|
|
90948
|
-
data.push(
|
|
90949
|
-
{
|
|
90950
|
-
text: "移动筹码",
|
|
90951
|
-
click: function () {
|
|
90952
|
-
var option={Name:'筹码分布', ShowType:1, Width:230 };
|
|
90953
|
-
var extendChart=chart.CreateExtendChart(option.Name, option); //创建扩展图形
|
|
90954
|
-
chart.SetSizeChange(true);
|
|
90955
|
-
chart.Draw();
|
|
90956
|
-
}
|
|
90957
|
-
}
|
|
90958
|
-
);
|
|
90959
|
-
}
|
|
90960
|
-
|
|
90961
|
-
return data;
|
|
90962
|
-
}
|
|
90963
|
-
|
|
90964
|
-
//缺口提示
|
|
90965
|
-
this.GetPriceGap=function(chart)
|
|
90966
|
-
{
|
|
90967
|
-
var klineChart=chart.ChartPaint[0];
|
|
90968
|
-
var priceGap=klineChart.PriceGap;
|
|
90969
|
-
var data=
|
|
90970
|
-
[
|
|
90971
|
-
{
|
|
90972
|
-
text: "显示1个缺口",
|
|
90973
|
-
click: function () { chart.ChangePriceGap({ Enable:true, Count:1 }); }
|
|
90974
|
-
},
|
|
90975
|
-
{
|
|
90976
|
-
text: "显示2个缺口",
|
|
90977
|
-
click: function () { chart.ChangePriceGap({ Enable:true, Count:2 }); }
|
|
90978
|
-
},
|
|
90979
|
-
{
|
|
90980
|
-
text: "显示3个缺口",
|
|
90981
|
-
click: function () { chart.ChangePriceGap({ Enable:true, Count:3 }); }
|
|
90982
|
-
},
|
|
90983
|
-
{
|
|
90984
|
-
text: "隐藏缺口",
|
|
90985
|
-
click: function () { chart.ChangePriceGap({ Enable:false }); }
|
|
90986
|
-
}
|
|
90987
|
-
];
|
|
90988
|
-
|
|
90989
|
-
if (!priceGap.Enable || priceGap.Count<=0)
|
|
90990
|
-
{
|
|
90991
|
-
data[data.length-1].selected=true; //选中
|
|
90992
|
-
}
|
|
90993
|
-
else if (priceGap.Enable && priceGap.Count>0)
|
|
90994
|
-
{
|
|
90995
|
-
var index=priceGap.Count-1;
|
|
90996
|
-
if (index>data.length-2) index=data.length-2;
|
|
90997
|
-
data[index].selected=true; //选中
|
|
90998
|
-
}
|
|
90999
|
-
|
|
91000
|
-
return data;
|
|
91001
|
-
}
|
|
91002
|
-
|
|
91003
|
-
this.GetBGSplit=function(chart)
|
|
91004
|
-
{
|
|
91005
|
-
var data=
|
|
91006
|
-
[
|
|
91007
|
-
{
|
|
91008
|
-
text: "启用",
|
|
91009
|
-
click: function ()
|
|
91010
|
-
{
|
|
91011
|
-
chart.CreateExtendChart("SessionBreaksPaint", { });
|
|
91012
|
-
chart.Draw();
|
|
91013
|
-
}
|
|
91014
|
-
},
|
|
91015
|
-
{
|
|
91016
|
-
text: "关闭",
|
|
91017
|
-
click: function ()
|
|
91018
|
-
{
|
|
91019
|
-
var finder=chart.GetExtendChartByClassName("SessionBreaksPaint");
|
|
91020
|
-
if (finder)
|
|
91021
|
-
{
|
|
91022
|
-
chart.DeleteExtendChartByID(finder.Chart.ID);
|
|
91023
|
-
chart.Draw();
|
|
91024
|
-
}
|
|
91025
|
-
}
|
|
91026
|
-
},
|
|
91027
|
-
];
|
|
91028
|
-
|
|
91029
|
-
var finder=chart.GetExtendChartByClassName("SessionBreaksPaint");
|
|
91030
|
-
if (finder) data[0].selected=true;
|
|
91031
|
-
else data[1].selected=true;
|
|
91032
|
-
|
|
91033
|
-
return data;
|
|
91034
|
-
}
|
|
91035
|
-
|
|
91036
|
-
|
|
91037
|
-
this.GetKLineInfo=function(chart)
|
|
91038
|
-
{
|
|
91039
|
-
var setInfo=new Set();
|
|
91040
|
-
for(var i in chart.ChartInfo)
|
|
91041
|
-
{
|
|
91042
|
-
var item=chart.ChartInfo[i];
|
|
91043
|
-
setInfo.add(item.ClassName);
|
|
91044
|
-
}
|
|
91045
|
-
|
|
91046
|
-
var aryKLineInfo=["公告","业绩预告","调研","大宗交易","龙虎榜","互动易"]
|
|
91047
|
-
|
|
91048
|
-
var data=[];
|
|
91049
|
-
for(var i in aryKLineInfo)
|
|
91050
|
-
{
|
|
91051
|
-
var infoName=aryKLineInfo[i];
|
|
91052
|
-
var classInfo=JSKLineInfoMap.GetClassInfo(infoName);
|
|
91053
|
-
if (!classInfo) continue;
|
|
91054
|
-
|
|
91055
|
-
var item=this.CreateKlineInfoItem(infoName, setInfo.has(classInfo.ClassName), chart);
|
|
91056
|
-
data.push(item);
|
|
91057
|
-
}
|
|
91058
|
-
|
|
91059
|
-
if (chart.ChartInfo.length>0)
|
|
91060
|
-
{
|
|
91061
|
-
data[data.length-1].isBorder=true;
|
|
91062
|
-
var item={ text:'删除所有', click:function() { chart.ClearKLineInfo()} };
|
|
91063
|
-
data.push(item);
|
|
91064
|
-
|
|
91065
|
-
}
|
|
91066
|
-
|
|
91067
|
-
return data;
|
|
91068
|
-
}
|
|
91069
|
-
|
|
91070
|
-
this.CreateKlineInfoItem=function(infoName,bExist,chart)
|
|
91071
|
-
{
|
|
91072
|
-
var item=
|
|
91073
|
-
{
|
|
91074
|
-
text:infoName,
|
|
91075
|
-
selected:bExist
|
|
91076
|
-
}
|
|
91077
|
-
|
|
91078
|
-
if (bExist) item.click=function() { chart.DeleteKLineInfo(infoName) };
|
|
91079
|
-
else item.click=function() { chart.AddKLineInfo(infoName,true) }
|
|
91080
|
-
|
|
91081
|
-
return item;
|
|
91082
|
-
}
|
|
91083
|
-
|
|
91084
|
-
this.DoModal=function(event)
|
|
91085
|
-
{
|
|
91086
|
-
var chart=event.data.Chart;
|
|
91087
|
-
var rightMenu=chart.RightMenu;
|
|
91088
|
-
var x = event.offsetX;
|
|
91089
|
-
var y = event.offsetY;
|
|
91090
|
-
|
|
91091
|
-
var dataList=[{
|
|
91092
|
-
text: "分析周期",
|
|
91093
|
-
children: this.GetPeriod(chart)
|
|
91094
|
-
},
|
|
91095
|
-
{
|
|
91096
|
-
text: "复权处理",
|
|
91097
|
-
children: this.GetRight(chart)
|
|
91098
|
-
},
|
|
91099
|
-
{
|
|
91100
|
-
text: "指标切换",
|
|
91101
|
-
children: this.GetIndex(chart)
|
|
91102
|
-
},
|
|
91103
|
-
{
|
|
91104
|
-
text:"五彩K线",
|
|
91105
|
-
children: this.GetColorIndex(chart)
|
|
91106
|
-
},
|
|
91107
|
-
{
|
|
91108
|
-
text:'专家系统',
|
|
91109
|
-
children: this.GetTradeIndex(chart)
|
|
91110
|
-
},
|
|
91111
|
-
{
|
|
91112
|
-
text:'信息地雷',
|
|
91113
|
-
children: this.GetKLineInfo(chart)
|
|
91114
|
-
},
|
|
91115
|
-
{
|
|
91116
|
-
text:'缺口提示',
|
|
91117
|
-
children: this.GetPriceGap(chart)
|
|
91118
|
-
},
|
|
91119
|
-
{
|
|
91120
|
-
text: "叠加品种",
|
|
91121
|
-
children: this.GetOverlay(chart)
|
|
91122
|
-
},
|
|
91123
|
-
{
|
|
91124
|
-
text:'主图线型',
|
|
91125
|
-
children: this.GetKLineType(chart)
|
|
91126
|
-
},
|
|
91127
|
-
{
|
|
91128
|
-
text:"坐标类型",
|
|
91129
|
-
children:this.GetCoordinateType(chart)
|
|
91130
|
-
},
|
|
91131
|
-
{
|
|
91132
|
-
text:'指标窗口个数',
|
|
91133
|
-
children: this.GetIndexWindowCount(chart)
|
|
91134
|
-
},
|
|
91135
|
-
{
|
|
91136
|
-
text:'鼠标拖拽',
|
|
91137
|
-
children: this.GetDragModeType(chart)
|
|
91138
|
-
},
|
|
91139
|
-
{
|
|
91140
|
-
text:"工具",
|
|
91141
|
-
children:this.GetTools(chart)
|
|
91142
|
-
},
|
|
91143
|
-
{
|
|
91144
|
-
text:"背景分割",
|
|
91145
|
-
children:this.GetBGSplit(chart)
|
|
91146
|
-
}
|
|
91147
|
-
];
|
|
91148
|
-
|
|
91149
|
-
var upperSymbol=chart.Symbol.toUpperCase();
|
|
91150
|
-
if(MARKET_SUFFIX_NAME.IsSHSZIndex(chart.Symbol) || MARKET_SUFFIX_NAME.IsBIT(upperSymbol))
|
|
91151
|
-
{
|
|
91152
|
-
dataList.splice(1,1);
|
|
91153
|
-
}
|
|
91154
|
-
|
|
91155
|
-
var identify=event.data.FrameID;
|
|
91156
|
-
var overlayIndex=this.GetOverlayIndex(chart,identify);
|
|
91157
|
-
if (overlayIndex && overlayIndex.length>0)
|
|
91158
|
-
{
|
|
91159
|
-
var delOverlayIndexMenu={ text:'删除叠加指标', children:this.GetDeleteOverlayIndex(chart,overlayIndex) }
|
|
91160
|
-
dataList.splice(3,0,delOverlayIndexMenu);
|
|
91161
|
-
}
|
|
91162
|
-
|
|
91163
|
-
JSConsole.Chart.Log('[KLineRightMenu::DoModal]',identify);
|
|
91164
|
-
rightMenu.Show({
|
|
91165
|
-
windowIndex :identify,
|
|
91166
|
-
x:x+chart.UIElement.offsetLeft,
|
|
91167
|
-
y:y+chart.UIElement.offsetTop,
|
|
91168
|
-
position:chart.Frame.Position,
|
|
91169
|
-
data:dataList
|
|
91170
|
-
})
|
|
91171
|
-
|
|
91172
|
-
$(document).click(function () {
|
|
91173
|
-
rightMenu.Hide();
|
|
91174
|
-
});
|
|
91175
|
-
}
|
|
91176
|
-
|
|
91177
|
-
this.GetOverlayIndex=function(chart, windowsIndex)
|
|
91178
|
-
{
|
|
91179
|
-
if (windowsIndex>=chart.Frame.SubFrame.length || windowsIndex<0) return [];
|
|
91180
|
-
|
|
91181
|
-
var result=[];
|
|
91182
|
-
var item=chart.Frame.SubFrame[windowsIndex];
|
|
91183
|
-
for(var i in item.OverlayIndex)
|
|
91184
|
-
{
|
|
91185
|
-
var overlayItem=item.OverlayIndex[i];
|
|
91186
|
-
result.push({Name:overlayItem.Script.Name, Identify:overlayItem.Identify});
|
|
91187
|
-
}
|
|
91188
|
-
|
|
91189
|
-
return result;
|
|
91190
|
-
}
|
|
91191
|
-
|
|
91192
|
-
this.GetDeleteOverlayIndex=function(chart,overlayIndex)
|
|
91193
|
-
{
|
|
91194
|
-
var data=[];
|
|
91195
|
-
for(var i in overlayIndex)
|
|
91196
|
-
{
|
|
91197
|
-
let identify=overlayIndex[i].Identify;
|
|
91198
|
-
data.push({text:overlayIndex[i].Name, click:function()
|
|
91199
|
-
{
|
|
91200
|
-
chart.DeleteOverlayWindowsIndex(identify)
|
|
91201
|
-
}});
|
|
91202
|
-
}
|
|
91203
|
-
|
|
91204
|
-
return data;
|
|
91205
|
-
}
|
|
91206
|
-
}
|
|
91207
|
-
|
|
91208
|
-
//K线区间选择右键菜单
|
|
91209
|
-
function KLineSelectRightMenu(divElement)
|
|
91210
|
-
{
|
|
91211
|
-
this.newMethod=KLineRightMenu; //派生
|
|
91212
|
-
this.newMethod(divElement);
|
|
91213
|
-
delete this.newMethod;
|
|
91214
|
-
|
|
91215
|
-
this.DoModal=function(event)
|
|
91216
|
-
{
|
|
91217
|
-
var chart=event.data.Chart;
|
|
91218
|
-
var rightMenu=this;
|
|
91219
|
-
var x = event.data.X;
|
|
91220
|
-
var y = event.data.Y;
|
|
91221
|
-
|
|
91222
|
-
var dataList=
|
|
91223
|
-
[
|
|
91224
|
-
{
|
|
91225
|
-
text: "区间统计",
|
|
91226
|
-
click: function ()
|
|
91227
|
-
{
|
|
91228
|
-
JSConsole.Chart.Log('[KLineSelectRightMenu::click] 区间统计');
|
|
91229
|
-
rightMenu.Hide();
|
|
91230
|
-
var dialog=new KLineSelectRectDialog(divElement);
|
|
91231
|
-
dialog.DoModal(event);
|
|
91232
|
-
}
|
|
91233
|
-
},
|
|
91234
|
-
{
|
|
91235
|
-
text:'区间放大',
|
|
91236
|
-
click:function()
|
|
91237
|
-
{
|
|
91238
|
-
JSConsole.Chart.Log('[KLineSelectRightMenu::click] 区间放大');
|
|
91239
|
-
var chart=event.data.Chart;
|
|
91240
|
-
chart.ShowSelectData(event.data.SelectData);
|
|
91241
|
-
}
|
|
91242
|
-
}
|
|
91243
|
-
];
|
|
91244
|
-
|
|
91245
|
-
rightMenu.Show({
|
|
91246
|
-
x:x,
|
|
91247
|
-
y:y,
|
|
91248
|
-
position:chart.Frame.Position,
|
|
91249
|
-
data:dataList
|
|
91250
|
-
});
|
|
91251
|
-
}
|
|
91252
|
-
|
|
91253
|
-
this.Show=function (obj)
|
|
91254
|
-
{
|
|
91255
|
-
var _self = this;
|
|
91256
|
-
$.extend(_self.option, obj);
|
|
91257
|
-
|
|
91258
|
-
//判断是否重复创建
|
|
91259
|
-
if (!_self.ID) _self.Create();
|
|
91260
|
-
//判断下如果DOM没了需要重新创建
|
|
91261
|
-
var divIdName='topMenu_'+_self.ID;
|
|
91262
|
-
var divDom=document.getElementById(divIdName);
|
|
91263
|
-
if (!divDom) _self.Create();
|
|
91264
|
-
|
|
91265
|
-
var $topMenu = $("#topMenu_"+_self.ID),
|
|
91266
|
-
topWidth = $topMenu.outerWidth(),
|
|
91267
|
-
topHeight = $topMenu.outerHeight();
|
|
91268
|
-
|
|
91269
|
-
$topMenu.contextmenu(function()
|
|
91270
|
-
{
|
|
91271
|
-
return false; //屏蔽系统右键菜单
|
|
91272
|
-
});
|
|
91273
|
-
|
|
91274
|
-
var x = _self.option.x,
|
|
91275
|
-
y = _self.option.y;
|
|
91276
|
-
|
|
91277
|
-
if (topWidth > _self.option.position.X + _self.option.position.W- x) //超过了右边距
|
|
91278
|
-
x = x - topWidth;
|
|
91279
|
-
|
|
91280
|
-
if (topHeight > _self.option.position.Y +_self.option.position.H - y)//超过了下边距
|
|
91281
|
-
y = y - topHeight;
|
|
91282
|
-
|
|
91283
|
-
$topMenu.hide();
|
|
91284
|
-
$topMenu.css({ position:"absolute",left: x + "px", top: y + "px" }).show();
|
|
91285
|
-
|
|
91286
|
-
$("#topMenu_" + _self.ID).find("tr").show(); //把菜单列表显示
|
|
91287
|
-
|
|
91288
|
-
this.isInit = true;
|
|
91289
|
-
}
|
|
91290
|
-
}
|
|
91291
|
-
|
|
91292
|
-
//分钟数据右键菜单
|
|
91293
|
-
function MinuteRightMenu(divElement)
|
|
91294
|
-
{
|
|
91295
|
-
this.newMethod=KLineRightMenu; //派生
|
|
91296
|
-
this.newMethod(divElement);
|
|
91297
|
-
delete this.newMethod;
|
|
91298
|
-
|
|
91299
|
-
this.DoModal=function(event)
|
|
91300
|
-
{
|
|
91301
|
-
var chart=event.data.Chart;
|
|
91302
|
-
var rightMenu=chart.RightMenu;
|
|
91303
|
-
var x = event.offsetX;
|
|
91304
|
-
var y = event.offsetY;
|
|
91305
|
-
|
|
91306
|
-
var dataList=
|
|
91307
|
-
[
|
|
91308
|
-
{
|
|
91309
|
-
text: "叠加品种",
|
|
91310
|
-
children: this.GetOverlay(chart)
|
|
91311
|
-
},
|
|
91312
|
-
{
|
|
91313
|
-
text: "多日分时图",
|
|
91314
|
-
children: this.GetDayCount(chart)
|
|
91315
|
-
},
|
|
91316
|
-
{
|
|
91317
|
-
text:'指标窗口个数',
|
|
91318
|
-
children: this.GetIndexWindowCount(chart)
|
|
91319
|
-
},
|
|
91320
|
-
{
|
|
91321
|
-
text: "副图指标切换",
|
|
91322
|
-
children: this.GetIndex(chart)
|
|
91323
|
-
},
|
|
91324
|
-
{
|
|
91325
|
-
text:"区间选择",
|
|
91326
|
-
children:this.GetSelectRect(chart)
|
|
91327
|
-
},
|
|
91328
|
-
|
|
91329
|
-
];
|
|
91330
|
-
|
|
91331
|
-
var symbol=chart.Symbol;
|
|
91332
|
-
if (MARKET_SUFFIX_NAME.IsSHSZStockA(symbol))
|
|
91333
|
-
{
|
|
91334
|
-
dataList.push({text:'集合竞价',children: this.GetShowBeforeData(chart)});
|
|
91335
|
-
}
|
|
91336
|
-
|
|
91337
|
-
dataList.push({text:"工具", children:this.GetTools(chart)});
|
|
91338
|
-
|
|
91339
|
-
var identify=event.data.FrameID;
|
|
91340
|
-
var overlayIndex=this.GetOverlayIndex(chart,identify);
|
|
91341
|
-
if (overlayIndex && overlayIndex.length>0)
|
|
91342
|
-
{
|
|
91343
|
-
var delOverlayIndexMenu={ text:'删除叠加指标', children:this.GetDeleteOverlayIndex(chart,overlayIndex) }
|
|
91344
|
-
dataList.splice(3,0,delOverlayIndexMenu);
|
|
91345
|
-
}
|
|
91346
|
-
|
|
91347
|
-
var identify=event.data.FrameID;
|
|
91348
|
-
JSConsole.Chart.Log('[MinuteRightMenu::DoModal]',identify);
|
|
91349
|
-
rightMenu.Show({
|
|
91350
|
-
windowIndex :identify,
|
|
91351
|
-
x:x+chart.UIElement.offsetLeft,
|
|
91352
|
-
y:y+chart.UIElement.offsetTop,
|
|
91353
|
-
position:chart.Frame.Position,
|
|
91354
|
-
data:dataList
|
|
91355
|
-
})
|
|
91356
|
-
|
|
91357
|
-
$(document).click(function () {
|
|
91358
|
-
rightMenu.Hide();
|
|
91359
|
-
});
|
|
91360
|
-
}
|
|
91361
|
-
|
|
91362
|
-
this.GetDayCount=function(chart)
|
|
91363
|
-
{
|
|
91364
|
-
var data=
|
|
91365
|
-
[
|
|
91366
|
-
{
|
|
91367
|
-
text: "当日分时图",
|
|
91368
|
-
click: function () { chart.ChangeDayCount(1); },
|
|
91369
|
-
isBorder:true
|
|
91370
|
-
},
|
|
91371
|
-
{
|
|
91372
|
-
text: "最近2日",
|
|
91373
|
-
click: function () { chart.ChangeDayCount(2); }
|
|
91374
|
-
},
|
|
91375
|
-
{
|
|
91376
|
-
text: "最近3日",
|
|
91377
|
-
click: function () { chart.ChangeDayCount(3); }
|
|
91378
|
-
},
|
|
91379
|
-
{
|
|
91380
|
-
text: "最近4日",
|
|
91381
|
-
click: function () { chart.ChangeDayCount(4); }
|
|
91382
|
-
},
|
|
91383
|
-
{
|
|
91384
|
-
text: "最近5日",
|
|
91385
|
-
click: function () { chart.ChangeDayCount(5); }
|
|
91386
|
-
},
|
|
91387
|
-
{
|
|
91388
|
-
text: "最近6日",
|
|
91389
|
-
click: function () { chart.ChangeDayCount(6); }
|
|
91390
|
-
}
|
|
91391
|
-
];
|
|
91392
|
-
|
|
91393
|
-
if ((chart.DayCount-1)>=0 && (chart.DayCount-1)<data.length) data[chart.DayCount-1].selected=true;
|
|
91394
|
-
|
|
91395
|
-
return data;
|
|
91396
|
-
}
|
|
91397
|
-
|
|
91398
|
-
this.GetIndex=function (chart)
|
|
91399
|
-
{
|
|
91400
|
-
var data=
|
|
91401
|
-
[
|
|
91402
|
-
{
|
|
91403
|
-
text: "MACD",
|
|
91404
|
-
click: function (windowIndex) { chart.ChangeIndex(windowIndex, 'MACD') }
|
|
91405
|
-
},
|
|
91406
|
-
{
|
|
91407
|
-
text: "DMI",
|
|
91408
|
-
click: function (windowIndex) { chart.ChangeIndex(windowIndex, 'DMI') }
|
|
91409
|
-
},
|
|
91410
|
-
{
|
|
91411
|
-
text: "DMA",
|
|
91412
|
-
click: function (windowIndex) { chart.ChangeIndex(windowIndex, 'DMA') }
|
|
91413
|
-
},
|
|
91414
|
-
{
|
|
91415
|
-
text: "BRAR",
|
|
91416
|
-
click: function (windowIndex) { chart.ChangeIndex(windowIndex, 'BRAR') }
|
|
91417
|
-
},
|
|
91418
|
-
{
|
|
91419
|
-
text: "KDJ",
|
|
91420
|
-
click: function (windowIndex) { chart.ChangeIndex(windowIndex, 'KDJ') }
|
|
91421
|
-
},
|
|
91422
|
-
{
|
|
91423
|
-
text: "RSI",
|
|
91424
|
-
click: function (windowIndex) { chart.ChangeIndex(windowIndex, 'RSI') }
|
|
91425
|
-
},
|
|
91426
|
-
{
|
|
91427
|
-
text: "WR",
|
|
91428
|
-
click: function (windowIndex) { chart.ChangeIndex(windowIndex, 'WR') }
|
|
91429
|
-
},
|
|
91430
|
-
{
|
|
91431
|
-
text: "CCI",
|
|
91432
|
-
click: function (windowIndex) { chart.ChangeIndex(windowIndex, 'CCI') }
|
|
91433
|
-
},
|
|
91434
|
-
{
|
|
91435
|
-
text: "TRIX",
|
|
91436
|
-
click: function (windowIndex) { chart.ChangeIndex(windowIndex, 'TRIX') }
|
|
91437
|
-
}
|
|
91438
|
-
];
|
|
91439
|
-
|
|
91440
|
-
return data;
|
|
91441
|
-
}
|
|
91442
|
-
|
|
91443
|
-
this.GetShowBeforeData=function(chart) //是否显示集合竞价
|
|
91444
|
-
{
|
|
91445
|
-
if (chart.IsShowBeforeData)
|
|
91446
|
-
{
|
|
91447
|
-
var data=
|
|
91448
|
-
[
|
|
91449
|
-
{
|
|
91450
|
-
text: "隐藏",
|
|
91451
|
-
click: function () { chart.ShowCallAuctionData( { Left:false, MultiDay:{ Left:false }} ); },
|
|
91452
|
-
}
|
|
91453
|
-
];
|
|
91454
|
-
|
|
91455
|
-
return data;
|
|
91456
|
-
}
|
|
91457
|
-
else
|
|
91458
|
-
{
|
|
91459
|
-
var data=
|
|
91460
|
-
[
|
|
91461
|
-
{
|
|
91462
|
-
text: "显示",
|
|
91463
|
-
click: function () { chart.ShowCallAuctionData({Left:true, MultiDay:{ Left:true }}); },
|
|
91464
|
-
}
|
|
91465
|
-
];
|
|
91466
|
-
|
|
91467
|
-
return data;
|
|
91468
|
-
}
|
|
91469
|
-
}
|
|
91470
|
-
|
|
91471
|
-
this.GetSelectRect=function(chart) //区间选择
|
|
91472
|
-
{
|
|
91473
|
-
if (chart.EnableSelectRect)
|
|
91474
|
-
{
|
|
91475
|
-
var data=
|
|
91476
|
-
[
|
|
91477
|
-
{
|
|
91478
|
-
text: "禁用区间选择",
|
|
91479
|
-
click: function () { chart.EnableSelectRect=false; },
|
|
91480
|
-
}
|
|
91481
|
-
];
|
|
91482
|
-
|
|
91483
|
-
return data;
|
|
91484
|
-
}
|
|
91485
|
-
else
|
|
91486
|
-
{
|
|
91487
|
-
var data=
|
|
91488
|
-
[
|
|
91489
|
-
{
|
|
91490
|
-
text: "启动区间选择",
|
|
91491
|
-
click: function () { chart.EnableSelectRect=true },
|
|
91492
|
-
}
|
|
91493
|
-
];
|
|
91494
|
-
|
|
91495
|
-
return data;
|
|
91496
|
-
}
|
|
91497
|
-
}
|
|
91498
|
-
|
|
91499
|
-
//指标窗口个数
|
|
91500
|
-
this.GetIndexWindowCount=function(chart)
|
|
91501
|
-
{
|
|
91502
|
-
var data=
|
|
91503
|
-
[
|
|
91504
|
-
{
|
|
91505
|
-
text: "1个窗口",
|
|
91506
|
-
click: function () { chart.ChangeIndexWindowCount(2); }
|
|
91507
|
-
},
|
|
91508
|
-
{
|
|
91509
|
-
text: "2个窗口",
|
|
91510
|
-
click: function () { chart.ChangeIndexWindowCount(3); }
|
|
91511
|
-
},
|
|
91512
|
-
{
|
|
91513
|
-
text: "3个窗口",
|
|
91514
|
-
click: function () { chart.ChangeIndexWindowCount(4); }
|
|
91515
|
-
},
|
|
91516
|
-
{
|
|
91517
|
-
text: "4个窗口",
|
|
91518
|
-
click: function () { chart.ChangeIndexWindowCount(5); }
|
|
91519
|
-
},
|
|
91520
|
-
{
|
|
91521
|
-
text: "5个窗口",
|
|
91522
|
-
click: function () { chart.ChangeIndexWindowCount(6); }
|
|
91523
|
-
}
|
|
91524
|
-
];
|
|
91525
|
-
|
|
91526
|
-
var count=chart.Frame.SubFrame.length-1;
|
|
91527
|
-
if ((count-1)>=0 && (count-1)<data.length) data[count-1].selected=true; //选中
|
|
91528
|
-
|
|
91529
|
-
return data;
|
|
91530
|
-
}
|
|
91531
|
-
|
|
91532
|
-
//工具
|
|
91533
|
-
this.GetTools=function(chart)
|
|
91534
|
-
{
|
|
91535
|
-
var data=[];
|
|
91536
|
-
var drawTools=chart.GetExtendChartByClassName('DrawToolsButton');
|
|
91537
|
-
if (drawTools)
|
|
91538
|
-
{
|
|
91539
|
-
data.push(
|
|
91540
|
-
{
|
|
91541
|
-
text: "关闭画图工具",
|
|
91542
|
-
click: function ()
|
|
91543
|
-
{
|
|
91544
|
-
var toolsWidth=drawTools.Chart.Width;
|
|
91545
|
-
var toolsIndex=parseInt(drawTools.Index);
|
|
91546
|
-
chart.DeleteExtendChart(drawTools);
|
|
91547
|
-
chart.Frame.ChartBorder.Right-=toolsWidth;
|
|
91548
|
-
chart.SetSizeChange(true);
|
|
91549
|
-
chart.Draw();
|
|
91550
|
-
}
|
|
91551
|
-
}
|
|
91552
|
-
);
|
|
91553
|
-
}
|
|
91554
|
-
else
|
|
91555
|
-
{
|
|
91556
|
-
data.push(
|
|
91557
|
-
{
|
|
91558
|
-
text: "画图工具",
|
|
91559
|
-
click: function () {
|
|
91560
|
-
var option={Name:'画图工具', Top:chart.Frame.ChartBorder.Top };
|
|
91561
|
-
var extendChart=chart.CreateExtendChart(option.Name, option); //创建扩展图形
|
|
91562
|
-
chart.SetSizeChange(true);
|
|
91563
|
-
chart.Draw();
|
|
91564
|
-
}
|
|
91565
|
-
}
|
|
91566
|
-
);
|
|
91567
|
-
}
|
|
91568
|
-
|
|
91569
|
-
return data;
|
|
91570
|
-
}
|
|
91571
|
-
}
|
|
91572
|
-
|
|
91573
90213
|
//画图工具 单个图形设置
|
|
91574
90214
|
function ChartPictureSettingMenu(divElement)
|
|
91575
90215
|
{
|
|
@@ -135650,6 +134290,7 @@ function JSPopMenu()
|
|
|
135650
134290
|
this.ClickCallback=null; //点击回调
|
|
135651
134291
|
this.CheckedClassName="UMyChart_MenuItem_Span_Checked iconfont icon-checked"; //选中图标
|
|
135652
134292
|
this.RightArrowClassName="UMyChart_MenuItem_Span_Arrow iconfont icon-menu_arraw_right"; //右侧箭头
|
|
134293
|
+
this.SelectedClassName="UMyChart_MenuItem_Tr_Selected";
|
|
135653
134294
|
|
|
135654
134295
|
this.AryTDClassName=
|
|
135655
134296
|
[
|
|
@@ -135722,7 +134363,7 @@ function JSPopMenu()
|
|
|
135722
134363
|
{
|
|
135723
134364
|
var trDom=document.createElement("tr");
|
|
135724
134365
|
trDom.className='UMyChart_MenuItem_Tr';
|
|
135725
|
-
|
|
134366
|
+
|
|
135726
134367
|
var prtTdDom=null;
|
|
135727
134368
|
for(var i=0;i<this.AryTDClassName.length;++i)
|
|
135728
134369
|
{
|
|
@@ -135735,6 +134376,7 @@ function JSPopMenu()
|
|
|
135735
134376
|
{
|
|
135736
134377
|
var spanDom=document.createElement("span");
|
|
135737
134378
|
spanDom.className=this.CheckedClassName;
|
|
134379
|
+
spanDom.style["font-size"]="10px";
|
|
135738
134380
|
tdDom.appendChild(spanDom);
|
|
135739
134381
|
}
|
|
135740
134382
|
}
|
|
@@ -135752,6 +134394,7 @@ function JSPopMenu()
|
|
|
135752
134394
|
{
|
|
135753
134395
|
var spanDom=document.createElement("span");
|
|
135754
134396
|
spanDom.className=this.RightArrowClassName;
|
|
134397
|
+
spanDom.style["font-size"]="10px";
|
|
135755
134398
|
tdDom.appendChild(spanDom);
|
|
135756
134399
|
}
|
|
135757
134400
|
}
|
|
@@ -135779,7 +134422,21 @@ function JSPopMenu()
|
|
|
135779
134422
|
var subItem=item.SubMenu[i];
|
|
135780
134423
|
if (subItem.Name==JSPopMenu.SEPARATOR_LINE_NAME)
|
|
135781
134424
|
{
|
|
135782
|
-
|
|
134425
|
+
var trSeparator=document.createElement("tr");
|
|
134426
|
+
trSeparator.className='UMyChart_MenuItem_Tr_Separator';
|
|
134427
|
+
var tdDom=document.createElement("td");
|
|
134428
|
+
tdDom.className="UMyChart_MenuItem_Td_Status_Separator";
|
|
134429
|
+
trSeparator.appendChild(tdDom);
|
|
134430
|
+
var tdDom=document.createElement("td");
|
|
134431
|
+
tdDom.className="UMyChart_MenuItem_Td_Separator";
|
|
134432
|
+
trSeparator.appendChild(tdDom);
|
|
134433
|
+
var tdDom=document.createElement("td");
|
|
134434
|
+
tdDom.className="UMyChart_MenuItem_Td_Separator";
|
|
134435
|
+
trSeparator.appendChild(tdDom);
|
|
134436
|
+
var tdDom=document.createElement("td");
|
|
134437
|
+
tdDom.className="UMyChart_MenuItem_Td_Separator";
|
|
134438
|
+
trSeparator.appendChild(tdDom);
|
|
134439
|
+
subTbody.appendChild(trSeparator);
|
|
135783
134440
|
continue;
|
|
135784
134441
|
}
|
|
135785
134442
|
|
|
@@ -135821,11 +134478,40 @@ function JSPopMenu()
|
|
|
135821
134478
|
if (!this.RootDOM) return;
|
|
135822
134479
|
if (!IFrameSplitOperator.IsNumber(x) || !IFrameSplitOperator.IsNumber(y)) return;
|
|
135823
134480
|
|
|
134481
|
+
//菜单在当前屏幕无法显示需要调整
|
|
134482
|
+
var menuHeight=this.RootDOM.offsetHeight;
|
|
134483
|
+
var yMenuBottom=y+menuHeight;
|
|
134484
|
+
var yBottom=window.innerHeight-15;
|
|
134485
|
+
if (yMenuBottom>yBottom) y=yBottom-menuHeight;
|
|
134486
|
+
|
|
134487
|
+
var menuWidth=this.RootDOM.offsetWidth;
|
|
134488
|
+
var yMenuRight=x+menuWidth;
|
|
134489
|
+
var yRight=window.innerWidth-15;
|
|
134490
|
+
if (yMenuRight>yRight) x=yRight-menuWidth;
|
|
134491
|
+
|
|
135824
134492
|
this.RootDOM.style.visibility='visible';
|
|
135825
134493
|
this.RootDOM.style.top = y + "px";
|
|
135826
134494
|
this.RootDOM.style.left = x + "px";
|
|
135827
134495
|
}
|
|
135828
134496
|
|
|
134497
|
+
//下拉菜单
|
|
134498
|
+
this.PopupMenuByDrapdown=function(rtButton)
|
|
134499
|
+
{
|
|
134500
|
+
if (!this.RootDOM) return;
|
|
134501
|
+
if (!rtButton) return;
|
|
134502
|
+
|
|
134503
|
+
var xLeft=rtButton.Left;
|
|
134504
|
+
var yTop=rtButton.Bottom;
|
|
134505
|
+
var menuHeight=this.RootDOM.offsetHeight;
|
|
134506
|
+
var yMenuBottom=yTop+menuHeight;
|
|
134507
|
+
var yBottom=window.innerHeight-15;
|
|
134508
|
+
if (yMenuBottom>yBottom) yTop=rtButton.Top-menuHeight;
|
|
134509
|
+
|
|
134510
|
+
this.RootDOM.style.visibility='visible';
|
|
134511
|
+
this.RootDOM.style.top = yTop + "px";
|
|
134512
|
+
this.RootDOM.style.left = xLeft + "px";
|
|
134513
|
+
}
|
|
134514
|
+
|
|
135829
134515
|
this.OnClickMenu=function(e, item, bSubMenu)
|
|
135830
134516
|
{
|
|
135831
134517
|
console.log("[JSPopMenu::OnClickMenu] e=, item=, bSubMenu", e, item, bSubMenu);
|
|
@@ -135839,6 +134525,8 @@ function JSPopMenu()
|
|
|
135839
134525
|
if (parentItem && parentItem.PopMenu && parentItem.PopMenu!=subMenu)
|
|
135840
134526
|
{
|
|
135841
134527
|
parentItem.PopMenu.style.visibility="hidden";
|
|
134528
|
+
if (parentItem.PopRow) parentItem.PopRow.classList.remove(this.SelectedClassName);
|
|
134529
|
+
|
|
135842
134530
|
parentItem.PopMenu=null;
|
|
135843
134531
|
parentItem.PopRow=null;
|
|
135844
134532
|
}
|
|
@@ -135852,8 +134540,23 @@ function JSPopMenu()
|
|
|
135852
134540
|
else
|
|
135853
134541
|
{
|
|
135854
134542
|
var rtParent=trDom.getBoundingClientRect();
|
|
135855
|
-
|
|
135856
|
-
|
|
134543
|
+
var x=rtParent.right, y=rtParent.top;
|
|
134544
|
+
|
|
134545
|
+
//菜单在当前屏幕无法显示需要调整
|
|
134546
|
+
var yBottom=window.innerHeight-15;
|
|
134547
|
+
var yRight=window.innerWidth-15;
|
|
134548
|
+
var menuHeight=subMenu.offsetHeight;
|
|
134549
|
+
var menuWidth=subMenu.offsetWidth;
|
|
134550
|
+
var yMenuBottom=y+menuHeight;
|
|
134551
|
+
var yMenuRight=x+menuWidth;
|
|
134552
|
+
|
|
134553
|
+
if (yMenuBottom>yBottom) y=yBottom-menuHeight;
|
|
134554
|
+
if (yMenuRight>yRight) x=rtParent.left-menuWidth;
|
|
134555
|
+
|
|
134556
|
+
subMenu.style.left=`${x}px`;
|
|
134557
|
+
subMenu.style.top=`${y}px`;
|
|
134558
|
+
|
|
134559
|
+
trDom.classList.add(this.SelectedClassName);
|
|
135857
134560
|
|
|
135858
134561
|
/*
|
|
135859
134562
|
if (this.Data.Position==JSPopMenu.POSITION_ID.TAB_MENU_ID)
|
|
@@ -136014,7 +134717,7 @@ function HQChartScriptWorker()
|
|
|
136014
134717
|
|
|
136015
134718
|
|
|
136016
134719
|
|
|
136017
|
-
var HQCHART_VERSION="1.1.
|
|
134720
|
+
var HQCHART_VERSION="1.1.13193";
|
|
136018
134721
|
|
|
136019
134722
|
function PrintHQChartVersion()
|
|
136020
134723
|
{
|
|
@@ -136146,7 +134849,8 @@ export default {
|
|
|
136146
134849
|
JSCHART_DRAG_ID:JSCHART_DRAG_ID,
|
|
136147
134850
|
JSCHART_BUTTON_ID:JSCHART_BUTTON_ID,
|
|
136148
134851
|
JSCHART_DATA_FIELD_ID:JSCHART_DATA_FIELD_ID,
|
|
136149
|
-
JSCHART_WORKER_MESSAGE_ID:JSCHART_WORKER_MESSAGE_ID
|
|
134852
|
+
JSCHART_WORKER_MESSAGE_ID:JSCHART_WORKER_MESSAGE_ID,
|
|
134853
|
+
JSCHART_MENU_ID:JSCHART_MENU_ID
|
|
136150
134854
|
},
|
|
136151
134855
|
|
|
136152
134856
|
|