hqchart 1.1.15106 → 1.1.15111
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 +342 -326
- package/package.json +1 -1
- package/src/jscommon/umychart.DialogSearchIndex.js +46 -5
- package/src/jscommon/umychart.complier.js +25 -13
- package/src/jscommon/umychart.js +250 -147
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +276 -161
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.vue.js +322 -166
package/src/jscommon/umychart.js
CHANGED
|
@@ -2219,12 +2219,12 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
2219
2219
|
}
|
|
2220
2220
|
|
|
2221
2221
|
//锁指标
|
|
2222
|
-
this.
|
|
2222
|
+
this.EnableLockIndex=function(aryData)
|
|
2223
2223
|
{
|
|
2224
|
-
if(this.JSChartContainer && typeof(this.JSChartContainer.
|
|
2224
|
+
if(this.JSChartContainer && typeof(this.JSChartContainer.EnableLockIndex)=='function')
|
|
2225
2225
|
{
|
|
2226
|
-
JSConsole.Chart.Log('[JSChart:
|
|
2227
|
-
this.JSChartContainer.
|
|
2226
|
+
JSConsole.Chart.Log('[JSChart:EnableLockIndex] aryData', aryData);
|
|
2227
|
+
this.JSChartContainer.EnableLockIndex(lockData);
|
|
2228
2228
|
}
|
|
2229
2229
|
}
|
|
2230
2230
|
|
|
@@ -12508,6 +12508,55 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
12508
12508
|
if (!this.PressKeyboardConfig) return false;
|
|
12509
12509
|
if (!this.PressKeyboardConfig.PauseUpdate) return false;
|
|
12510
12510
|
|
|
12511
|
+
return true;
|
|
12512
|
+
},
|
|
12513
|
+
|
|
12514
|
+
//启动|关闭锁指标 aryIndex=[{ IndexID:指标ID, LockData:{IsLocked:} } ]
|
|
12515
|
+
this.EnableLockIndex=function(aryIndex)
|
|
12516
|
+
{
|
|
12517
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(aryIndex)) return false;
|
|
12518
|
+
|
|
12519
|
+
var mapIndex=new Map();
|
|
12520
|
+
for(var i=0;i<aryIndex.length;++i)
|
|
12521
|
+
{
|
|
12522
|
+
var item=aryIndex[i];
|
|
12523
|
+
if (item.IndexID && item.LockData) mapIndex.set(item.IndexID, item);
|
|
12524
|
+
}
|
|
12525
|
+
|
|
12526
|
+
var aryUpdate=[];
|
|
12527
|
+
for(var i=0; i<this.WindowIndex.length; ++i)
|
|
12528
|
+
{
|
|
12529
|
+
var item=this.WindowIndex[i];
|
|
12530
|
+
if (!item) continue;
|
|
12531
|
+
if (mapIndex.has(item.ID))
|
|
12532
|
+
{
|
|
12533
|
+
var mapItem=mapIndex.get(item.ID);
|
|
12534
|
+
item.SetLock(mapItem.LockData); //设置锁
|
|
12535
|
+
aryUpdate.push({ ID:i});
|
|
12536
|
+
}
|
|
12537
|
+
}
|
|
12538
|
+
|
|
12539
|
+
for(var i=0; i<this.Frame.SubFrame.length; ++i)
|
|
12540
|
+
{
|
|
12541
|
+
var item=this.Frame.SubFrame[i];
|
|
12542
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(item.OverlayIndex)) continue;
|
|
12543
|
+
|
|
12544
|
+
for(var j=0; j<item.OverlayIndex.length; ++j)
|
|
12545
|
+
{
|
|
12546
|
+
var overlayItem=item.OverlayIndex[j];
|
|
12547
|
+
var script=overlayItem.Script;
|
|
12548
|
+
if (mapIndex.has(script.ID))
|
|
12549
|
+
{
|
|
12550
|
+
var mapItem=mapIndex.get(script.ID);
|
|
12551
|
+
script.SetLock(mapItem.LockData);
|
|
12552
|
+
aryUpdate.push({OverlayID:overlayItem.Identify});
|
|
12553
|
+
}
|
|
12554
|
+
}
|
|
12555
|
+
}
|
|
12556
|
+
|
|
12557
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(aryUpdate)) return false;
|
|
12558
|
+
|
|
12559
|
+
this.UpdateWindowIndexV2(aryUpdate);
|
|
12511
12560
|
return true;
|
|
12512
12561
|
}
|
|
12513
12562
|
}
|
|
@@ -13157,8 +13206,8 @@ function IChartFramePainting()
|
|
|
13157
13206
|
this.XSplitOperator; //X轴分割
|
|
13158
13207
|
this.Data; //主数据
|
|
13159
13208
|
|
|
13160
|
-
this.
|
|
13161
|
-
this.
|
|
13209
|
+
this.LockPaint = null; //锁图形
|
|
13210
|
+
this.IndexLock=new IndexLockData(); //指标锁
|
|
13162
13211
|
|
|
13163
13212
|
this.YSpecificMaxMin=null; //指定Y轴最大最小值
|
|
13164
13213
|
this.IsShowBorder = true; //是否显示边框
|
|
@@ -13430,15 +13479,8 @@ function IChartFramePainting()
|
|
|
13430
13479
|
|
|
13431
13480
|
this.DrawLock=function()
|
|
13432
13481
|
{
|
|
13433
|
-
if (this.
|
|
13434
|
-
|
|
13435
|
-
if (this.LockPaint == null)
|
|
13436
|
-
this.LockPaint = g_ChartPaintFactory.Create("ChartLock");//new ChartLock();
|
|
13437
|
-
this.LockPaint.Canvas=this.Canvas;
|
|
13438
|
-
this.LockPaint.ChartBorder=this.ChartBorder;
|
|
13439
|
-
this.LockPaint.ChartFrame=this;
|
|
13440
|
-
this.LockPaint.Draw(true);
|
|
13441
|
-
}
|
|
13482
|
+
if (!this.LockPaint) return;
|
|
13483
|
+
this.LockPaint.Draw(true);
|
|
13442
13484
|
}
|
|
13443
13485
|
|
|
13444
13486
|
this.DrawLogo=function()
|
|
@@ -13494,46 +13536,28 @@ function IChartFramePainting()
|
|
|
13494
13536
|
}
|
|
13495
13537
|
}
|
|
13496
13538
|
|
|
13497
|
-
this.CalculateLock=function()
|
|
13539
|
+
this.CalculateLock=function(aryData)
|
|
13498
13540
|
{
|
|
13499
|
-
|
|
13500
|
-
|
|
13501
|
-
if (this.LockPaint == null)
|
|
13502
|
-
this.LockPaint = g_ChartPaintFactory.Create("ChartLock"); // new ChartLock();
|
|
13503
|
-
this.LockPaint.Canvas=this.Canvas;
|
|
13504
|
-
this.LockPaint.ChartBorder=this.ChartBorder;
|
|
13505
|
-
this.LockPaint.ChartFrame=this;
|
|
13506
|
-
this.LockPaint.Draw(false);
|
|
13507
|
-
}
|
|
13541
|
+
this.LockPaint.SetData(aryData);
|
|
13542
|
+
this.LockPaint.Draw(false);
|
|
13508
13543
|
}
|
|
13509
13544
|
|
|
13510
|
-
|
|
13511
|
-
this.
|
|
13545
|
+
//创建锁图形
|
|
13546
|
+
this.CreateLockPaint=function()
|
|
13512
13547
|
{
|
|
13513
|
-
|
|
13514
|
-
|
|
13515
|
-
|
|
13516
|
-
|
|
13517
|
-
|
|
13518
|
-
|
|
13519
|
-
this.IsLocked=true;
|
|
13520
|
-
if (!this.LockPaint) this.LockPaint=g_ChartPaintFactory.Create("ChartLock"); //new ChartLock(); //创建锁
|
|
13548
|
+
this.LockPaint = g_ChartPaintFactory.Create("ChartLock"); // new ChartLock();
|
|
13549
|
+
this.LockPaint.Canvas=this.Canvas;
|
|
13550
|
+
this.LockPaint.ChartBorder=this.ChartBorder;
|
|
13551
|
+
this.LockPaint.ChartFrame=this;
|
|
13552
|
+
}
|
|
13521
13553
|
|
|
13522
|
-
|
|
13523
|
-
|
|
13524
|
-
|
|
13525
|
-
if (lockData.ID) this.LockPaint.LockID=lockData.ID; //锁ID
|
|
13526
|
-
if (lockData.BG) this.LockPaint.BGColor=lockData.BG; //背景色
|
|
13527
|
-
if (lockData.Text) this.LockPaint.Title= lockData.Text;
|
|
13528
|
-
if (lockData.TextColor) this.LockPaint.TextColor=lockData.TextColor;
|
|
13529
|
-
if (lockData.Font) this.LockPaint.Font=lockData.Font;
|
|
13530
|
-
if (lockData.Count) this.LockPaint.LockCount=lockData.Count;
|
|
13531
|
-
if (lockData.MinWidth>0) this.LockPaint.MinWidth=lockData.MinWidth;
|
|
13554
|
+
this.SetLock=function(lockData)
|
|
13555
|
+
{
|
|
13556
|
+
this.IndexLock.SetData(lockData);
|
|
13532
13557
|
}
|
|
13533
13558
|
|
|
13534
13559
|
this.GetLockRect=function()
|
|
13535
13560
|
{
|
|
13536
|
-
if (!this.IsLocked) return null;
|
|
13537
13561
|
if (!this.LockPaint) return null;
|
|
13538
13562
|
return this.LockPaint.LockRect;
|
|
13539
13563
|
}
|
|
@@ -18570,6 +18594,13 @@ function OverlayMinuteFrame()
|
|
|
18570
18594
|
this.IsShareY=false; //使用和主框架公用Y轴
|
|
18571
18595
|
this.IsCalculateYMaxMin=true; //是否计算Y最大最小值
|
|
18572
18596
|
this.IsShowMainFrame=0; //是否显示在主框架坐标上 1=左边 2=右边
|
|
18597
|
+
this.MainFrame=null; //主框架
|
|
18598
|
+
|
|
18599
|
+
this.GetLockRect=function()
|
|
18600
|
+
{
|
|
18601
|
+
if (!this.MainFrame || !this.MainFrame.GetLockRect) return null;
|
|
18602
|
+
return this.MainFrame.GetLockRect();
|
|
18603
|
+
}
|
|
18573
18604
|
|
|
18574
18605
|
this.Draw=function()
|
|
18575
18606
|
{
|
|
@@ -18628,6 +18659,13 @@ function OverlayMinuteHScreenFrame()
|
|
|
18628
18659
|
|
|
18629
18660
|
this.ClassName="OverlayMinuteHScreenFrame";
|
|
18630
18661
|
this.IsShow=true; //坐标是否显示
|
|
18662
|
+
this.MainFrame=null; //主框架
|
|
18663
|
+
|
|
18664
|
+
this.GetLockRect=function()
|
|
18665
|
+
{
|
|
18666
|
+
if (!this.MainFrame || !this.MainFrame.GetLockRect) return null;
|
|
18667
|
+
return this.MainFrame.GetLockRect();
|
|
18668
|
+
}
|
|
18631
18669
|
|
|
18632
18670
|
this.Draw=function()
|
|
18633
18671
|
{
|
|
@@ -20015,6 +20053,12 @@ function OverlayKLineFrame()
|
|
|
20015
20053
|
}
|
|
20016
20054
|
}
|
|
20017
20055
|
|
|
20056
|
+
this.GetLockRect=function()
|
|
20057
|
+
{
|
|
20058
|
+
if (!this.MainFrame || !this.MainFrame.GetLockRect) return null;
|
|
20059
|
+
return this.MainFrame.GetLockRect();
|
|
20060
|
+
}
|
|
20061
|
+
|
|
20018
20062
|
this.Draw=function()
|
|
20019
20063
|
{
|
|
20020
20064
|
this.Buttons=[];
|
|
@@ -21327,6 +21371,12 @@ function OverlayKLineHScreenFrame()
|
|
|
21327
21371
|
this.TitleColor=g_JSChartResource.OverlayFrame.TitleColor;
|
|
21328
21372
|
this.TitleFont=g_JSChartResource.OverlayFrame.TitleFont;
|
|
21329
21373
|
|
|
21374
|
+
this.GetLockRect=function()
|
|
21375
|
+
{
|
|
21376
|
+
if (!this.MainFrame || !this.MainFrame.GetLockRect) return null;
|
|
21377
|
+
return this.MainFrame.GetLockRect();
|
|
21378
|
+
}
|
|
21379
|
+
|
|
21330
21380
|
this.Draw=function()
|
|
21331
21381
|
{
|
|
21332
21382
|
this.SplitXYCoordinate();
|
|
@@ -22533,7 +22583,7 @@ function HQTradeFrame()
|
|
|
22533
22583
|
|
|
22534
22584
|
this.DrawLock=function()
|
|
22535
22585
|
{
|
|
22536
|
-
for (var i
|
|
22586
|
+
for (var i=0; i<this.SubFrame.length; ++i)
|
|
22537
22587
|
{
|
|
22538
22588
|
var item = this.SubFrame[i];
|
|
22539
22589
|
item.Frame.DrawLock();
|
|
@@ -22555,10 +22605,21 @@ function HQTradeFrame()
|
|
|
22555
22605
|
|
|
22556
22606
|
this.CalculateLock=function()
|
|
22557
22607
|
{
|
|
22558
|
-
for (var i
|
|
22608
|
+
for (var i=0, j=0; i<this.SubFrame.length; ++i)
|
|
22559
22609
|
{
|
|
22560
22610
|
var item = this.SubFrame[i];
|
|
22561
|
-
|
|
22611
|
+
var aryLockData=[];
|
|
22612
|
+
if (item.Frame.IndexLock.IsLocked) aryLockData.push({ Data:item.Frame.IndexLock, IsOverlay:false });
|
|
22613
|
+
for(j=0; j<item.OverlayIndex.length; ++j)
|
|
22614
|
+
{
|
|
22615
|
+
var subItem=item.OverlayIndex[j];
|
|
22616
|
+
if (subItem.Frame.IndexLock.IsLocked===true)
|
|
22617
|
+
{
|
|
22618
|
+
aryLockData.push({ Data:subItem.Frame.IndexLock, IsOverlay:true } );
|
|
22619
|
+
}
|
|
22620
|
+
}
|
|
22621
|
+
|
|
22622
|
+
item.Frame.CalculateLock(aryLockData);
|
|
22562
22623
|
}
|
|
22563
22624
|
}
|
|
22564
22625
|
|
|
@@ -38705,6 +38766,13 @@ function ChartStickLine()
|
|
|
38705
38766
|
xOffset=this.ChartBorder.GetTop()+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;
|
|
38706
38767
|
}
|
|
38707
38768
|
|
|
38769
|
+
var lockRect=this.GetLockRect();
|
|
38770
|
+
if (lockRect)
|
|
38771
|
+
{
|
|
38772
|
+
if (this.IsHScreen) chartright=lockRect.Top;
|
|
38773
|
+
else chartright=lockRect.Left;
|
|
38774
|
+
}
|
|
38775
|
+
|
|
38708
38776
|
var isMinute=this.IsMinuteFrame();
|
|
38709
38777
|
|
|
38710
38778
|
if (isMinute)
|
|
@@ -47780,6 +47848,39 @@ function ChartDrawFlagText()
|
|
|
47780
47848
|
}
|
|
47781
47849
|
}
|
|
47782
47850
|
|
|
47851
|
+
function IndexLockData()
|
|
47852
|
+
{
|
|
47853
|
+
this.IsLocked=false;
|
|
47854
|
+
this.LockCount = 20; // 锁最新的几个数据
|
|
47855
|
+
this.BGColor = g_JSChartResource.IndexLock.BGColor;
|
|
47856
|
+
this.TextColor = g_JSChartResource.IndexLock.TextColor;
|
|
47857
|
+
this.Font = g_JSChartResource.IndexLock.Font;
|
|
47858
|
+
this.Title = g_JSChartResource.IndexLock.Title;
|
|
47859
|
+
this.LockID; //锁ID
|
|
47860
|
+
this.IndexName; //指标名字
|
|
47861
|
+
this.IndexID; //指标ID
|
|
47862
|
+
|
|
47863
|
+
this.SetData=function(lockData)
|
|
47864
|
+
{
|
|
47865
|
+
if (!lockData) //空 解锁
|
|
47866
|
+
{
|
|
47867
|
+
this.IsLocked=false;
|
|
47868
|
+
return;
|
|
47869
|
+
}
|
|
47870
|
+
|
|
47871
|
+
this.IsLocked=true;
|
|
47872
|
+
if (lockData.Callback) this.Callback=lockData.Callback; //回调 !!废弃
|
|
47873
|
+
if (lockData.IndexName) this.IndexName=lockData.IndexName; //指标名字
|
|
47874
|
+
if (lockData.IndexID) this.IndexID=lockData.IndexID; //指标ID
|
|
47875
|
+
if (lockData.ID) this.LockID=lockData.ID; //锁ID
|
|
47876
|
+
if (lockData.BG) this.BGColor=lockData.BG; //背景色
|
|
47877
|
+
if (lockData.Text) this.Title= lockData.Text;
|
|
47878
|
+
if (lockData.TextColor) this.TextColor=lockData.TextColor;
|
|
47879
|
+
if (lockData.Font) this.Font=lockData.Font;
|
|
47880
|
+
if (lockData.Count) this.LockCount=lockData.Count;
|
|
47881
|
+
}
|
|
47882
|
+
}
|
|
47883
|
+
|
|
47783
47884
|
//锁 支持横屏
|
|
47784
47885
|
function ChartLock()
|
|
47785
47886
|
{
|
|
@@ -47788,17 +47889,39 @@ function ChartLock()
|
|
|
47788
47889
|
delete this.newMethod;
|
|
47789
47890
|
|
|
47790
47891
|
this.ClassName="ChartLock";
|
|
47892
|
+
this.AryData=null;
|
|
47893
|
+
this.LockRect=null; //上锁区域
|
|
47894
|
+
|
|
47791
47895
|
this.LockCount = 20; // 锁最新的几个数据
|
|
47792
47896
|
this.BGColor = g_JSChartResource.IndexLock.BGColor;
|
|
47793
47897
|
this.TextColor = g_JSChartResource.IndexLock.TextColor;
|
|
47794
47898
|
this.Font = g_JSChartResource.IndexLock.Font;
|
|
47795
47899
|
this.Title = g_JSChartResource.IndexLock.Title;
|
|
47796
|
-
|
|
47900
|
+
|
|
47797
47901
|
this.LockID; //锁ID
|
|
47798
47902
|
this.Callback; //回调
|
|
47799
47903
|
this.IndexName; //指标名字
|
|
47800
47904
|
this.IndexID; //指标ID
|
|
47801
47905
|
|
|
47906
|
+
this.SetData=function(aryData)
|
|
47907
|
+
{
|
|
47908
|
+
this.AryData=aryData;
|
|
47909
|
+
|
|
47910
|
+
if (IFrameSplitOperator.IsNonEmptyArray(this.AryData))
|
|
47911
|
+
{
|
|
47912
|
+
var item=this.AryData[0].Data; //取第一个锁
|
|
47913
|
+
|
|
47914
|
+
this.LockCount = item.LockCount;
|
|
47915
|
+
this.BGColor = item.BGColor
|
|
47916
|
+
this.TextColor = item.TextColor
|
|
47917
|
+
this.Font = item.Font
|
|
47918
|
+
this.Title = item.Title
|
|
47919
|
+
this.LockID=item.LockID; //锁ID
|
|
47920
|
+
this.Callback=item.Callback; //回调
|
|
47921
|
+
this.IndexName=item.IndexName; //指标名字
|
|
47922
|
+
this.IndexID=item.IndexID; //指标ID
|
|
47923
|
+
}
|
|
47924
|
+
}
|
|
47802
47925
|
|
|
47803
47926
|
this.CalculateTextSize=function(aryText, defaultFont, out)
|
|
47804
47927
|
{
|
|
@@ -47820,7 +47943,7 @@ function ChartLock()
|
|
|
47820
47943
|
}
|
|
47821
47944
|
else
|
|
47822
47945
|
{
|
|
47823
|
-
|
|
47946
|
+
if (item.Font)
|
|
47824
47947
|
{
|
|
47825
47948
|
this.Canvas.font=item.Font;
|
|
47826
47949
|
lineHeight=this.Canvas.measureText("擎").width;
|
|
@@ -47866,12 +47989,7 @@ function ChartLock()
|
|
|
47866
47989
|
this.Draw=function(bDraw)
|
|
47867
47990
|
{
|
|
47868
47991
|
this.LockRect=null;
|
|
47869
|
-
if (!
|
|
47870
|
-
if (this.NotSupportMessage)
|
|
47871
|
-
{
|
|
47872
|
-
this.DrawNotSupportmessage();
|
|
47873
|
-
return;
|
|
47874
|
-
}
|
|
47992
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(this.AryData)) return;
|
|
47875
47993
|
|
|
47876
47994
|
var bHScreen=this.ChartFrame.IsHScreen;
|
|
47877
47995
|
var bMinute=this.IsMinuteFrame();
|
|
@@ -47917,24 +48035,33 @@ function ChartLock()
|
|
|
47917
48035
|
var rtBG={ Left:border.Left, Right:border.RightEx, Top:left, Bottom:border.Bottom };
|
|
47918
48036
|
rtBG.Width=rtBG.Right-rtBG.Left;
|
|
47919
48037
|
rtBG.Height=rtBG.Bottom-rtBG.Top;
|
|
47920
|
-
|
|
47921
|
-
var bgColor=this.SetFillStyle(this.BGColor, rtBG.Left, rtBG.Top, rtBG.Right, rtBG.Top);
|
|
47922
|
-
this.Canvas.fillStyle =bgColor;
|
|
47923
|
-
this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
|
|
47924
48038
|
this.LockRect=rtBG; //保存上锁区域
|
|
48039
|
+
|
|
48040
|
+
if (bDraw)
|
|
48041
|
+
{
|
|
48042
|
+
var bgColor=this.SetFillStyle(this.BGColor, rtBG.Left, rtBG.Top, rtBG.Right, rtBG.Top);
|
|
48043
|
+
this.Canvas.fillStyle =bgColor;
|
|
48044
|
+
this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
|
|
48045
|
+
}
|
|
47925
48046
|
}
|
|
47926
48047
|
else
|
|
47927
48048
|
{
|
|
47928
48049
|
var rtBG={ Left:left, Right:border.RightEx, Top:border.TopTitle, Bottom:border.Bottom };
|
|
47929
48050
|
rtBG.Width=rtBG.Right-rtBG.Left;
|
|
47930
48051
|
rtBG.Height=rtBG.Bottom-rtBG.Top;
|
|
47931
|
-
//上下渐变
|
|
47932
|
-
var bgColor=this.SetFillStyle(this.BGColor, rtBG.Left, rtBG.Top, rtBG.Left, rtBG.Bottom);
|
|
47933
|
-
this.Canvas.fillStyle =bgColor;
|
|
47934
|
-
this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
|
|
47935
48052
|
this.LockRect=rtBG; //保存上锁区域
|
|
48053
|
+
|
|
48054
|
+
if (bDraw)
|
|
48055
|
+
{
|
|
48056
|
+
//上下渐变
|
|
48057
|
+
var bgColor=this.SetFillStyle(this.BGColor, rtBG.Left, rtBG.Top, rtBG.Left, rtBG.Bottom);
|
|
48058
|
+
this.Canvas.fillStyle =bgColor;
|
|
48059
|
+
this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
|
|
48060
|
+
}
|
|
47936
48061
|
}
|
|
47937
48062
|
|
|
48063
|
+
if (!bDraw) return;
|
|
48064
|
+
|
|
47938
48065
|
var aryText=null;
|
|
47939
48066
|
if (Array.isArray(this.Title)) aryText=this.Title;
|
|
47940
48067
|
else aryText=[{Text:this.Title}];
|
|
@@ -47951,67 +48078,54 @@ function ChartLock()
|
|
|
47951
48078
|
var top=rtBG.Top+(rtBG.Height-outSize.Width)/2;
|
|
47952
48079
|
if (outSize.Width>rtBG.Height) top=rtBG.Bottom-outSize.Width;
|
|
47953
48080
|
var left=rtBG.Left+(rtBG.Width-outSize.Height)/2;
|
|
47954
|
-
|
|
47955
48081
|
this.Canvas.save();
|
|
47956
48082
|
this.Canvas.translate(left, top);
|
|
47957
48083
|
this.Canvas.rotate(90 * Math.PI / 180);
|
|
47958
|
-
var
|
|
47959
|
-
for(var i=0;i<outSize.AryText.length;++i)
|
|
47960
|
-
{
|
|
47961
|
-
var item=outSize.AryText[i];
|
|
47962
|
-
if (item.Color) this.Canvas.fillStyle=item.Color;
|
|
47963
|
-
else this.Canvas.fillStyle=this.TextColor;
|
|
47964
|
-
|
|
47965
|
-
if (item.Font) this.Canvas.font = item.Font;
|
|
47966
|
-
else this.Canvas.font = this.Font;
|
|
47967
|
-
|
|
47968
|
-
yText+=item.Height;
|
|
47969
|
-
this.Canvas.fillText(item.Text, xText, yText+item.YOffset);
|
|
47970
|
-
}
|
|
47971
|
-
|
|
47972
|
-
this.Canvas.restore();
|
|
48084
|
+
var left=0,top=0;
|
|
47973
48085
|
}
|
|
47974
48086
|
else
|
|
47975
48087
|
{
|
|
47976
48088
|
var left=rtBG.Left+(rtBG.Width-outSize.Width)/2;
|
|
47977
48089
|
if (outSize.Width>rtBG.Width) left=rtBG.Right-outSize.Width;
|
|
47978
48090
|
var top=rtBG.Top+(rtBG.Height-outSize.Height)/2;
|
|
47979
|
-
|
|
47980
|
-
|
|
47981
|
-
|
|
48091
|
+
}
|
|
48092
|
+
|
|
48093
|
+
var yText=top, xText=left;
|
|
48094
|
+
for(var i=0;i<outSize.AryText.length;++i)
|
|
48095
|
+
{
|
|
48096
|
+
var item=outSize.AryText[i];
|
|
48097
|
+
xText=left;
|
|
48098
|
+
if (item.Image)
|
|
47982
48099
|
{
|
|
47983
|
-
|
|
47984
|
-
if (item.Image)
|
|
48100
|
+
if (item.Align===1)
|
|
47985
48101
|
{
|
|
47986
|
-
xText
|
|
47987
|
-
if (item.Align===1)
|
|
47988
|
-
{
|
|
47989
|
-
if (outSize.Width>item.Width) xText+=(outSize.Width-item.Width)/2;
|
|
47990
|
-
}
|
|
47991
|
-
|
|
47992
|
-
this.Canvas.drawImage(item.Image.Data, xText, yText, item.Image.Width, item.Image.Height);
|
|
47993
|
-
|
|
47994
|
-
yText+=item.Height;
|
|
48102
|
+
if (outSize.Width>item.Width) xText+=(outSize.Width-item.Width)/2;
|
|
47995
48103
|
}
|
|
47996
|
-
else
|
|
47997
|
-
{
|
|
47998
|
-
if (item.Color) this.Canvas.fillStyle=item.Color;
|
|
47999
|
-
else this.Canvas.fillStyle=this.TextColor;
|
|
48000
48104
|
|
|
48001
|
-
|
|
48002
|
-
else this.Canvas.font = this.Font;
|
|
48105
|
+
this.Canvas.drawImage(item.Image.Data, xText, yText, item.Image.Width, item.Image.Height);
|
|
48003
48106
|
|
|
48004
|
-
|
|
48005
|
-
|
|
48006
|
-
|
|
48007
|
-
|
|
48008
|
-
|
|
48009
|
-
|
|
48107
|
+
yText+=item.Height;
|
|
48108
|
+
}
|
|
48109
|
+
else
|
|
48110
|
+
{
|
|
48111
|
+
if (item.Color) this.Canvas.fillStyle=item.Color;
|
|
48112
|
+
else this.Canvas.fillStyle=this.TextColor;
|
|
48113
|
+
|
|
48114
|
+
if (item.Font) this.Canvas.font = item.Font;
|
|
48115
|
+
else this.Canvas.font = this.Font;
|
|
48010
48116
|
|
|
48011
|
-
|
|
48117
|
+
yText+=item.Height;
|
|
48118
|
+
|
|
48119
|
+
if (item.Align===1)
|
|
48120
|
+
{
|
|
48121
|
+
if (outSize.Width>item.Width) xText+=(outSize.Width-item.Width)/2;
|
|
48012
48122
|
}
|
|
48013
|
-
|
|
48123
|
+
|
|
48124
|
+
this.Canvas.fillText(item.Text, xText, yText+item.YOffset);
|
|
48125
|
+
}
|
|
48014
48126
|
}
|
|
48127
|
+
|
|
48128
|
+
if (bHScreen) this.Canvas.restore();
|
|
48015
48129
|
}
|
|
48016
48130
|
|
|
48017
48131
|
//x,y是否在上锁区域
|
|
@@ -48021,7 +48135,7 @@ function ChartLock()
|
|
|
48021
48135
|
|
|
48022
48136
|
if (Path2DHelper.PtInRect(x,y,this.LockRect))
|
|
48023
48137
|
{
|
|
48024
|
-
tooltip.Data={ ID:this.LockID, Callback:this.Callback, IndexName:this.IndexName, IndexID:this.IndexID };
|
|
48138
|
+
tooltip.Data={ ID:this.LockID, Callback:this.Callback, IndexName:this.IndexName, IndexID:this.IndexID, Data:this.AryData };
|
|
48025
48139
|
tooltip.ChartPaint=this;
|
|
48026
48140
|
return true;
|
|
48027
48141
|
}
|
|
@@ -82978,6 +83092,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
82978
83092
|
frame.GetEventCallback=(id)=> { return this.GetEventCallback(id); };
|
|
82979
83093
|
frame.GlobalOption=this.GlobalOption;
|
|
82980
83094
|
frame.CreateDivFrameToolbar(this, i, this.UIElement.parentNode);
|
|
83095
|
+
frame.CreateLockPaint();
|
|
82981
83096
|
|
|
82982
83097
|
frame.HorizontalMax=20;
|
|
82983
83098
|
frame.HorizontalMin=10;
|
|
@@ -83079,6 +83194,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
83079
83194
|
frame.XSplitOperator.Symbol=this.Symbol;
|
|
83080
83195
|
frame.XSplitOperator.Period=this.Period;
|
|
83081
83196
|
frame.CreateDivFrameToolbar(this, id, this.UIElement.parentNode);
|
|
83197
|
+
frame.CreateLockPaint();
|
|
83082
83198
|
|
|
83083
83199
|
//K线数据绑定
|
|
83084
83200
|
var xPointCouont=this.Frame.SubFrame[0].Frame.XPointCount;
|
|
@@ -85538,7 +85654,6 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
85538
85654
|
|
|
85539
85655
|
|
|
85540
85656
|
subFrame.YSpecificMaxMin=null; //清空指定最大最小值
|
|
85541
|
-
subFrame.IsLocked=false; //解除上锁
|
|
85542
85657
|
subFrame.YSplitScale = null; //清空固定刻度
|
|
85543
85658
|
subFrame.YSplitOperator.SplitType=subFrame.YSplitOperator.DefaultSplitType; //还原Y坐标分割模式
|
|
85544
85659
|
|
|
@@ -85836,7 +85951,6 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
85836
85951
|
|
|
85837
85952
|
|
|
85838
85953
|
this.Frame.SubFrame[windowIndex].Frame.YSpecificMaxMin=null; //清空指定最大最小值
|
|
85839
|
-
this.Frame.SubFrame[windowIndex].Frame.IsLocked=false; //解除上锁
|
|
85840
85954
|
this.Frame.SubFrame[windowIndex].Frame.YSplitScale = null; //清空固定刻度
|
|
85841
85955
|
|
|
85842
85956
|
this.ChartPaint=paint;
|
|
@@ -85894,7 +86008,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
85894
86008
|
}
|
|
85895
86009
|
else if (obj.Script) //动态执行脚本
|
|
85896
86010
|
{
|
|
85897
|
-
indexInfo={ Script:obj.Script, ID:obj.
|
|
86011
|
+
indexInfo={ Script:obj.Script, ID:obj.IndexName, Name:obj.IndexName};
|
|
85898
86012
|
if (obj.Name) indexInfo.Name=obj.Name;
|
|
85899
86013
|
}
|
|
85900
86014
|
else
|
|
@@ -86229,7 +86343,6 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
86229
86343
|
this.DeleteIndexPaint(i);
|
|
86230
86344
|
var frame=this.Frame.SubFrame[i];
|
|
86231
86345
|
frame.YSpecificMaxMin=null;
|
|
86232
|
-
frame.IsLocked=false;
|
|
86233
86346
|
frame.YSplitScale = null;
|
|
86234
86347
|
}
|
|
86235
86348
|
|
|
@@ -86609,35 +86722,16 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
86609
86722
|
}
|
|
86610
86723
|
}
|
|
86611
86724
|
|
|
86612
|
-
//锁|解锁指标 { Index:指标名字,IsLocked:是否要锁上,Callback:回调 }
|
|
86613
|
-
this.LockIndex=function(lockData)
|
|
86614
|
-
{
|
|
86615
|
-
if (!lockData) return;
|
|
86616
|
-
if (!lockData.IndexName) return;
|
|
86617
|
-
|
|
86618
|
-
for(let i in this.WindowIndex)
|
|
86619
|
-
{
|
|
86620
|
-
let item=this.WindowIndex[i];
|
|
86621
|
-
if (!item) conintue;
|
|
86622
|
-
if (item.Name==lockData.IndexName)
|
|
86623
|
-
{
|
|
86624
|
-
item.SetLock(lockData);
|
|
86625
|
-
this.Update();
|
|
86626
|
-
break;
|
|
86627
|
-
}
|
|
86628
|
-
}
|
|
86629
|
-
}
|
|
86630
|
-
|
|
86631
86725
|
this.TryClickLock=function(x,y)
|
|
86632
86726
|
{
|
|
86633
86727
|
for(var i=0;i<this.Frame.SubFrame.length; ++i)
|
|
86634
86728
|
{
|
|
86635
86729
|
var item=this.Frame.SubFrame[i];
|
|
86636
|
-
|
|
86637
|
-
if (!
|
|
86730
|
+
var chartLock=item.Frame.LockPaint;
|
|
86731
|
+
if (!chartLock || !chartLock.LockRect) continue;
|
|
86638
86732
|
|
|
86639
86733
|
var tooltip=new TooltipData();
|
|
86640
|
-
if (!
|
|
86734
|
+
if (!chartLock.GetTooltipData(x,y,tooltip)) continue;
|
|
86641
86735
|
|
|
86642
86736
|
tooltip.HQChart=this;
|
|
86643
86737
|
var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_INDEX_LOCK);
|
|
@@ -92643,6 +92737,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
92643
92737
|
frame.XPointCount=243;
|
|
92644
92738
|
frame.HQChart=this;
|
|
92645
92739
|
frame.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
92740
|
+
frame.CreateLockPaint();
|
|
92646
92741
|
|
|
92647
92742
|
if (i>=2)
|
|
92648
92743
|
{
|
|
@@ -92754,6 +92849,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
92754
92849
|
frame.YSplitOperator.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
92755
92850
|
frame.XSplitOperator.Symbol=this.Symbol;
|
|
92756
92851
|
frame.CreateDivFrameToolbar(this, id, this.UIElement.parentNode);
|
|
92852
|
+
frame.CreateLockPaint();
|
|
92757
92853
|
|
|
92758
92854
|
if (this.DayCount>1)
|
|
92759
92855
|
{
|
|
@@ -92879,7 +92975,6 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
92879
92975
|
//清空指定最大最小值
|
|
92880
92976
|
|
|
92881
92977
|
subFrame.YSpecificMaxMin=null;
|
|
92882
|
-
subFrame.IsLocked=false; //解除上锁
|
|
92883
92978
|
subFrame.YSplitOperator.SplitType=subFrame.YSplitOperator.DefaultSplitType; //还原Y坐标分割模式
|
|
92884
92979
|
|
|
92885
92980
|
this.ChartPaint=paint;
|
|
@@ -93112,7 +93207,6 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
93112
93207
|
this.DeleteIndexPaint(i);
|
|
93113
93208
|
var frame=this.Frame.SubFrame[i];
|
|
93114
93209
|
frame.YSpecificMaxMin=null;
|
|
93115
|
-
frame.IsLocked=false;
|
|
93116
93210
|
frame.YSplitScale = null;
|
|
93117
93211
|
}
|
|
93118
93212
|
|
|
@@ -95359,9 +95453,9 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
95359
95453
|
{
|
|
95360
95454
|
overlayFrame=new OverlayIndexItem();
|
|
95361
95455
|
overlayFrame.Identify='Position_Line_Frame';
|
|
95362
|
-
|
|
95363
|
-
if (this.ClassName=="MinuteChartContainer") frame=new OverlayMinuteFrame();
|
|
95364
|
-
else frame=new OverlayMinuteHScreenFrame();
|
|
95456
|
+
frame=this.CreateOverlayFrame();
|
|
95457
|
+
//if (this.ClassName=="MinuteChartContainer") frame=new OverlayMinuteFrame();
|
|
95458
|
+
//else frame=new OverlayMinuteHScreenFrame();
|
|
95365
95459
|
|
|
95366
95460
|
frame.Canvas=this.Canvas;
|
|
95367
95461
|
frame.MainFrame=subFrame.Frame;
|
|
@@ -95544,9 +95638,9 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
95544
95638
|
var subFrame=this.Frame.SubFrame[windowIndex];
|
|
95545
95639
|
var overlayFrame=new OverlayIndexItem();
|
|
95546
95640
|
if (obj.Identify) overlayFrame.Identify=obj.Identify; //由外部指定id
|
|
95547
|
-
var frame=
|
|
95548
|
-
if (this.ClassName=="MinuteChartContainer") frame=new OverlayMinuteFrame();
|
|
95549
|
-
else frame=new OverlayMinuteHScreenFrame();
|
|
95641
|
+
var frame=this.CreateOverlayFrame();
|
|
95642
|
+
//if (this.ClassName=="MinuteChartContainer") frame=new OverlayMinuteFrame();
|
|
95643
|
+
//else frame=new OverlayMinuteHScreenFrame();
|
|
95550
95644
|
frame.Canvas=this.Canvas;
|
|
95551
95645
|
frame.MainFrame=subFrame.Frame;
|
|
95552
95646
|
frame.ChartBorder=subFrame.Frame.ChartBorder;
|
|
@@ -96466,13 +96560,22 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
96466
96560
|
for(var i=0;i<this.Frame.SubFrame.length; ++i)
|
|
96467
96561
|
{
|
|
96468
96562
|
var item=this.Frame.SubFrame[i];
|
|
96469
|
-
|
|
96470
|
-
if (!
|
|
96563
|
+
var chartLock=item.Frame.LockPaint;
|
|
96564
|
+
if (!chartLock || !chartLock.LockRect) continue;
|
|
96471
96565
|
|
|
96472
96566
|
var tooltip=new TooltipData();
|
|
96473
|
-
if (!
|
|
96567
|
+
if (!chartLock.GetTooltipData(x,y,tooltip)) continue;
|
|
96474
96568
|
|
|
96475
96569
|
tooltip.HQChart=this;
|
|
96570
|
+
|
|
96571
|
+
var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_INDEX_LOCK);
|
|
96572
|
+
if (event && event.Callback)
|
|
96573
|
+
{
|
|
96574
|
+
var sendData={ FrameID:item.Frame.Identify, Data:tooltip };
|
|
96575
|
+
event.Callback(event,sendData,this);
|
|
96576
|
+
}
|
|
96577
|
+
|
|
96578
|
+
|
|
96476
96579
|
if (tooltip.Data.Callback) tooltip.Data.Callback(tooltip);
|
|
96477
96580
|
return true;
|
|
96478
96581
|
}
|