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
|
@@ -7470,6 +7470,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
7470
7470
|
this.DialogSearchIndex; //指标搜索
|
|
7471
7471
|
this.DialogModifyIndexParam; //指标参数修改
|
|
7472
7472
|
this.SmallFloatTooltipGroup; //小浮框tooltip信息集合
|
|
7473
|
+
this.JSToolbarTooltip; //指标标题工具栏tooltip信息
|
|
7473
7474
|
|
|
7474
7475
|
|
|
7475
7476
|
this.RestoreFocusTimer=null; //恢复焦点定时器
|
|
@@ -13932,6 +13933,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
13932
13933
|
if (overlayItem.Frame && overlayItem.Frame.ReloadResource) overlayItem.Frame.ReloadResource(resource);
|
|
13933
13934
|
}
|
|
13934
13935
|
}
|
|
13936
|
+
|
|
13937
|
+
if (this.JSToolbarTooltip) this.JSToolbarTooltip.ReloadResource(resource); //工具栏提示框
|
|
13935
13938
|
}
|
|
13936
13939
|
|
|
13937
13940
|
this.ReloadChartPaint=function(resource)
|
|
@@ -14401,6 +14404,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
14401
14404
|
if (!subFrame || !subFrame.Frame) return;
|
|
14402
14405
|
|
|
14403
14406
|
var frame=subFrame.Frame;
|
|
14407
|
+
var pixelRatio=GetDevicePixelRatio();
|
|
14404
14408
|
|
|
14405
14409
|
if (windowItem)
|
|
14406
14410
|
{
|
|
@@ -14448,6 +14452,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
14448
14452
|
}
|
|
14449
14453
|
|
|
14450
14454
|
if (IFrameSplitOperator.IsNumber(frameItem.Height) && frameItem.Height>=0) subFrame.Height = frameItem.Height;
|
|
14455
|
+
if (IFrameSplitOperator.IsNumber(frameItem.TopSpace)) frame.ChartBorder.TopSpace=frameItem.TopSpace*pixelRatio;
|
|
14456
|
+
if (IFrameSplitOperator.IsNumber(frameItem.BottomSpace)) frame.ChartBorder.BottomSpace=frameItem.BottomSpace*pixelRatio;
|
|
14451
14457
|
}
|
|
14452
14458
|
|
|
14453
14459
|
}
|
|
@@ -14457,6 +14463,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
14457
14463
|
if (!option) return;
|
|
14458
14464
|
|
|
14459
14465
|
var frame=subFrame.Frame;
|
|
14466
|
+
var pixelRatio=GetDevicePixelRatio();
|
|
14460
14467
|
|
|
14461
14468
|
if (option.Window)
|
|
14462
14469
|
{
|
|
@@ -14496,6 +14503,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
14496
14503
|
if (IFrameSplitOperator.IsBool(option.IsShowYLine)) subFrame.Frame.IsShowYLine=option.IsShowYLine;
|
|
14497
14504
|
if (IFrameSplitOperator.IsBool(option.IsShowIndexTitle)) subFrame.Frame.IsShowIndexTitle=option.IsShowIndexTitle;
|
|
14498
14505
|
if (IFrameSplitOperator.IsNumber(option.Height)) subFrame.Height=option.Height; //高度
|
|
14506
|
+
if (IFrameSplitOperator.IsNumber(option.TopSpace)) frame.ChartBorder.TopSpace=option.TopSpace*pixelRatio;
|
|
14507
|
+
if (IFrameSplitOperator.IsNumber(option.BottomSpace)) frame.ChartBorder.BottomSpace=option.BottomSpace*pixelRatio;
|
|
14499
14508
|
|
|
14500
14509
|
|
|
14501
14510
|
if (IFrameSplitOperator.IsBool(option.IsShowLeftText))
|
|
@@ -17665,6 +17674,8 @@ function AverageWidthFrame()
|
|
|
17665
17674
|
this.BeforeDrawXYCallback; //坐标绘制前回调,绘制深度图
|
|
17666
17675
|
this.GetEventCallback; //事件回调
|
|
17667
17676
|
|
|
17677
|
+
this.DivFrameToolbar;
|
|
17678
|
+
|
|
17668
17679
|
//工具栏的按钮样式
|
|
17669
17680
|
this.ToolbarButtonStyle=g_JSChartResource.ToolbarButtonStyle;
|
|
17670
17681
|
this.CloseWindowButton=CloneData(g_JSChartResource.Buttons.CloseWindow);
|
|
@@ -17714,6 +17725,8 @@ function AverageWidthFrame()
|
|
|
17714
17725
|
this.ButtonTooltip=CloneData(g_JSChartResource.Buttons.Tooltip);
|
|
17715
17726
|
this.AddIndexWindowButton=CloneData(g_JSChartResource.Buttons.AddIndexWindow);
|
|
17716
17727
|
}
|
|
17728
|
+
|
|
17729
|
+
if (this.DivFrameToolbar) this.DivFrameToolbar.ReloadResource(resource);
|
|
17717
17730
|
}
|
|
17718
17731
|
|
|
17719
17732
|
this.DrawFrame=function()
|
|
@@ -20283,7 +20296,6 @@ function AverageWidthFrame()
|
|
|
20283
20296
|
}
|
|
20284
20297
|
}
|
|
20285
20298
|
|
|
20286
|
-
|
|
20287
20299
|
if (IFrameSplitOperator.IsNumber(width.Right)) width.Right+=rightExtendWidth;
|
|
20288
20300
|
if (IFrameSplitOperator.IsNumber(width.Left)) width.Left+=this.YTextPadding[0]+leftExtendLineWidth;
|
|
20289
20301
|
if (IFrameSplitOperator.IsNumber(width.Right)) width.Right+=this.YTextPadding[1]+rightExtendLineWidth;
|
|
@@ -20291,25 +20303,34 @@ function AverageWidthFrame()
|
|
|
20291
20303
|
return { TextWidth:width };
|
|
20292
20304
|
}
|
|
20293
20305
|
|
|
20306
|
+
this.CreateDivFrameToolbar=function(hqchart, frameID, divHQChart)
|
|
20307
|
+
{
|
|
20308
|
+
if (this.ToolbarButtonStyle==1) return;
|
|
20309
|
+
if (this.DivFrameToolbar) return;
|
|
20310
|
+
|
|
20311
|
+
if (this.ClassName=="MinuteFrame" || this.ClassName=="KLineFrame")
|
|
20312
|
+
{
|
|
20313
|
+
this.DivFrameToolbar=new JSDivFrameToolbar();
|
|
20314
|
+
this.DivFrameToolbar.HQChart=hqchart;
|
|
20315
|
+
this.DivFrameToolbar.DivHQChart=divHQChart;
|
|
20316
|
+
this.DivFrameToolbar.FrameID=frameID;
|
|
20317
|
+
this.DivFrameToolbar.Create();
|
|
20318
|
+
}
|
|
20319
|
+
}
|
|
20320
|
+
|
|
20294
20321
|
this.ClearToolbar=function()
|
|
20295
20322
|
{
|
|
20296
|
-
if (!this.
|
|
20323
|
+
if (!this.DivFrameToolbar) return;
|
|
20297
20324
|
|
|
20298
|
-
|
|
20299
|
-
|
|
20300
|
-
this.ChartBorder.UIElement.parentNode.removeChild(divToolbar);
|
|
20301
|
-
this.ToolbarRect=null;
|
|
20325
|
+
this.DivFrameToolbar.Destroy();
|
|
20326
|
+
this.DivFrameToolbar=null;
|
|
20302
20327
|
}
|
|
20303
20328
|
|
|
20304
20329
|
this.HideToolbar=function()
|
|
20305
20330
|
{
|
|
20306
|
-
if (!this.
|
|
20331
|
+
if (!this.DivFrameToolbar) return;
|
|
20307
20332
|
|
|
20308
|
-
this.
|
|
20309
|
-
var divToolbar=document.getElementById(this.ToolbarID);
|
|
20310
|
-
if (!divToolbar) return;
|
|
20311
|
-
|
|
20312
|
-
if (divToolbar.style.display!='none') divToolbar.style.display='none';
|
|
20333
|
+
this.DivFrameToolbar.Hide();
|
|
20313
20334
|
}
|
|
20314
20335
|
|
|
20315
20336
|
this.GetMainOverlayFrame=function()
|
|
@@ -20347,7 +20368,6 @@ function MinuteFrame()
|
|
|
20347
20368
|
this.MultiDayBorderPen=g_JSChartResource.MultiDayBorderPen;
|
|
20348
20369
|
this.CustomHorizontalInfo=[];
|
|
20349
20370
|
this.RightFrame=null; //右侧多重坐标
|
|
20350
|
-
this.ToolbarID=Guid(); //工具条Div id
|
|
20351
20371
|
this.ReDrawToolbar=false;
|
|
20352
20372
|
this.DayCount=1; //显示天数
|
|
20353
20373
|
|
|
@@ -20360,7 +20380,6 @@ function MinuteFrame()
|
|
|
20360
20380
|
this.OverlayIndex=g_JSChartResource.MinuteToolbar.OverlayIndex; //是否显示叠加指标
|
|
20361
20381
|
this.AddIndexWindow=g_JSChartResource.MinuteToolbar.AddIndexWindow; //是否显示'增加指标窗口'菜单
|
|
20362
20382
|
|
|
20363
|
-
this.ToolbarRect=null; //保存工具条的位置
|
|
20364
20383
|
this.IsShowPositionTitle=false; //是否显示持仓标题
|
|
20365
20384
|
|
|
20366
20385
|
this.LastCalculateStatus={ Width:0, XPointCount:0 }; //最后一次计算宽度的状态
|
|
@@ -20492,112 +20511,8 @@ function MinuteFrame()
|
|
|
20492
20511
|
if (this.ToolbarButtonStyle==1) return;
|
|
20493
20512
|
if (g_JSChartResource.IsDOMFrameToolbar===true) return;
|
|
20494
20513
|
|
|
20495
|
-
if (
|
|
20496
|
-
|
|
20497
|
-
if (this.Identify<2) return;
|
|
20498
|
-
if (!this.ChartBorder.UIElement) return;
|
|
20499
|
-
|
|
20500
|
-
var divToolbar=document.getElementById(this.ToolbarID);
|
|
20501
|
-
if (divToolbar && this.SizeChange==false && this.ReDrawToolbar==false) return;
|
|
20502
|
-
|
|
20503
|
-
if (!divToolbar)
|
|
20504
|
-
{
|
|
20505
|
-
divToolbar=document.createElement("div");
|
|
20506
|
-
divToolbar.className='klineframe-toolbar';
|
|
20507
|
-
divToolbar.id=this.ToolbarID;
|
|
20508
|
-
divToolbar.oncontextmenu = function() { return false;}; //屏蔽右键系统菜单
|
|
20509
|
-
//为divToolbar添加属性identify
|
|
20510
|
-
divToolbar.setAttribute("identify",this.Identify.toString());
|
|
20511
|
-
this.ChartBorder.UIElement.parentNode.appendChild(divToolbar);
|
|
20512
|
-
}
|
|
20513
|
-
|
|
20514
|
-
if (!this.ModifyIndex && !this.ChangeIndex && !this.OverlayIndex && !this.CloseIndex)
|
|
20515
|
-
{
|
|
20516
|
-
if (divToolbar.style.display!='none')
|
|
20517
|
-
divToolbar.style.display='none';
|
|
20518
|
-
return;
|
|
20519
|
-
}
|
|
20520
|
-
|
|
20521
|
-
//使用外城div尺寸 画图尺寸是被放大的
|
|
20522
|
-
var pixelTatio = GetDevicePixelRatio();
|
|
20523
|
-
var chartWidth=parseInt(this.ChartBorder.UIElement.parentElement.style.width.replace("px",""));
|
|
20524
|
-
var chartHeight=parseInt(this.ChartBorder.UIElement.parentElement.style.height.replace("px",""));
|
|
20525
|
-
//JSConsole.Chart.Log('[KLineFrame::DrawToolbar] ',chartWidth,chartHeight,pixelTatio);
|
|
20526
|
-
|
|
20527
|
-
var toolbarWidth=100;
|
|
20528
|
-
var toolbarHeight=this.ChartBorder.GetTitleHeight();
|
|
20529
|
-
var left=chartWidth-(this.ChartBorder.Right/pixelTatio)-toolbarWidth;
|
|
20530
|
-
var top=this.ChartBorder.GetTop()/pixelTatio;
|
|
20531
|
-
|
|
20532
|
-
if (this.ToolbarRect)
|
|
20533
|
-
{
|
|
20534
|
-
//尺寸变动移动才重新设置DOM
|
|
20535
|
-
if (this.ToolbarRect.Left==left && this.ToolbarRect.Top==top &&
|
|
20536
|
-
this.ToolbarRect.Width==toolbarWidth && this.ToolbarRect.Height==toolbarHeight/pixelTatio)
|
|
20537
|
-
{
|
|
20538
|
-
return;
|
|
20539
|
-
}
|
|
20540
|
-
}
|
|
20541
|
-
|
|
20542
|
-
this.ToolbarRect={ Left:left, Top:top, Width:toolbarWidth, Height:toolbarHeight/pixelTatio };
|
|
20543
|
-
|
|
20544
|
-
const modifyButton=`<span class='index_param icon iconfont icon-index_param' id='modifyindex' style='cursor:pointer;margin-left:2px;margin-right:2px;' title='调整指标参数'></span>`;
|
|
20545
|
-
const changeButton=`<span class='index_change icon iconfont icon-change_index' id='changeindex' style='cursor:pointer;margin-left:2px;margin-right:2px;' title='切换指标'></span>`;
|
|
20546
|
-
const closeButton=`<span class='index_close icon iconfont icon-close' id='closeindex' style='cursor:pointer;margin-left:2px;margin-right:2px;' title='关闭指标窗口'></span>`;
|
|
20547
|
-
|
|
20548
|
-
var spanIcon=modifyButton+changeButton;
|
|
20549
|
-
if (this.CloseIndex)
|
|
20550
|
-
{
|
|
20551
|
-
spanIcon+=closeButton;
|
|
20552
|
-
}
|
|
20553
|
-
|
|
20554
|
-
//var scrollPos=GetScrollPosition();
|
|
20555
|
-
//left = left+scrollPos.Left;
|
|
20556
|
-
//top = top+scrollPos.Top;
|
|
20557
|
-
divToolbar.style.left = left + "px";
|
|
20558
|
-
divToolbar.style.top = top + "px";
|
|
20559
|
-
divToolbar.style.width=toolbarWidth+"px"; //宽度先不调整吧
|
|
20560
|
-
divToolbar.style.height=(toolbarHeight/pixelTatio)+'px'; //只调整高度
|
|
20561
|
-
divToolbar.innerHTML=spanIcon;
|
|
20562
|
-
|
|
20563
|
-
var chart=this.ChartBorder.UIElement.JSChartContainer;
|
|
20564
|
-
var identify=this.Identify;
|
|
20565
|
-
if (!this.ModifyIndex) //隐藏'改参数'
|
|
20566
|
-
$("#"+divToolbar.id+" .index_param").hide();
|
|
20567
|
-
else if (typeof(this.ModifyIndexEvent)=='function') //绑定点击事件
|
|
20568
|
-
$("#"+divToolbar.id+" .index_param").click(
|
|
20569
|
-
{
|
|
20570
|
-
Chart:this.ChartBorder.UIElement.JSChartContainer,
|
|
20571
|
-
Identify:this.Identify
|
|
20572
|
-
},this.ModifyIndexEvent);
|
|
20573
|
-
|
|
20574
|
-
if (!this.ChangeIndex) //隐藏'换指标'
|
|
20575
|
-
{
|
|
20576
|
-
$("#"+divToolbar.id+" .index_change").hide();
|
|
20577
|
-
}
|
|
20578
|
-
else if (typeof(this.ChangeIndexEvent)=='function')
|
|
20579
|
-
{
|
|
20580
|
-
$("#"+divToolbar.id+" .index_change").click(
|
|
20581
|
-
{
|
|
20582
|
-
Chart:this.ChartBorder.UIElement.JSChartContainer,
|
|
20583
|
-
Identify:this.Identify,
|
|
20584
|
-
IsOverlay:false
|
|
20585
|
-
},this.ChangeIndexEvent);
|
|
20586
|
-
}
|
|
20587
|
-
|
|
20588
|
-
$("#"+divToolbar.id+" .index_close").click(
|
|
20589
|
-
{
|
|
20590
|
-
Chart:this.ChartBorder.UIElement.JSChartContainer,
|
|
20591
|
-
Identify:this.Identify
|
|
20592
|
-
},
|
|
20593
|
-
function(event)
|
|
20594
|
-
{
|
|
20595
|
-
var hqChart=event.data.Chart;
|
|
20596
|
-
var id=event.data.Identify;
|
|
20597
|
-
hqChart.RemoveIndexWindow(id);
|
|
20598
|
-
});
|
|
20599
|
-
|
|
20600
|
-
divToolbar.style.display = "block";
|
|
20514
|
+
if (!this.DivFrameToolbar) return;
|
|
20515
|
+
this.DivFrameToolbar.Show(this.Identify);
|
|
20601
20516
|
}
|
|
20602
20517
|
|
|
20603
20518
|
//手绘,不用DOM,使用DOM太麻烦了
|
|
@@ -22779,7 +22694,6 @@ function KLineFrame()
|
|
|
22779
22694
|
delete this.newMethod;
|
|
22780
22695
|
|
|
22781
22696
|
this.ClassName='KLineFrame';
|
|
22782
|
-
this.ToolbarID=Guid(); //工具条Div id
|
|
22783
22697
|
|
|
22784
22698
|
this.ModifyIndex=g_JSChartResource.KLineToolbar.ModifyIndex; //是否显示'改参数'菜单
|
|
22785
22699
|
this.ChangeIndex=g_JSChartResource.KLineToolbar.ChangeIndex; //是否显示'换指标'菜单
|
|
@@ -22792,7 +22706,6 @@ function KLineFrame()
|
|
|
22792
22706
|
|
|
22793
22707
|
this.SelBorderColor=g_JSChartResource.SelFrameBorderColor;
|
|
22794
22708
|
|
|
22795
|
-
this.ToolbarRect=null; //保存工具条的位置
|
|
22796
22709
|
this.ReDrawToolbar=false;
|
|
22797
22710
|
|
|
22798
22711
|
this.LastCalculateStatus={ Width:0, XPointCount:0 }; //最后一次计算宽度的状态
|
|
@@ -22816,6 +22729,11 @@ function KLineFrame()
|
|
|
22816
22729
|
{
|
|
22817
22730
|
if (this.ToolbarButtonStyle==1) return;
|
|
22818
22731
|
if (g_JSChartResource.IsDOMFrameToolbar===true) return;
|
|
22732
|
+
if (!this.DivFrameToolbar) return;
|
|
22733
|
+
|
|
22734
|
+
this.DivFrameToolbar.Show(this.Identify);
|
|
22735
|
+
|
|
22736
|
+
return;
|
|
22819
22737
|
|
|
22820
22738
|
if (typeof($)=="undefined") return;
|
|
22821
22739
|
|
|
@@ -57237,6 +57155,10 @@ function KLineCountDownPaint()
|
|
|
57237
57155
|
this.CanvasEx.fillStyle=out.BGColor;
|
|
57238
57156
|
this.CanvasEx.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);
|
|
57239
57157
|
}
|
|
57158
|
+
else
|
|
57159
|
+
{
|
|
57160
|
+
return;
|
|
57161
|
+
}
|
|
57240
57162
|
|
|
57241
57163
|
this.Canvas.textAlign = "left";
|
|
57242
57164
|
this.Canvas.textBaseline = "bottom";
|
|
@@ -81570,6 +81492,12 @@ function JSChartResource()
|
|
|
81570
81492
|
Mergin:{ Left:4, Right:4, Top:2, Bottom:3 },
|
|
81571
81493
|
}
|
|
81572
81494
|
}
|
|
81495
|
+
|
|
81496
|
+
this.DivFrameToolbar=
|
|
81497
|
+
{
|
|
81498
|
+
Icon:{ Color:"rgb(0,0,0)", HoverColor:"rgb(30,144,255)" },
|
|
81499
|
+
Tooltip:{ BGColor:"rgb(255,255,255)", TextColor:"rgb(71,71,71)", BorderColor:"rgb(0,0,0)" },
|
|
81500
|
+
}
|
|
81573
81501
|
|
|
81574
81502
|
//画图工具
|
|
81575
81503
|
this.DrawPicture=
|
|
@@ -83548,6 +83476,29 @@ function JSChartResource()
|
|
|
83548
83476
|
if (style.KLineCountDownPaint) this.SetKLineCountDownPaint(style.KLineCountDownPaint);
|
|
83549
83477
|
|
|
83550
83478
|
if (style.SmallFloatTooltipV2) this.SetSmallFloatTooltipV2(style.SmallFloatTooltipV2);
|
|
83479
|
+
|
|
83480
|
+
if (style.DivFrameToolbar) this.SetDivFrameToolbar(style.DivFrameToolbar);
|
|
83481
|
+
}
|
|
83482
|
+
|
|
83483
|
+
this.SetDivFrameToolbar=function(style)
|
|
83484
|
+
{
|
|
83485
|
+
var dest=this.DivFrameToolbar;
|
|
83486
|
+
if (style.Icon)
|
|
83487
|
+
{
|
|
83488
|
+
var item=style.Icon;
|
|
83489
|
+
var subDest=dest.Icon;
|
|
83490
|
+
if (item.Color) subDest.Color=item.Color;
|
|
83491
|
+
if (item.HoverColor) subDest.HoverColor=item.HoverColor;
|
|
83492
|
+
}
|
|
83493
|
+
|
|
83494
|
+
if (style.Tooltip)
|
|
83495
|
+
{
|
|
83496
|
+
var item=style.Tooltip;
|
|
83497
|
+
var subDest=dest.Tooltip;
|
|
83498
|
+
if (item.TextColor) subDest.TextColor=item.TextColor;
|
|
83499
|
+
if (item.BorderColor) subDest.BorderColor=item.BorderColor;
|
|
83500
|
+
if (item.BGColor) subDest.BGColor=item.BGColor;
|
|
83501
|
+
}
|
|
83551
83502
|
}
|
|
83552
83503
|
|
|
83553
83504
|
this.SetSmallFloatTooltipV2=function(style)
|
|
@@ -86884,6 +86835,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
86884
86835
|
frame.RightSpaceCount=this.RightSpaceCount; //右边
|
|
86885
86836
|
frame.GetEventCallback=(id)=> { return this.GetEventCallback(id); };
|
|
86886
86837
|
frame.GlobalOption=this.GlobalOption;
|
|
86838
|
+
frame.CreateDivFrameToolbar(this, i, this.UIElement.parentNode);
|
|
86887
86839
|
|
|
86888
86840
|
frame.HorizontalMax=20;
|
|
86889
86841
|
frame.HorizontalMin=10;
|
|
@@ -86984,6 +86936,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
86984
86936
|
frame.YSplitOperator.HQChart=this;
|
|
86985
86937
|
frame.XSplitOperator.Symbol=this.Symbol;
|
|
86986
86938
|
frame.XSplitOperator.Period=this.Period;
|
|
86939
|
+
frame.CreateDivFrameToolbar(this, id, this.UIElement.parentNode);
|
|
86987
86940
|
|
|
86988
86941
|
//K线数据绑定
|
|
86989
86942
|
var xPointCouont=this.Frame.SubFrame[0].Frame.XPointCount;
|
|
@@ -89574,7 +89527,6 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
89574
89527
|
if (bChanged)
|
|
89575
89528
|
{
|
|
89576
89529
|
frame.SizeChange=true;
|
|
89577
|
-
frame.ToolbarRect=null; //清空工具栏缓存
|
|
89578
89530
|
frame.DrawToolbar();
|
|
89579
89531
|
}
|
|
89580
89532
|
}
|
|
@@ -96545,7 +96497,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
96545
96497
|
|
|
96546
96498
|
if (i>=2)
|
|
96547
96499
|
{
|
|
96548
|
-
|
|
96500
|
+
frame.CreateDivFrameToolbar(this, i, this.UIElement.parentNode);
|
|
96549
96501
|
}
|
|
96550
96502
|
|
|
96551
96503
|
var DEFAULT_HORIZONTAL=[9,8,7,6,5,4,3,2,1];
|
|
@@ -96652,6 +96604,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
96652
96604
|
frame.XSplitOperator.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
96653
96605
|
frame.YSplitOperator.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
96654
96606
|
frame.XSplitOperator.Symbol=this.Symbol;
|
|
96607
|
+
frame.CreateDivFrameToolbar(this, id, this.UIElement.parentNode);
|
|
96655
96608
|
|
|
96656
96609
|
if (this.DayCount>1)
|
|
96657
96610
|
{
|
|
@@ -109398,6 +109351,304 @@ Path2DHelper.PtInRect=function(x, y, rect)
|
|
|
109398
109351
|
}
|
|
109399
109352
|
|
|
109400
109353
|
|
|
109354
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
109355
|
+
// 指标窗口顶部工具条
|
|
109356
|
+
//
|
|
109357
|
+
//
|
|
109358
|
+
///////////////////////////////////////////////////////////////////////////////////
|
|
109359
|
+
|
|
109360
|
+
|
|
109361
|
+
function JSDivFrameToolbar()
|
|
109362
|
+
{
|
|
109363
|
+
this.DivToolbar=null;
|
|
109364
|
+
this.DivHQChart=null;
|
|
109365
|
+
this.HQChart=null;
|
|
109366
|
+
this.FrameID=-1; //指标窗口ID
|
|
109367
|
+
this.ID=Guid();
|
|
109368
|
+
this.Left=-1;
|
|
109369
|
+
this.Top=-1;
|
|
109370
|
+
|
|
109371
|
+
this.IconConfig=
|
|
109372
|
+
{
|
|
109373
|
+
Color:g_JSChartResource.DivFrameToolbar.Icon.Color,
|
|
109374
|
+
HoverColor:g_JSChartResource.DivFrameToolbar.Icon.HoverColor
|
|
109375
|
+
}
|
|
109376
|
+
|
|
109377
|
+
this.AryButton=
|
|
109378
|
+
[
|
|
109379
|
+
{
|
|
109380
|
+
ID:JSCHART_BUTTON_ID.MODIFY_INDEX_PARAM, ClassName:"UMyChart_FrameToolbar_Span_Button icon iconfont icon-index_param", Tooltip:{ Text:"修改参数"},
|
|
109381
|
+
Span:null, Div:null, TooltipSpan:null
|
|
109382
|
+
},
|
|
109383
|
+
{
|
|
109384
|
+
ID:JSCHART_BUTTON_ID.CHANGE_INDEX, ClassName:"UMyChart_FrameToolbar_Span_Button icon iconfont icon-change_index", Tooltip:{ Text:"切换指标"},
|
|
109385
|
+
Span:null,Div:null, TooltipSpan:null
|
|
109386
|
+
},
|
|
109387
|
+
{
|
|
109388
|
+
ID:JSCHART_BUTTON_ID.OVERLAY_INDEX, ClassName:"UMyChart_FrameToolbar_Span_Button icon iconfont icon-overlay_index", Tooltip:{ Text:"叠加指标"},
|
|
109389
|
+
Span:null,Div:null, TooltipSpan:null
|
|
109390
|
+
},
|
|
109391
|
+
{
|
|
109392
|
+
ID:JSCHART_BUTTON_ID.CLOSE_INDEX_WINDOW, ClassName:"UMyChart_FrameToolbar_Span_Button icon iconfont icon-close", Tooltip:{ Text:"关闭窗口"},
|
|
109393
|
+
Span:null,Div:null, TooltipSpan:null
|
|
109394
|
+
},
|
|
109395
|
+
];
|
|
109396
|
+
|
|
109397
|
+
this.SetToolbar=function(aryButton)
|
|
109398
|
+
{
|
|
109399
|
+
//清空原来的按钮
|
|
109400
|
+
for(var i=0; i<this.AryButton.length; i++)
|
|
109401
|
+
{
|
|
109402
|
+
var item=this.AryButton[i];
|
|
109403
|
+
if (item.Div && this.DivToolbar) this.DivToolbar.removeChild(item.Div);
|
|
109404
|
+
item.Div=null;
|
|
109405
|
+
item.Span=null;
|
|
109406
|
+
item.TooltipSpan=null;
|
|
109407
|
+
}
|
|
109408
|
+
this.AryButton=[];
|
|
109409
|
+
|
|
109410
|
+
//重新创建
|
|
109411
|
+
for(var i=0;i<aryButton.length; i++)
|
|
109412
|
+
{
|
|
109413
|
+
var item=aryButton[i];
|
|
109414
|
+
if (!item.ID || !item.ClassName) continue;
|
|
109415
|
+
var newItem={ ID:item.ID, ClassName:item.ClassName, Span:null,Div:null, TooltipSpan:null };
|
|
109416
|
+
if (item.Tooltip && item.Tooltip.Text) newItem.Tooltip={ Text:item.Tooltip.Text };
|
|
109417
|
+
|
|
109418
|
+
this.AryButton.push(newItem);
|
|
109419
|
+
|
|
109420
|
+
if (this.DivToolbar) this.CreateButton(newItem, this.DivToolbar);
|
|
109421
|
+
}
|
|
109422
|
+
|
|
109423
|
+
this.UpdateStyle();
|
|
109424
|
+
}
|
|
109425
|
+
|
|
109426
|
+
this.Destroy=function()
|
|
109427
|
+
{
|
|
109428
|
+
if (this.DivToolbar)
|
|
109429
|
+
{
|
|
109430
|
+
if (this.DivHQChart.removeChild) this.DivHQChart.removeChild(this.DivToolbar);
|
|
109431
|
+
this.DivToolbar=null;
|
|
109432
|
+
}
|
|
109433
|
+
|
|
109434
|
+
this.HQChart=null;
|
|
109435
|
+
this.DivHQChart=null;
|
|
109436
|
+
this.FrameID=-1;
|
|
109437
|
+
}
|
|
109438
|
+
|
|
109439
|
+
this.Create=function()
|
|
109440
|
+
{
|
|
109441
|
+
var divToolbar=document.createElement("div");
|
|
109442
|
+
divToolbar.className='UMyChart_FrameToolbar_Div';
|
|
109443
|
+
divToolbar.id=this.ID;
|
|
109444
|
+
divToolbar.oncontextmenu = function() { return false; }; //屏蔽右键系统菜单
|
|
109445
|
+
|
|
109446
|
+
for(var i=0;i<this.AryButton.length; i++)
|
|
109447
|
+
{
|
|
109448
|
+
var item=this.AryButton[i];
|
|
109449
|
+
if (this.FrameID==0 && item.ID==JSCHART_BUTTON_ID.CLOSE_INDEX_WINDOW) continue; //第一个指标窗口不显示关闭按钮
|
|
109450
|
+
this.CreateButton(item, divToolbar);
|
|
109451
|
+
}
|
|
109452
|
+
|
|
109453
|
+
this.DivHQChart.appendChild(divToolbar);
|
|
109454
|
+
|
|
109455
|
+
this.DivToolbar=divToolbar;
|
|
109456
|
+
|
|
109457
|
+
this.UpdateStyle();
|
|
109458
|
+
|
|
109459
|
+
if (!this.HQChart.JSToolbarTooltip)
|
|
109460
|
+
{
|
|
109461
|
+
this.HQChart.JSToolbarTooltip=new JSToolbarTooltip();
|
|
109462
|
+
this.HQChart.JSToolbarTooltip.DivHQChart=this.DivHQChart;
|
|
109463
|
+
this.HQChart.JSToolbarTooltip.Create();
|
|
109464
|
+
}
|
|
109465
|
+
}
|
|
109466
|
+
|
|
109467
|
+
this.UpdateStyle=function()
|
|
109468
|
+
{
|
|
109469
|
+
if (!this.DivToolbar) return;
|
|
109470
|
+
|
|
109471
|
+
for(var i=0;i<this.AryButton.length; i++)
|
|
109472
|
+
{
|
|
109473
|
+
var item=this.AryButton[i]
|
|
109474
|
+
if (!item.Span) continue;
|
|
109475
|
+
item.Span.style["color"]=this.IconConfig.Color;
|
|
109476
|
+
}
|
|
109477
|
+
}
|
|
109478
|
+
|
|
109479
|
+
this.ReloadResource=function(option)
|
|
109480
|
+
{
|
|
109481
|
+
this.IconConfig.Color=g_JSChartResource.DivFrameToolbar.Icon.Color,
|
|
109482
|
+
this.IconConfig.HoverColor=g_JSChartResource.DivFrameToolbar.Icon.HoverColor;
|
|
109483
|
+
|
|
109484
|
+
this.UpdateStyle();
|
|
109485
|
+
}
|
|
109486
|
+
|
|
109487
|
+
this.CreateButton=function(item, divDom)
|
|
109488
|
+
{
|
|
109489
|
+
var btnDiv=document.createElement("div");
|
|
109490
|
+
btnDiv.className="UMyChart_FrameToolbar_Div_Button";
|
|
109491
|
+
btnDiv.onmouseover=(e)=> { this.OnHoverButton(e, item); }
|
|
109492
|
+
btnDiv.onmouseout=(e)=>{ this.OnLeaveButton(e, item); }
|
|
109493
|
+
item.Div=btnDiv;
|
|
109494
|
+
|
|
109495
|
+
var spanDom=document.createElement("span");
|
|
109496
|
+
spanDom.className=item.ClassName;
|
|
109497
|
+
spanDom.onmousedown=(e)=>{ this.OnClickButton(e, item); };
|
|
109498
|
+
item.Span=spanDom;
|
|
109499
|
+
btnDiv.appendChild(spanDom);
|
|
109500
|
+
|
|
109501
|
+
divDom.appendChild(btnDiv);
|
|
109502
|
+
}
|
|
109503
|
+
|
|
109504
|
+
this.OnClickButton=function(e, item)
|
|
109505
|
+
{
|
|
109506
|
+
if (!this.FrameID<0) return;
|
|
109507
|
+
if (!this.HQChart) return;
|
|
109508
|
+
|
|
109509
|
+
var frame=this.HQChart.Frame.SubFrame[this.FrameID].Frame;
|
|
109510
|
+
|
|
109511
|
+
var button={ ID:item.ID, Frame:frame };
|
|
109512
|
+
this.HQChart.ClickFrameButton(button, e);
|
|
109513
|
+
}
|
|
109514
|
+
|
|
109515
|
+
this.OnHoverButton=function(e, item)
|
|
109516
|
+
{
|
|
109517
|
+
if (!item.Span) return;
|
|
109518
|
+
|
|
109519
|
+
item.Span.style["color"]=this.IconConfig.HoverColor;
|
|
109520
|
+
|
|
109521
|
+
this.ShowTooltip(e, item);
|
|
109522
|
+
}
|
|
109523
|
+
|
|
109524
|
+
this.OnLeaveButton=function(e, item)
|
|
109525
|
+
{
|
|
109526
|
+
if (!item.Span) return;
|
|
109527
|
+
item.Span.style["color"]=this.IconConfig.Color;
|
|
109528
|
+
|
|
109529
|
+
this.HideTooltip();
|
|
109530
|
+
}
|
|
109531
|
+
|
|
109532
|
+
this.Show=function(frameID)
|
|
109533
|
+
{
|
|
109534
|
+
this.FrameID=frameID;
|
|
109535
|
+
if (!this.FrameID<0) return;
|
|
109536
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(this.HQChart.Frame.SubFrame)) return;
|
|
109537
|
+
if (!this.HQChart.Frame.SubFrame[this.FrameID]) return;
|
|
109538
|
+
|
|
109539
|
+
var pixelTatio = GetDevicePixelRatio();
|
|
109540
|
+
var frame=this.HQChart.Frame.SubFrame[this.FrameID].Frame;
|
|
109541
|
+
var border=frame.GetBorder();
|
|
109542
|
+
|
|
109543
|
+
var top=border.Top/pixelTatio;
|
|
109544
|
+
var right=border.RightEx/pixelTatio;
|
|
109545
|
+
var left=right-this.DivToolbar.offsetWidth-2;
|
|
109546
|
+
|
|
109547
|
+
if (this.Top!=top || this.Left!=left)
|
|
109548
|
+
{
|
|
109549
|
+
this.DivToolbar.style.top = top + "px";
|
|
109550
|
+
this.DivToolbar.style.left = left + "px";
|
|
109551
|
+
this.DivToolbar.style.height=frame.ChartBorder.TitleHeight/pixelTatio + "px";
|
|
109552
|
+
this.Top=top;
|
|
109553
|
+
this.Left=left;
|
|
109554
|
+
}
|
|
109555
|
+
|
|
109556
|
+
if (this.DivToolbar.style.visibility!='visible') this.DivToolbar.style.visibility='visible';
|
|
109557
|
+
}
|
|
109558
|
+
|
|
109559
|
+
this.Hide=function()
|
|
109560
|
+
{
|
|
109561
|
+
if (this.DivToolbar) this.DivToolbar.style.visibility="hidden";
|
|
109562
|
+
}
|
|
109563
|
+
|
|
109564
|
+
this.HideTooltip=function()
|
|
109565
|
+
{
|
|
109566
|
+
if (this.HQChart.JSToolbarTooltip) this.HQChart.JSToolbarTooltip.Hide();
|
|
109567
|
+
}
|
|
109568
|
+
|
|
109569
|
+
this.ShowTooltip=function(e, item)
|
|
109570
|
+
{
|
|
109571
|
+
if (!this.HQChart.JSToolbarTooltip) return;
|
|
109572
|
+
if (!item.Div) return;
|
|
109573
|
+
|
|
109574
|
+
var rtButton=item.Div.getBoundingClientRect();
|
|
109575
|
+
var rtHQChart=this.DivHQChart.getBoundingClientRect();
|
|
109576
|
+
var left=rtButton.left-rtHQChart.left;
|
|
109577
|
+
var top=rtButton.bottom-rtHQChart.top+2;
|
|
109578
|
+
this.HQChart.JSToolbarTooltip.Show(top, left, { Text:item.Tooltip.Text });
|
|
109579
|
+
}
|
|
109580
|
+
}
|
|
109581
|
+
|
|
109582
|
+
|
|
109583
|
+
function JSToolbarTooltip()
|
|
109584
|
+
{
|
|
109585
|
+
this.DivTooltip=null;
|
|
109586
|
+
this.DivHQChart=null;
|
|
109587
|
+
this.Text=null;
|
|
109588
|
+
this.Left=-1;
|
|
109589
|
+
this.Top=-1;
|
|
109590
|
+
|
|
109591
|
+
this.BGColor=g_JSChartResource.DivFrameToolbar.Tooltip.BGColor;
|
|
109592
|
+
this.TextColor=g_JSChartResource.DivFrameToolbar.Tooltip.TextColor;
|
|
109593
|
+
this.BorderColor=g_JSChartResource.DivFrameToolbar.Tooltip.BorderColor;
|
|
109594
|
+
|
|
109595
|
+
this.Create=function()
|
|
109596
|
+
{
|
|
109597
|
+
var divDom=document.createElement("div");
|
|
109598
|
+
divDom.className='UMyChart_Toolbar_Tooltip_Div';
|
|
109599
|
+
this.DivHQChart.appendChild(divDom);
|
|
109600
|
+
|
|
109601
|
+
this.DivTooltip=divDom;
|
|
109602
|
+
|
|
109603
|
+
this.UpdateStyle();
|
|
109604
|
+
}
|
|
109605
|
+
|
|
109606
|
+
this.ReloadResource=function(option)
|
|
109607
|
+
{
|
|
109608
|
+
this.BGColor=g_JSChartResource.DivFrameToolbar.Tooltip.BGColor;
|
|
109609
|
+
this.TextColor=g_JSChartResource.DivFrameToolbar.Tooltip.TextColor;
|
|
109610
|
+
this.BorderColor=g_JSChartResource.DivFrameToolbar.Tooltip.BorderColor;
|
|
109611
|
+
|
|
109612
|
+
this.UpdateStyle();
|
|
109613
|
+
}
|
|
109614
|
+
|
|
109615
|
+
this.UpdateStyle=function()
|
|
109616
|
+
{
|
|
109617
|
+
if (!this.DivTooltip) return;
|
|
109618
|
+
|
|
109619
|
+
this.DivTooltip.style["background-color"]=this.BGColor;
|
|
109620
|
+
this.DivTooltip.style["color"]=this.TextColor;
|
|
109621
|
+
this.DivTooltip.style["border"]="1px solid " + this.BorderColor;
|
|
109622
|
+
}
|
|
109623
|
+
|
|
109624
|
+
this.Show=function(top, left, tooltipData)
|
|
109625
|
+
{
|
|
109626
|
+
if (!this.DivTooltip) return;
|
|
109627
|
+
|
|
109628
|
+
if (this.Text!=tooltipData.Text) this.DivTooltip.innerHTML=tooltipData.Text;
|
|
109629
|
+
var right=left+this.DivTooltip.offsetWidth;
|
|
109630
|
+
if ((right+5)>=window.innerWidth) left=left-this.DivTooltip.offsetWidth;
|
|
109631
|
+
|
|
109632
|
+
if (this.Top!=top || this.Left!=left)
|
|
109633
|
+
{
|
|
109634
|
+
this.DivTooltip.style.top = top + "px";
|
|
109635
|
+
this.DivTooltip.style.left = left + "px";
|
|
109636
|
+
this.Top=top;
|
|
109637
|
+
this.Left=left;
|
|
109638
|
+
}
|
|
109639
|
+
|
|
109640
|
+
if (this.DivTooltip.style.visibility!='visible') this.DivTooltip.style.visibility='visible';
|
|
109641
|
+
}
|
|
109642
|
+
|
|
109643
|
+
this.Hide=function()
|
|
109644
|
+
{
|
|
109645
|
+
if (!this.DivTooltip) return;
|
|
109646
|
+
|
|
109647
|
+
if (this.DivTooltip.style["visibility"]!='hidden') this.DivTooltip.style["visibility"]="hidden";
|
|
109648
|
+
}
|
|
109649
|
+
}
|
|
109650
|
+
|
|
109651
|
+
|
|
109401
109652
|
|
|
109402
109653
|
|
|
109403
109654
|
|
|
@@ -136624,6 +136875,12 @@ function GetBlackStyle()
|
|
|
136624
136875
|
//Mergin:{ Left:4, Right:4, Top:2, Bottom:4 },
|
|
136625
136876
|
}
|
|
136626
136877
|
},
|
|
136878
|
+
|
|
136879
|
+
DivFrameToolbar:
|
|
136880
|
+
{
|
|
136881
|
+
Icon:{ Color:"rgb(156,156,156)", HoverColor:"rgb(255,255,255)" },
|
|
136882
|
+
Tooltip:{ BGColor:"rgb(32,32,32)", TextColor:"rgb(204,204,204)", BorderColor:"rgb(69,69,69)" },
|
|
136883
|
+
},
|
|
136627
136884
|
|
|
136628
136885
|
DrawPicture: //画图工具
|
|
136629
136886
|
{
|
|
@@ -153362,7 +153619,7 @@ function ScrollBarBGChart()
|
|
|
153362
153619
|
|
|
153363
153620
|
|
|
153364
153621
|
|
|
153365
|
-
var HQCHART_VERSION="1.1.
|
|
153622
|
+
var HQCHART_VERSION="1.1.15065";
|
|
153366
153623
|
|
|
153367
153624
|
function PrintHQChartVersion()
|
|
153368
153625
|
{
|