hqchart 1.1.15058 → 1.1.15066
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 +148 -154
- package/package.json +1 -1
- package/src/jscommon/umychart.js +375 -124
- package/src/jscommon/umychart.resource/css/tools.css +61 -0
- package/src/jscommon/umychart.style.js +6 -0
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +382 -125
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.vue.js +382 -125
|
@@ -7514,6 +7514,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
7514
7514
|
this.DialogSearchIndex; //指标搜索
|
|
7515
7515
|
this.DialogModifyIndexParam; //指标参数修改
|
|
7516
7516
|
this.SmallFloatTooltipGroup; //小浮框tooltip信息集合
|
|
7517
|
+
this.JSToolbarTooltip; //指标标题工具栏tooltip信息
|
|
7517
7518
|
|
|
7518
7519
|
|
|
7519
7520
|
this.RestoreFocusTimer=null; //恢复焦点定时器
|
|
@@ -13976,6 +13977,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
13976
13977
|
if (overlayItem.Frame && overlayItem.Frame.ReloadResource) overlayItem.Frame.ReloadResource(resource);
|
|
13977
13978
|
}
|
|
13978
13979
|
}
|
|
13980
|
+
|
|
13981
|
+
if (this.JSToolbarTooltip) this.JSToolbarTooltip.ReloadResource(resource); //工具栏提示框
|
|
13979
13982
|
}
|
|
13980
13983
|
|
|
13981
13984
|
this.ReloadChartPaint=function(resource)
|
|
@@ -14445,6 +14448,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
14445
14448
|
if (!subFrame || !subFrame.Frame) return;
|
|
14446
14449
|
|
|
14447
14450
|
var frame=subFrame.Frame;
|
|
14451
|
+
var pixelRatio=GetDevicePixelRatio();
|
|
14448
14452
|
|
|
14449
14453
|
if (windowItem)
|
|
14450
14454
|
{
|
|
@@ -14492,6 +14496,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
14492
14496
|
}
|
|
14493
14497
|
|
|
14494
14498
|
if (IFrameSplitOperator.IsNumber(frameItem.Height) && frameItem.Height>=0) subFrame.Height = frameItem.Height;
|
|
14499
|
+
if (IFrameSplitOperator.IsNumber(frameItem.TopSpace)) frame.ChartBorder.TopSpace=frameItem.TopSpace*pixelRatio;
|
|
14500
|
+
if (IFrameSplitOperator.IsNumber(frameItem.BottomSpace)) frame.ChartBorder.BottomSpace=frameItem.BottomSpace*pixelRatio;
|
|
14495
14501
|
}
|
|
14496
14502
|
|
|
14497
14503
|
}
|
|
@@ -14501,6 +14507,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
14501
14507
|
if (!option) return;
|
|
14502
14508
|
|
|
14503
14509
|
var frame=subFrame.Frame;
|
|
14510
|
+
var pixelRatio=GetDevicePixelRatio();
|
|
14504
14511
|
|
|
14505
14512
|
if (option.Window)
|
|
14506
14513
|
{
|
|
@@ -14540,6 +14547,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
14540
14547
|
if (IFrameSplitOperator.IsBool(option.IsShowYLine)) subFrame.Frame.IsShowYLine=option.IsShowYLine;
|
|
14541
14548
|
if (IFrameSplitOperator.IsBool(option.IsShowIndexTitle)) subFrame.Frame.IsShowIndexTitle=option.IsShowIndexTitle;
|
|
14542
14549
|
if (IFrameSplitOperator.IsNumber(option.Height)) subFrame.Height=option.Height; //高度
|
|
14550
|
+
if (IFrameSplitOperator.IsNumber(option.TopSpace)) frame.ChartBorder.TopSpace=option.TopSpace*pixelRatio;
|
|
14551
|
+
if (IFrameSplitOperator.IsNumber(option.BottomSpace)) frame.ChartBorder.BottomSpace=option.BottomSpace*pixelRatio;
|
|
14543
14552
|
|
|
14544
14553
|
|
|
14545
14554
|
if (IFrameSplitOperator.IsBool(option.IsShowLeftText))
|
|
@@ -17709,6 +17718,8 @@ function AverageWidthFrame()
|
|
|
17709
17718
|
this.BeforeDrawXYCallback; //坐标绘制前回调,绘制深度图
|
|
17710
17719
|
this.GetEventCallback; //事件回调
|
|
17711
17720
|
|
|
17721
|
+
this.DivFrameToolbar;
|
|
17722
|
+
|
|
17712
17723
|
//工具栏的按钮样式
|
|
17713
17724
|
this.ToolbarButtonStyle=g_JSChartResource.ToolbarButtonStyle;
|
|
17714
17725
|
this.CloseWindowButton=CloneData(g_JSChartResource.Buttons.CloseWindow);
|
|
@@ -17758,6 +17769,8 @@ function AverageWidthFrame()
|
|
|
17758
17769
|
this.ButtonTooltip=CloneData(g_JSChartResource.Buttons.Tooltip);
|
|
17759
17770
|
this.AddIndexWindowButton=CloneData(g_JSChartResource.Buttons.AddIndexWindow);
|
|
17760
17771
|
}
|
|
17772
|
+
|
|
17773
|
+
if (this.DivFrameToolbar) this.DivFrameToolbar.ReloadResource(resource);
|
|
17761
17774
|
}
|
|
17762
17775
|
|
|
17763
17776
|
this.DrawFrame=function()
|
|
@@ -20327,7 +20340,6 @@ function AverageWidthFrame()
|
|
|
20327
20340
|
}
|
|
20328
20341
|
}
|
|
20329
20342
|
|
|
20330
|
-
|
|
20331
20343
|
if (IFrameSplitOperator.IsNumber(width.Right)) width.Right+=rightExtendWidth;
|
|
20332
20344
|
if (IFrameSplitOperator.IsNumber(width.Left)) width.Left+=this.YTextPadding[0]+leftExtendLineWidth;
|
|
20333
20345
|
if (IFrameSplitOperator.IsNumber(width.Right)) width.Right+=this.YTextPadding[1]+rightExtendLineWidth;
|
|
@@ -20335,25 +20347,34 @@ function AverageWidthFrame()
|
|
|
20335
20347
|
return { TextWidth:width };
|
|
20336
20348
|
}
|
|
20337
20349
|
|
|
20350
|
+
this.CreateDivFrameToolbar=function(hqchart, frameID, divHQChart)
|
|
20351
|
+
{
|
|
20352
|
+
if (this.ToolbarButtonStyle==1) return;
|
|
20353
|
+
if (this.DivFrameToolbar) return;
|
|
20354
|
+
|
|
20355
|
+
if (this.ClassName=="MinuteFrame" || this.ClassName=="KLineFrame")
|
|
20356
|
+
{
|
|
20357
|
+
this.DivFrameToolbar=new JSDivFrameToolbar();
|
|
20358
|
+
this.DivFrameToolbar.HQChart=hqchart;
|
|
20359
|
+
this.DivFrameToolbar.DivHQChart=divHQChart;
|
|
20360
|
+
this.DivFrameToolbar.FrameID=frameID;
|
|
20361
|
+
this.DivFrameToolbar.Create();
|
|
20362
|
+
}
|
|
20363
|
+
}
|
|
20364
|
+
|
|
20338
20365
|
this.ClearToolbar=function()
|
|
20339
20366
|
{
|
|
20340
|
-
if (!this.
|
|
20367
|
+
if (!this.DivFrameToolbar) return;
|
|
20341
20368
|
|
|
20342
|
-
|
|
20343
|
-
|
|
20344
|
-
this.ChartBorder.UIElement.parentNode.removeChild(divToolbar);
|
|
20345
|
-
this.ToolbarRect=null;
|
|
20369
|
+
this.DivFrameToolbar.Destroy();
|
|
20370
|
+
this.DivFrameToolbar=null;
|
|
20346
20371
|
}
|
|
20347
20372
|
|
|
20348
20373
|
this.HideToolbar=function()
|
|
20349
20374
|
{
|
|
20350
|
-
if (!this.
|
|
20375
|
+
if (!this.DivFrameToolbar) return;
|
|
20351
20376
|
|
|
20352
|
-
this.
|
|
20353
|
-
var divToolbar=document.getElementById(this.ToolbarID);
|
|
20354
|
-
if (!divToolbar) return;
|
|
20355
|
-
|
|
20356
|
-
if (divToolbar.style.display!='none') divToolbar.style.display='none';
|
|
20377
|
+
this.DivFrameToolbar.Hide();
|
|
20357
20378
|
}
|
|
20358
20379
|
|
|
20359
20380
|
this.GetMainOverlayFrame=function()
|
|
@@ -20391,7 +20412,6 @@ function MinuteFrame()
|
|
|
20391
20412
|
this.MultiDayBorderPen=g_JSChartResource.MultiDayBorderPen;
|
|
20392
20413
|
this.CustomHorizontalInfo=[];
|
|
20393
20414
|
this.RightFrame=null; //右侧多重坐标
|
|
20394
|
-
this.ToolbarID=Guid(); //工具条Div id
|
|
20395
20415
|
this.ReDrawToolbar=false;
|
|
20396
20416
|
this.DayCount=1; //显示天数
|
|
20397
20417
|
|
|
@@ -20404,7 +20424,6 @@ function MinuteFrame()
|
|
|
20404
20424
|
this.OverlayIndex=g_JSChartResource.MinuteToolbar.OverlayIndex; //是否显示叠加指标
|
|
20405
20425
|
this.AddIndexWindow=g_JSChartResource.MinuteToolbar.AddIndexWindow; //是否显示'增加指标窗口'菜单
|
|
20406
20426
|
|
|
20407
|
-
this.ToolbarRect=null; //保存工具条的位置
|
|
20408
20427
|
this.IsShowPositionTitle=false; //是否显示持仓标题
|
|
20409
20428
|
|
|
20410
20429
|
this.LastCalculateStatus={ Width:0, XPointCount:0 }; //最后一次计算宽度的状态
|
|
@@ -20536,112 +20555,8 @@ function MinuteFrame()
|
|
|
20536
20555
|
if (this.ToolbarButtonStyle==1) return;
|
|
20537
20556
|
if (g_JSChartResource.IsDOMFrameToolbar===true) return;
|
|
20538
20557
|
|
|
20539
|
-
if (
|
|
20540
|
-
|
|
20541
|
-
if (this.Identify<2) return;
|
|
20542
|
-
if (!this.ChartBorder.UIElement) return;
|
|
20543
|
-
|
|
20544
|
-
var divToolbar=document.getElementById(this.ToolbarID);
|
|
20545
|
-
if (divToolbar && this.SizeChange==false && this.ReDrawToolbar==false) return;
|
|
20546
|
-
|
|
20547
|
-
if (!divToolbar)
|
|
20548
|
-
{
|
|
20549
|
-
divToolbar=document.createElement("div");
|
|
20550
|
-
divToolbar.className='klineframe-toolbar';
|
|
20551
|
-
divToolbar.id=this.ToolbarID;
|
|
20552
|
-
divToolbar.oncontextmenu = function() { return false;}; //屏蔽右键系统菜单
|
|
20553
|
-
//为divToolbar添加属性identify
|
|
20554
|
-
divToolbar.setAttribute("identify",this.Identify.toString());
|
|
20555
|
-
this.ChartBorder.UIElement.parentNode.appendChild(divToolbar);
|
|
20556
|
-
}
|
|
20557
|
-
|
|
20558
|
-
if (!this.ModifyIndex && !this.ChangeIndex && !this.OverlayIndex && !this.CloseIndex)
|
|
20559
|
-
{
|
|
20560
|
-
if (divToolbar.style.display!='none')
|
|
20561
|
-
divToolbar.style.display='none';
|
|
20562
|
-
return;
|
|
20563
|
-
}
|
|
20564
|
-
|
|
20565
|
-
//使用外城div尺寸 画图尺寸是被放大的
|
|
20566
|
-
var pixelTatio = GetDevicePixelRatio();
|
|
20567
|
-
var chartWidth=parseInt(this.ChartBorder.UIElement.parentElement.style.width.replace("px",""));
|
|
20568
|
-
var chartHeight=parseInt(this.ChartBorder.UIElement.parentElement.style.height.replace("px",""));
|
|
20569
|
-
//JSConsole.Chart.Log('[KLineFrame::DrawToolbar] ',chartWidth,chartHeight,pixelTatio);
|
|
20570
|
-
|
|
20571
|
-
var toolbarWidth=100;
|
|
20572
|
-
var toolbarHeight=this.ChartBorder.GetTitleHeight();
|
|
20573
|
-
var left=chartWidth-(this.ChartBorder.Right/pixelTatio)-toolbarWidth;
|
|
20574
|
-
var top=this.ChartBorder.GetTop()/pixelTatio;
|
|
20575
|
-
|
|
20576
|
-
if (this.ToolbarRect)
|
|
20577
|
-
{
|
|
20578
|
-
//尺寸变动移动才重新设置DOM
|
|
20579
|
-
if (this.ToolbarRect.Left==left && this.ToolbarRect.Top==top &&
|
|
20580
|
-
this.ToolbarRect.Width==toolbarWidth && this.ToolbarRect.Height==toolbarHeight/pixelTatio)
|
|
20581
|
-
{
|
|
20582
|
-
return;
|
|
20583
|
-
}
|
|
20584
|
-
}
|
|
20585
|
-
|
|
20586
|
-
this.ToolbarRect={ Left:left, Top:top, Width:toolbarWidth, Height:toolbarHeight/pixelTatio };
|
|
20587
|
-
|
|
20588
|
-
const modifyButton=`<span class='index_param icon iconfont icon-index_param' id='modifyindex' style='cursor:pointer;margin-left:2px;margin-right:2px;' title='调整指标参数'></span>`;
|
|
20589
|
-
const changeButton=`<span class='index_change icon iconfont icon-change_index' id='changeindex' style='cursor:pointer;margin-left:2px;margin-right:2px;' title='切换指标'></span>`;
|
|
20590
|
-
const closeButton=`<span class='index_close icon iconfont icon-close' id='closeindex' style='cursor:pointer;margin-left:2px;margin-right:2px;' title='关闭指标窗口'></span>`;
|
|
20591
|
-
|
|
20592
|
-
var spanIcon=modifyButton+changeButton;
|
|
20593
|
-
if (this.CloseIndex)
|
|
20594
|
-
{
|
|
20595
|
-
spanIcon+=closeButton;
|
|
20596
|
-
}
|
|
20597
|
-
|
|
20598
|
-
//var scrollPos=GetScrollPosition();
|
|
20599
|
-
//left = left+scrollPos.Left;
|
|
20600
|
-
//top = top+scrollPos.Top;
|
|
20601
|
-
divToolbar.style.left = left + "px";
|
|
20602
|
-
divToolbar.style.top = top + "px";
|
|
20603
|
-
divToolbar.style.width=toolbarWidth+"px"; //宽度先不调整吧
|
|
20604
|
-
divToolbar.style.height=(toolbarHeight/pixelTatio)+'px'; //只调整高度
|
|
20605
|
-
divToolbar.innerHTML=spanIcon;
|
|
20606
|
-
|
|
20607
|
-
var chart=this.ChartBorder.UIElement.JSChartContainer;
|
|
20608
|
-
var identify=this.Identify;
|
|
20609
|
-
if (!this.ModifyIndex) //隐藏'改参数'
|
|
20610
|
-
$("#"+divToolbar.id+" .index_param").hide();
|
|
20611
|
-
else if (typeof(this.ModifyIndexEvent)=='function') //绑定点击事件
|
|
20612
|
-
$("#"+divToolbar.id+" .index_param").click(
|
|
20613
|
-
{
|
|
20614
|
-
Chart:this.ChartBorder.UIElement.JSChartContainer,
|
|
20615
|
-
Identify:this.Identify
|
|
20616
|
-
},this.ModifyIndexEvent);
|
|
20617
|
-
|
|
20618
|
-
if (!this.ChangeIndex) //隐藏'换指标'
|
|
20619
|
-
{
|
|
20620
|
-
$("#"+divToolbar.id+" .index_change").hide();
|
|
20621
|
-
}
|
|
20622
|
-
else if (typeof(this.ChangeIndexEvent)=='function')
|
|
20623
|
-
{
|
|
20624
|
-
$("#"+divToolbar.id+" .index_change").click(
|
|
20625
|
-
{
|
|
20626
|
-
Chart:this.ChartBorder.UIElement.JSChartContainer,
|
|
20627
|
-
Identify:this.Identify,
|
|
20628
|
-
IsOverlay:false
|
|
20629
|
-
},this.ChangeIndexEvent);
|
|
20630
|
-
}
|
|
20631
|
-
|
|
20632
|
-
$("#"+divToolbar.id+" .index_close").click(
|
|
20633
|
-
{
|
|
20634
|
-
Chart:this.ChartBorder.UIElement.JSChartContainer,
|
|
20635
|
-
Identify:this.Identify
|
|
20636
|
-
},
|
|
20637
|
-
function(event)
|
|
20638
|
-
{
|
|
20639
|
-
var hqChart=event.data.Chart;
|
|
20640
|
-
var id=event.data.Identify;
|
|
20641
|
-
hqChart.RemoveIndexWindow(id);
|
|
20642
|
-
});
|
|
20643
|
-
|
|
20644
|
-
divToolbar.style.display = "block";
|
|
20558
|
+
if (!this.DivFrameToolbar) return;
|
|
20559
|
+
this.DivFrameToolbar.Show(this.Identify);
|
|
20645
20560
|
}
|
|
20646
20561
|
|
|
20647
20562
|
//手绘,不用DOM,使用DOM太麻烦了
|
|
@@ -22823,7 +22738,6 @@ function KLineFrame()
|
|
|
22823
22738
|
delete this.newMethod;
|
|
22824
22739
|
|
|
22825
22740
|
this.ClassName='KLineFrame';
|
|
22826
|
-
this.ToolbarID=Guid(); //工具条Div id
|
|
22827
22741
|
|
|
22828
22742
|
this.ModifyIndex=g_JSChartResource.KLineToolbar.ModifyIndex; //是否显示'改参数'菜单
|
|
22829
22743
|
this.ChangeIndex=g_JSChartResource.KLineToolbar.ChangeIndex; //是否显示'换指标'菜单
|
|
@@ -22836,7 +22750,6 @@ function KLineFrame()
|
|
|
22836
22750
|
|
|
22837
22751
|
this.SelBorderColor=g_JSChartResource.SelFrameBorderColor;
|
|
22838
22752
|
|
|
22839
|
-
this.ToolbarRect=null; //保存工具条的位置
|
|
22840
22753
|
this.ReDrawToolbar=false;
|
|
22841
22754
|
|
|
22842
22755
|
this.LastCalculateStatus={ Width:0, XPointCount:0 }; //最后一次计算宽度的状态
|
|
@@ -22860,6 +22773,11 @@ function KLineFrame()
|
|
|
22860
22773
|
{
|
|
22861
22774
|
if (this.ToolbarButtonStyle==1) return;
|
|
22862
22775
|
if (g_JSChartResource.IsDOMFrameToolbar===true) return;
|
|
22776
|
+
if (!this.DivFrameToolbar) return;
|
|
22777
|
+
|
|
22778
|
+
this.DivFrameToolbar.Show(this.Identify);
|
|
22779
|
+
|
|
22780
|
+
return;
|
|
22863
22781
|
|
|
22864
22782
|
if (typeof($)=="undefined") return;
|
|
22865
22783
|
|
|
@@ -57281,6 +57199,10 @@ function KLineCountDownPaint()
|
|
|
57281
57199
|
this.CanvasEx.fillStyle=out.BGColor;
|
|
57282
57200
|
this.CanvasEx.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);
|
|
57283
57201
|
}
|
|
57202
|
+
else
|
|
57203
|
+
{
|
|
57204
|
+
return;
|
|
57205
|
+
}
|
|
57284
57206
|
|
|
57285
57207
|
this.Canvas.textAlign = "left";
|
|
57286
57208
|
this.Canvas.textBaseline = "bottom";
|
|
@@ -81614,6 +81536,12 @@ function JSChartResource()
|
|
|
81614
81536
|
Mergin:{ Left:4, Right:4, Top:2, Bottom:3 },
|
|
81615
81537
|
}
|
|
81616
81538
|
}
|
|
81539
|
+
|
|
81540
|
+
this.DivFrameToolbar=
|
|
81541
|
+
{
|
|
81542
|
+
Icon:{ Color:"rgb(0,0,0)", HoverColor:"rgb(30,144,255)" },
|
|
81543
|
+
Tooltip:{ BGColor:"rgb(255,255,255)", TextColor:"rgb(71,71,71)", BorderColor:"rgb(0,0,0)" },
|
|
81544
|
+
}
|
|
81617
81545
|
|
|
81618
81546
|
//画图工具
|
|
81619
81547
|
this.DrawPicture=
|
|
@@ -83592,6 +83520,29 @@ function JSChartResource()
|
|
|
83592
83520
|
if (style.KLineCountDownPaint) this.SetKLineCountDownPaint(style.KLineCountDownPaint);
|
|
83593
83521
|
|
|
83594
83522
|
if (style.SmallFloatTooltipV2) this.SetSmallFloatTooltipV2(style.SmallFloatTooltipV2);
|
|
83523
|
+
|
|
83524
|
+
if (style.DivFrameToolbar) this.SetDivFrameToolbar(style.DivFrameToolbar);
|
|
83525
|
+
}
|
|
83526
|
+
|
|
83527
|
+
this.SetDivFrameToolbar=function(style)
|
|
83528
|
+
{
|
|
83529
|
+
var dest=this.DivFrameToolbar;
|
|
83530
|
+
if (style.Icon)
|
|
83531
|
+
{
|
|
83532
|
+
var item=style.Icon;
|
|
83533
|
+
var subDest=dest.Icon;
|
|
83534
|
+
if (item.Color) subDest.Color=item.Color;
|
|
83535
|
+
if (item.HoverColor) subDest.HoverColor=item.HoverColor;
|
|
83536
|
+
}
|
|
83537
|
+
|
|
83538
|
+
if (style.Tooltip)
|
|
83539
|
+
{
|
|
83540
|
+
var item=style.Tooltip;
|
|
83541
|
+
var subDest=dest.Tooltip;
|
|
83542
|
+
if (item.TextColor) subDest.TextColor=item.TextColor;
|
|
83543
|
+
if (item.BorderColor) subDest.BorderColor=item.BorderColor;
|
|
83544
|
+
if (item.BGColor) subDest.BGColor=item.BGColor;
|
|
83545
|
+
}
|
|
83595
83546
|
}
|
|
83596
83547
|
|
|
83597
83548
|
this.SetSmallFloatTooltipV2=function(style)
|
|
@@ -86928,6 +86879,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
86928
86879
|
frame.RightSpaceCount=this.RightSpaceCount; //右边
|
|
86929
86880
|
frame.GetEventCallback=(id)=> { return this.GetEventCallback(id); };
|
|
86930
86881
|
frame.GlobalOption=this.GlobalOption;
|
|
86882
|
+
frame.CreateDivFrameToolbar(this, i, this.UIElement.parentNode);
|
|
86931
86883
|
|
|
86932
86884
|
frame.HorizontalMax=20;
|
|
86933
86885
|
frame.HorizontalMin=10;
|
|
@@ -87028,6 +86980,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
87028
86980
|
frame.YSplitOperator.HQChart=this;
|
|
87029
86981
|
frame.XSplitOperator.Symbol=this.Symbol;
|
|
87030
86982
|
frame.XSplitOperator.Period=this.Period;
|
|
86983
|
+
frame.CreateDivFrameToolbar(this, id, this.UIElement.parentNode);
|
|
87031
86984
|
|
|
87032
86985
|
//K线数据绑定
|
|
87033
86986
|
var xPointCouont=this.Frame.SubFrame[0].Frame.XPointCount;
|
|
@@ -89618,7 +89571,6 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
89618
89571
|
if (bChanged)
|
|
89619
89572
|
{
|
|
89620
89573
|
frame.SizeChange=true;
|
|
89621
|
-
frame.ToolbarRect=null; //清空工具栏缓存
|
|
89622
89574
|
frame.DrawToolbar();
|
|
89623
89575
|
}
|
|
89624
89576
|
}
|
|
@@ -96589,7 +96541,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
96589
96541
|
|
|
96590
96542
|
if (i>=2)
|
|
96591
96543
|
{
|
|
96592
|
-
|
|
96544
|
+
frame.CreateDivFrameToolbar(this, i, this.UIElement.parentNode);
|
|
96593
96545
|
}
|
|
96594
96546
|
|
|
96595
96547
|
var DEFAULT_HORIZONTAL=[9,8,7,6,5,4,3,2,1];
|
|
@@ -96696,6 +96648,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
96696
96648
|
frame.XSplitOperator.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
96697
96649
|
frame.YSplitOperator.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
96698
96650
|
frame.XSplitOperator.Symbol=this.Symbol;
|
|
96651
|
+
frame.CreateDivFrameToolbar(this, id, this.UIElement.parentNode);
|
|
96699
96652
|
|
|
96700
96653
|
if (this.DayCount>1)
|
|
96701
96654
|
{
|
|
@@ -109442,6 +109395,304 @@ Path2DHelper.PtInRect=function(x, y, rect)
|
|
|
109442
109395
|
}
|
|
109443
109396
|
|
|
109444
109397
|
|
|
109398
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
109399
|
+
// 指标窗口顶部工具条
|
|
109400
|
+
//
|
|
109401
|
+
//
|
|
109402
|
+
///////////////////////////////////////////////////////////////////////////////////
|
|
109403
|
+
|
|
109404
|
+
|
|
109405
|
+
function JSDivFrameToolbar()
|
|
109406
|
+
{
|
|
109407
|
+
this.DivToolbar=null;
|
|
109408
|
+
this.DivHQChart=null;
|
|
109409
|
+
this.HQChart=null;
|
|
109410
|
+
this.FrameID=-1; //指标窗口ID
|
|
109411
|
+
this.ID=Guid();
|
|
109412
|
+
this.Left=-1;
|
|
109413
|
+
this.Top=-1;
|
|
109414
|
+
|
|
109415
|
+
this.IconConfig=
|
|
109416
|
+
{
|
|
109417
|
+
Color:g_JSChartResource.DivFrameToolbar.Icon.Color,
|
|
109418
|
+
HoverColor:g_JSChartResource.DivFrameToolbar.Icon.HoverColor
|
|
109419
|
+
}
|
|
109420
|
+
|
|
109421
|
+
this.AryButton=
|
|
109422
|
+
[
|
|
109423
|
+
{
|
|
109424
|
+
ID:JSCHART_BUTTON_ID.MODIFY_INDEX_PARAM, ClassName:"UMyChart_FrameToolbar_Span_Button icon iconfont icon-index_param", Tooltip:{ Text:"修改参数"},
|
|
109425
|
+
Span:null, Div:null, TooltipSpan:null
|
|
109426
|
+
},
|
|
109427
|
+
{
|
|
109428
|
+
ID:JSCHART_BUTTON_ID.CHANGE_INDEX, ClassName:"UMyChart_FrameToolbar_Span_Button icon iconfont icon-change_index", Tooltip:{ Text:"切换指标"},
|
|
109429
|
+
Span:null,Div:null, TooltipSpan:null
|
|
109430
|
+
},
|
|
109431
|
+
{
|
|
109432
|
+
ID:JSCHART_BUTTON_ID.OVERLAY_INDEX, ClassName:"UMyChart_FrameToolbar_Span_Button icon iconfont icon-overlay_index", Tooltip:{ Text:"叠加指标"},
|
|
109433
|
+
Span:null,Div:null, TooltipSpan:null
|
|
109434
|
+
},
|
|
109435
|
+
{
|
|
109436
|
+
ID:JSCHART_BUTTON_ID.CLOSE_INDEX_WINDOW, ClassName:"UMyChart_FrameToolbar_Span_Button icon iconfont icon-close", Tooltip:{ Text:"关闭窗口"},
|
|
109437
|
+
Span:null,Div:null, TooltipSpan:null
|
|
109438
|
+
},
|
|
109439
|
+
];
|
|
109440
|
+
|
|
109441
|
+
this.SetToolbar=function(aryButton)
|
|
109442
|
+
{
|
|
109443
|
+
//清空原来的按钮
|
|
109444
|
+
for(var i=0; i<this.AryButton.length; i++)
|
|
109445
|
+
{
|
|
109446
|
+
var item=this.AryButton[i];
|
|
109447
|
+
if (item.Div && this.DivToolbar) this.DivToolbar.removeChild(item.Div);
|
|
109448
|
+
item.Div=null;
|
|
109449
|
+
item.Span=null;
|
|
109450
|
+
item.TooltipSpan=null;
|
|
109451
|
+
}
|
|
109452
|
+
this.AryButton=[];
|
|
109453
|
+
|
|
109454
|
+
//重新创建
|
|
109455
|
+
for(var i=0;i<aryButton.length; i++)
|
|
109456
|
+
{
|
|
109457
|
+
var item=aryButton[i];
|
|
109458
|
+
if (!item.ID || !item.ClassName) continue;
|
|
109459
|
+
var newItem={ ID:item.ID, ClassName:item.ClassName, Span:null,Div:null, TooltipSpan:null };
|
|
109460
|
+
if (item.Tooltip && item.Tooltip.Text) newItem.Tooltip={ Text:item.Tooltip.Text };
|
|
109461
|
+
|
|
109462
|
+
this.AryButton.push(newItem);
|
|
109463
|
+
|
|
109464
|
+
if (this.DivToolbar) this.CreateButton(newItem, this.DivToolbar);
|
|
109465
|
+
}
|
|
109466
|
+
|
|
109467
|
+
this.UpdateStyle();
|
|
109468
|
+
}
|
|
109469
|
+
|
|
109470
|
+
this.Destroy=function()
|
|
109471
|
+
{
|
|
109472
|
+
if (this.DivToolbar)
|
|
109473
|
+
{
|
|
109474
|
+
if (this.DivHQChart.removeChild) this.DivHQChart.removeChild(this.DivToolbar);
|
|
109475
|
+
this.DivToolbar=null;
|
|
109476
|
+
}
|
|
109477
|
+
|
|
109478
|
+
this.HQChart=null;
|
|
109479
|
+
this.DivHQChart=null;
|
|
109480
|
+
this.FrameID=-1;
|
|
109481
|
+
}
|
|
109482
|
+
|
|
109483
|
+
this.Create=function()
|
|
109484
|
+
{
|
|
109485
|
+
var divToolbar=document.createElement("div");
|
|
109486
|
+
divToolbar.className='UMyChart_FrameToolbar_Div';
|
|
109487
|
+
divToolbar.id=this.ID;
|
|
109488
|
+
divToolbar.oncontextmenu = function() { return false; }; //屏蔽右键系统菜单
|
|
109489
|
+
|
|
109490
|
+
for(var i=0;i<this.AryButton.length; i++)
|
|
109491
|
+
{
|
|
109492
|
+
var item=this.AryButton[i];
|
|
109493
|
+
if (this.FrameID==0 && item.ID==JSCHART_BUTTON_ID.CLOSE_INDEX_WINDOW) continue; //第一个指标窗口不显示关闭按钮
|
|
109494
|
+
this.CreateButton(item, divToolbar);
|
|
109495
|
+
}
|
|
109496
|
+
|
|
109497
|
+
this.DivHQChart.appendChild(divToolbar);
|
|
109498
|
+
|
|
109499
|
+
this.DivToolbar=divToolbar;
|
|
109500
|
+
|
|
109501
|
+
this.UpdateStyle();
|
|
109502
|
+
|
|
109503
|
+
if (!this.HQChart.JSToolbarTooltip)
|
|
109504
|
+
{
|
|
109505
|
+
this.HQChart.JSToolbarTooltip=new JSToolbarTooltip();
|
|
109506
|
+
this.HQChart.JSToolbarTooltip.DivHQChart=this.DivHQChart;
|
|
109507
|
+
this.HQChart.JSToolbarTooltip.Create();
|
|
109508
|
+
}
|
|
109509
|
+
}
|
|
109510
|
+
|
|
109511
|
+
this.UpdateStyle=function()
|
|
109512
|
+
{
|
|
109513
|
+
if (!this.DivToolbar) return;
|
|
109514
|
+
|
|
109515
|
+
for(var i=0;i<this.AryButton.length; i++)
|
|
109516
|
+
{
|
|
109517
|
+
var item=this.AryButton[i]
|
|
109518
|
+
if (!item.Span) continue;
|
|
109519
|
+
item.Span.style["color"]=this.IconConfig.Color;
|
|
109520
|
+
}
|
|
109521
|
+
}
|
|
109522
|
+
|
|
109523
|
+
this.ReloadResource=function(option)
|
|
109524
|
+
{
|
|
109525
|
+
this.IconConfig.Color=g_JSChartResource.DivFrameToolbar.Icon.Color,
|
|
109526
|
+
this.IconConfig.HoverColor=g_JSChartResource.DivFrameToolbar.Icon.HoverColor;
|
|
109527
|
+
|
|
109528
|
+
this.UpdateStyle();
|
|
109529
|
+
}
|
|
109530
|
+
|
|
109531
|
+
this.CreateButton=function(item, divDom)
|
|
109532
|
+
{
|
|
109533
|
+
var btnDiv=document.createElement("div");
|
|
109534
|
+
btnDiv.className="UMyChart_FrameToolbar_Div_Button";
|
|
109535
|
+
btnDiv.onmouseover=(e)=> { this.OnHoverButton(e, item); }
|
|
109536
|
+
btnDiv.onmouseout=(e)=>{ this.OnLeaveButton(e, item); }
|
|
109537
|
+
item.Div=btnDiv;
|
|
109538
|
+
|
|
109539
|
+
var spanDom=document.createElement("span");
|
|
109540
|
+
spanDom.className=item.ClassName;
|
|
109541
|
+
spanDom.onmousedown=(e)=>{ this.OnClickButton(e, item); };
|
|
109542
|
+
item.Span=spanDom;
|
|
109543
|
+
btnDiv.appendChild(spanDom);
|
|
109544
|
+
|
|
109545
|
+
divDom.appendChild(btnDiv);
|
|
109546
|
+
}
|
|
109547
|
+
|
|
109548
|
+
this.OnClickButton=function(e, item)
|
|
109549
|
+
{
|
|
109550
|
+
if (!this.FrameID<0) return;
|
|
109551
|
+
if (!this.HQChart) return;
|
|
109552
|
+
|
|
109553
|
+
var frame=this.HQChart.Frame.SubFrame[this.FrameID].Frame;
|
|
109554
|
+
|
|
109555
|
+
var button={ ID:item.ID, Frame:frame };
|
|
109556
|
+
this.HQChart.ClickFrameButton(button, e);
|
|
109557
|
+
}
|
|
109558
|
+
|
|
109559
|
+
this.OnHoverButton=function(e, item)
|
|
109560
|
+
{
|
|
109561
|
+
if (!item.Span) return;
|
|
109562
|
+
|
|
109563
|
+
item.Span.style["color"]=this.IconConfig.HoverColor;
|
|
109564
|
+
|
|
109565
|
+
this.ShowTooltip(e, item);
|
|
109566
|
+
}
|
|
109567
|
+
|
|
109568
|
+
this.OnLeaveButton=function(e, item)
|
|
109569
|
+
{
|
|
109570
|
+
if (!item.Span) return;
|
|
109571
|
+
item.Span.style["color"]=this.IconConfig.Color;
|
|
109572
|
+
|
|
109573
|
+
this.HideTooltip();
|
|
109574
|
+
}
|
|
109575
|
+
|
|
109576
|
+
this.Show=function(frameID)
|
|
109577
|
+
{
|
|
109578
|
+
this.FrameID=frameID;
|
|
109579
|
+
if (!this.FrameID<0) return;
|
|
109580
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(this.HQChart.Frame.SubFrame)) return;
|
|
109581
|
+
if (!this.HQChart.Frame.SubFrame[this.FrameID]) return;
|
|
109582
|
+
|
|
109583
|
+
var pixelTatio = GetDevicePixelRatio();
|
|
109584
|
+
var frame=this.HQChart.Frame.SubFrame[this.FrameID].Frame;
|
|
109585
|
+
var border=frame.GetBorder();
|
|
109586
|
+
|
|
109587
|
+
var top=border.Top/pixelTatio;
|
|
109588
|
+
var right=border.RightEx/pixelTatio;
|
|
109589
|
+
var left=right-this.DivToolbar.offsetWidth-2;
|
|
109590
|
+
|
|
109591
|
+
if (this.Top!=top || this.Left!=left)
|
|
109592
|
+
{
|
|
109593
|
+
this.DivToolbar.style.top = top + "px";
|
|
109594
|
+
this.DivToolbar.style.left = left + "px";
|
|
109595
|
+
this.DivToolbar.style.height=frame.ChartBorder.TitleHeight/pixelTatio + "px";
|
|
109596
|
+
this.Top=top;
|
|
109597
|
+
this.Left=left;
|
|
109598
|
+
}
|
|
109599
|
+
|
|
109600
|
+
if (this.DivToolbar.style.visibility!='visible') this.DivToolbar.style.visibility='visible';
|
|
109601
|
+
}
|
|
109602
|
+
|
|
109603
|
+
this.Hide=function()
|
|
109604
|
+
{
|
|
109605
|
+
if (this.DivToolbar) this.DivToolbar.style.visibility="hidden";
|
|
109606
|
+
}
|
|
109607
|
+
|
|
109608
|
+
this.HideTooltip=function()
|
|
109609
|
+
{
|
|
109610
|
+
if (this.HQChart.JSToolbarTooltip) this.HQChart.JSToolbarTooltip.Hide();
|
|
109611
|
+
}
|
|
109612
|
+
|
|
109613
|
+
this.ShowTooltip=function(e, item)
|
|
109614
|
+
{
|
|
109615
|
+
if (!this.HQChart.JSToolbarTooltip) return;
|
|
109616
|
+
if (!item.Div) return;
|
|
109617
|
+
|
|
109618
|
+
var rtButton=item.Div.getBoundingClientRect();
|
|
109619
|
+
var rtHQChart=this.DivHQChart.getBoundingClientRect();
|
|
109620
|
+
var left=rtButton.left-rtHQChart.left;
|
|
109621
|
+
var top=rtButton.bottom-rtHQChart.top+2;
|
|
109622
|
+
this.HQChart.JSToolbarTooltip.Show(top, left, { Text:item.Tooltip.Text });
|
|
109623
|
+
}
|
|
109624
|
+
}
|
|
109625
|
+
|
|
109626
|
+
|
|
109627
|
+
function JSToolbarTooltip()
|
|
109628
|
+
{
|
|
109629
|
+
this.DivTooltip=null;
|
|
109630
|
+
this.DivHQChart=null;
|
|
109631
|
+
this.Text=null;
|
|
109632
|
+
this.Left=-1;
|
|
109633
|
+
this.Top=-1;
|
|
109634
|
+
|
|
109635
|
+
this.BGColor=g_JSChartResource.DivFrameToolbar.Tooltip.BGColor;
|
|
109636
|
+
this.TextColor=g_JSChartResource.DivFrameToolbar.Tooltip.TextColor;
|
|
109637
|
+
this.BorderColor=g_JSChartResource.DivFrameToolbar.Tooltip.BorderColor;
|
|
109638
|
+
|
|
109639
|
+
this.Create=function()
|
|
109640
|
+
{
|
|
109641
|
+
var divDom=document.createElement("div");
|
|
109642
|
+
divDom.className='UMyChart_Toolbar_Tooltip_Div';
|
|
109643
|
+
this.DivHQChart.appendChild(divDom);
|
|
109644
|
+
|
|
109645
|
+
this.DivTooltip=divDom;
|
|
109646
|
+
|
|
109647
|
+
this.UpdateStyle();
|
|
109648
|
+
}
|
|
109649
|
+
|
|
109650
|
+
this.ReloadResource=function(option)
|
|
109651
|
+
{
|
|
109652
|
+
this.BGColor=g_JSChartResource.DivFrameToolbar.Tooltip.BGColor;
|
|
109653
|
+
this.TextColor=g_JSChartResource.DivFrameToolbar.Tooltip.TextColor;
|
|
109654
|
+
this.BorderColor=g_JSChartResource.DivFrameToolbar.Tooltip.BorderColor;
|
|
109655
|
+
|
|
109656
|
+
this.UpdateStyle();
|
|
109657
|
+
}
|
|
109658
|
+
|
|
109659
|
+
this.UpdateStyle=function()
|
|
109660
|
+
{
|
|
109661
|
+
if (!this.DivTooltip) return;
|
|
109662
|
+
|
|
109663
|
+
this.DivTooltip.style["background-color"]=this.BGColor;
|
|
109664
|
+
this.DivTooltip.style["color"]=this.TextColor;
|
|
109665
|
+
this.DivTooltip.style["border"]="1px solid " + this.BorderColor;
|
|
109666
|
+
}
|
|
109667
|
+
|
|
109668
|
+
this.Show=function(top, left, tooltipData)
|
|
109669
|
+
{
|
|
109670
|
+
if (!this.DivTooltip) return;
|
|
109671
|
+
|
|
109672
|
+
if (this.Text!=tooltipData.Text) this.DivTooltip.innerHTML=tooltipData.Text;
|
|
109673
|
+
var right=left+this.DivTooltip.offsetWidth;
|
|
109674
|
+
if ((right+5)>=window.innerWidth) left=left-this.DivTooltip.offsetWidth;
|
|
109675
|
+
|
|
109676
|
+
if (this.Top!=top || this.Left!=left)
|
|
109677
|
+
{
|
|
109678
|
+
this.DivTooltip.style.top = top + "px";
|
|
109679
|
+
this.DivTooltip.style.left = left + "px";
|
|
109680
|
+
this.Top=top;
|
|
109681
|
+
this.Left=left;
|
|
109682
|
+
}
|
|
109683
|
+
|
|
109684
|
+
if (this.DivTooltip.style.visibility!='visible') this.DivTooltip.style.visibility='visible';
|
|
109685
|
+
}
|
|
109686
|
+
|
|
109687
|
+
this.Hide=function()
|
|
109688
|
+
{
|
|
109689
|
+
if (!this.DivTooltip) return;
|
|
109690
|
+
|
|
109691
|
+
if (this.DivTooltip.style["visibility"]!='hidden') this.DivTooltip.style["visibility"]="hidden";
|
|
109692
|
+
}
|
|
109693
|
+
}
|
|
109694
|
+
|
|
109695
|
+
|
|
109445
109696
|
|
|
109446
109697
|
|
|
109447
109698
|
|
|
@@ -136668,6 +136919,12 @@ function GetBlackStyle()
|
|
|
136668
136919
|
//Mergin:{ Left:4, Right:4, Top:2, Bottom:4 },
|
|
136669
136920
|
}
|
|
136670
136921
|
},
|
|
136922
|
+
|
|
136923
|
+
DivFrameToolbar:
|
|
136924
|
+
{
|
|
136925
|
+
Icon:{ Color:"rgb(156,156,156)", HoverColor:"rgb(255,255,255)" },
|
|
136926
|
+
Tooltip:{ BGColor:"rgb(32,32,32)", TextColor:"rgb(204,204,204)", BorderColor:"rgb(69,69,69)" },
|
|
136927
|
+
},
|
|
136671
136928
|
|
|
136672
136929
|
DrawPicture: //画图工具
|
|
136673
136930
|
{
|
|
@@ -165242,7 +165499,7 @@ function HQChartScriptWorker()
|
|
|
165242
165499
|
|
|
165243
165500
|
|
|
165244
165501
|
|
|
165245
|
-
var HQCHART_VERSION="1.1.
|
|
165502
|
+
var HQCHART_VERSION="1.1.15065";
|
|
165246
165503
|
|
|
165247
165504
|
function PrintHQChartVersion()
|
|
165248
165505
|
{
|