hqchart 1.1.15106 → 1.1.15121
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 +356 -333
- package/package.json +1 -1
- package/src/jscommon/umychart.DialogSearchIndex.js +42 -5
- package/src/jscommon/umychart.NetworkFilterTest.js +125 -1
- package/src/jscommon/umychart.complier.js +25 -13
- package/src/jscommon/umychart.js +341 -195
- package/src/jscommon/umychart.testdata.js +125 -1
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +368 -209
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.NetworkFilterTest.vue.js +125 -1
- package/src/jscommon/umychart.vue/umychart.vue.js +410 -214
|
@@ -6359,12 +6359,12 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
6359
6359
|
}
|
|
6360
6360
|
|
|
6361
6361
|
//锁指标
|
|
6362
|
-
this.
|
|
6362
|
+
this.EnableLockIndex=function(aryData)
|
|
6363
6363
|
{
|
|
6364
|
-
if(this.JSChartContainer && typeof(this.JSChartContainer.
|
|
6364
|
+
if(this.JSChartContainer && typeof(this.JSChartContainer.EnableLockIndex)=='function')
|
|
6365
6365
|
{
|
|
6366
|
-
JSConsole.Chart.Log('[JSChart:
|
|
6367
|
-
this.JSChartContainer.
|
|
6366
|
+
JSConsole.Chart.Log('[JSChart:EnableLockIndex] aryData', aryData);
|
|
6367
|
+
this.JSChartContainer.EnableLockIndex(lockData);
|
|
6368
6368
|
}
|
|
6369
6369
|
}
|
|
6370
6370
|
|
|
@@ -6766,6 +6766,14 @@ JSChart.RegisterChartFrameClass=function(name, option)
|
|
|
6766
6766
|
}
|
|
6767
6767
|
|
|
6768
6768
|
|
|
6769
|
+
//注册DOM对话框类
|
|
6770
|
+
//option:{ Create:创建类方法 }
|
|
6771
|
+
JSChart.RegisterDOMClass=function(name, option)
|
|
6772
|
+
{
|
|
6773
|
+
return g_JSDOMFactory.Add(name, option);
|
|
6774
|
+
}
|
|
6775
|
+
|
|
6776
|
+
|
|
6769
6777
|
//一些公共函数
|
|
6770
6778
|
JSChart.ToFixedPoint=function(value)
|
|
6771
6779
|
{
|
|
@@ -16648,8 +16656,87 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
16648
16656
|
if (!this.PressKeyboardConfig) return false;
|
|
16649
16657
|
if (!this.PressKeyboardConfig.PauseUpdate) return false;
|
|
16650
16658
|
|
|
16659
|
+
return true;
|
|
16660
|
+
},
|
|
16661
|
+
|
|
16662
|
+
//启动|关闭锁指标 aryIndex=[{ IndexID:指标ID, LockData:{IsLocked:} } ]
|
|
16663
|
+
this.EnableLockIndex=function(aryIndex)
|
|
16664
|
+
{
|
|
16665
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(aryIndex)) return false;
|
|
16666
|
+
|
|
16667
|
+
var mapIndex=new Map();
|
|
16668
|
+
for(var i=0;i<aryIndex.length;++i)
|
|
16669
|
+
{
|
|
16670
|
+
var item=aryIndex[i];
|
|
16671
|
+
if (item.IndexID && item.LockData) mapIndex.set(item.IndexID, item);
|
|
16672
|
+
}
|
|
16673
|
+
|
|
16674
|
+
var aryUpdate=[];
|
|
16675
|
+
for(var i=0; i<this.WindowIndex.length; ++i)
|
|
16676
|
+
{
|
|
16677
|
+
var item=this.WindowIndex[i];
|
|
16678
|
+
if (!item) continue;
|
|
16679
|
+
if (mapIndex.has(item.ID))
|
|
16680
|
+
{
|
|
16681
|
+
var mapItem=mapIndex.get(item.ID);
|
|
16682
|
+
item.SetLock(mapItem.LockData); //设置锁
|
|
16683
|
+
aryUpdate.push({ ID:i});
|
|
16684
|
+
}
|
|
16685
|
+
}
|
|
16686
|
+
|
|
16687
|
+
for(var i=0; i<this.Frame.SubFrame.length; ++i)
|
|
16688
|
+
{
|
|
16689
|
+
var item=this.Frame.SubFrame[i];
|
|
16690
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(item.OverlayIndex)) continue;
|
|
16691
|
+
|
|
16692
|
+
for(var j=0; j<item.OverlayIndex.length; ++j)
|
|
16693
|
+
{
|
|
16694
|
+
var overlayItem=item.OverlayIndex[j];
|
|
16695
|
+
var script=overlayItem.Script;
|
|
16696
|
+
if (mapIndex.has(script.ID))
|
|
16697
|
+
{
|
|
16698
|
+
var mapItem=mapIndex.get(script.ID);
|
|
16699
|
+
script.SetLock(mapItem.LockData);
|
|
16700
|
+
aryUpdate.push({OverlayID:overlayItem.Identify});
|
|
16701
|
+
}
|
|
16702
|
+
}
|
|
16703
|
+
}
|
|
16704
|
+
|
|
16705
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(aryUpdate)) return false;
|
|
16706
|
+
|
|
16707
|
+
this.UpdateWindowIndexV2(aryUpdate);
|
|
16651
16708
|
return true;
|
|
16652
16709
|
}
|
|
16710
|
+
|
|
16711
|
+
this.TryClickLock=function(x,y)
|
|
16712
|
+
{
|
|
16713
|
+
if (!this.Frame || !IFrameSplitOperator.IsNonEmptyArray(this.Frame.SubFrame)) return false;
|
|
16714
|
+
|
|
16715
|
+
for(var i=0;i<this.Frame.SubFrame.length; ++i)
|
|
16716
|
+
{
|
|
16717
|
+
var item=this.Frame.SubFrame[i];
|
|
16718
|
+
var chartLock=item.Frame.LockPaint;
|
|
16719
|
+
if (!chartLock || !chartLock.LockRect) continue;
|
|
16720
|
+
|
|
16721
|
+
var tooltip=new TooltipData();
|
|
16722
|
+
if (!chartLock.GetTooltipData(x,y,tooltip)) continue;
|
|
16723
|
+
|
|
16724
|
+
tooltip.HQChart=this;
|
|
16725
|
+
|
|
16726
|
+
var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_INDEX_LOCK);
|
|
16727
|
+
if (event && event.Callback)
|
|
16728
|
+
{
|
|
16729
|
+
var sendData={ FrameID:item.Frame.Identify, Data:tooltip };
|
|
16730
|
+
event.Callback(event,sendData,this);
|
|
16731
|
+
}
|
|
16732
|
+
|
|
16733
|
+
|
|
16734
|
+
if (tooltip.Data.Callback) tooltip.Data.Callback(tooltip);
|
|
16735
|
+
return true;
|
|
16736
|
+
}
|
|
16737
|
+
|
|
16738
|
+
return false;
|
|
16739
|
+
}
|
|
16653
16740
|
}
|
|
16654
16741
|
|
|
16655
16742
|
function GetDevicePixelRatio()
|
|
@@ -17297,8 +17384,8 @@ function IChartFramePainting()
|
|
|
17297
17384
|
this.XSplitOperator; //X轴分割
|
|
17298
17385
|
this.Data; //主数据
|
|
17299
17386
|
|
|
17300
|
-
this.
|
|
17301
|
-
this.
|
|
17387
|
+
this.LockPaint = null; //锁图形
|
|
17388
|
+
this.IndexLock=new IndexLockData(); //指标锁
|
|
17302
17389
|
|
|
17303
17390
|
this.YSpecificMaxMin=null; //指定Y轴最大最小值
|
|
17304
17391
|
this.IsShowBorder = true; //是否显示边框
|
|
@@ -17570,15 +17657,8 @@ function IChartFramePainting()
|
|
|
17570
17657
|
|
|
17571
17658
|
this.DrawLock=function()
|
|
17572
17659
|
{
|
|
17573
|
-
if (this.
|
|
17574
|
-
|
|
17575
|
-
if (this.LockPaint == null)
|
|
17576
|
-
this.LockPaint = g_ChartPaintFactory.Create("ChartLock");//new ChartLock();
|
|
17577
|
-
this.LockPaint.Canvas=this.Canvas;
|
|
17578
|
-
this.LockPaint.ChartBorder=this.ChartBorder;
|
|
17579
|
-
this.LockPaint.ChartFrame=this;
|
|
17580
|
-
this.LockPaint.Draw(true);
|
|
17581
|
-
}
|
|
17660
|
+
if (!this.LockPaint) return;
|
|
17661
|
+
this.LockPaint.Draw(true);
|
|
17582
17662
|
}
|
|
17583
17663
|
|
|
17584
17664
|
this.DrawLogo=function()
|
|
@@ -17634,46 +17714,28 @@ function IChartFramePainting()
|
|
|
17634
17714
|
}
|
|
17635
17715
|
}
|
|
17636
17716
|
|
|
17637
|
-
this.CalculateLock=function()
|
|
17717
|
+
this.CalculateLock=function(aryData)
|
|
17638
17718
|
{
|
|
17639
|
-
|
|
17640
|
-
|
|
17641
|
-
if (this.LockPaint == null)
|
|
17642
|
-
this.LockPaint = g_ChartPaintFactory.Create("ChartLock"); // new ChartLock();
|
|
17643
|
-
this.LockPaint.Canvas=this.Canvas;
|
|
17644
|
-
this.LockPaint.ChartBorder=this.ChartBorder;
|
|
17645
|
-
this.LockPaint.ChartFrame=this;
|
|
17646
|
-
this.LockPaint.Draw(false);
|
|
17647
|
-
}
|
|
17719
|
+
this.LockPaint.SetData(aryData);
|
|
17720
|
+
this.LockPaint.Draw(false);
|
|
17648
17721
|
}
|
|
17649
17722
|
|
|
17650
|
-
|
|
17651
|
-
this.
|
|
17723
|
+
//创建锁图形
|
|
17724
|
+
this.CreateLockPaint=function()
|
|
17652
17725
|
{
|
|
17653
|
-
|
|
17654
|
-
|
|
17655
|
-
|
|
17656
|
-
|
|
17657
|
-
|
|
17658
|
-
|
|
17659
|
-
this.IsLocked=true;
|
|
17660
|
-
if (!this.LockPaint) this.LockPaint=g_ChartPaintFactory.Create("ChartLock"); //new ChartLock(); //创建锁
|
|
17726
|
+
this.LockPaint = g_ChartPaintFactory.Create("ChartLock"); // new ChartLock();
|
|
17727
|
+
this.LockPaint.Canvas=this.Canvas;
|
|
17728
|
+
this.LockPaint.ChartBorder=this.ChartBorder;
|
|
17729
|
+
this.LockPaint.ChartFrame=this;
|
|
17730
|
+
}
|
|
17661
17731
|
|
|
17662
|
-
|
|
17663
|
-
|
|
17664
|
-
|
|
17665
|
-
if (lockData.ID) this.LockPaint.LockID=lockData.ID; //锁ID
|
|
17666
|
-
if (lockData.BG) this.LockPaint.BGColor=lockData.BG; //背景色
|
|
17667
|
-
if (lockData.Text) this.LockPaint.Title= lockData.Text;
|
|
17668
|
-
if (lockData.TextColor) this.LockPaint.TextColor=lockData.TextColor;
|
|
17669
|
-
if (lockData.Font) this.LockPaint.Font=lockData.Font;
|
|
17670
|
-
if (lockData.Count) this.LockPaint.LockCount=lockData.Count;
|
|
17671
|
-
if (lockData.MinWidth>0) this.LockPaint.MinWidth=lockData.MinWidth;
|
|
17732
|
+
this.SetLock=function(lockData)
|
|
17733
|
+
{
|
|
17734
|
+
this.IndexLock.SetData(lockData);
|
|
17672
17735
|
}
|
|
17673
17736
|
|
|
17674
17737
|
this.GetLockRect=function()
|
|
17675
17738
|
{
|
|
17676
|
-
if (!this.IsLocked) return null;
|
|
17677
17739
|
if (!this.LockPaint) return null;
|
|
17678
17740
|
return this.LockPaint.LockRect;
|
|
17679
17741
|
}
|
|
@@ -20430,7 +20492,7 @@ function AverageWidthFrame()
|
|
|
20430
20492
|
|
|
20431
20493
|
if (this.ClassName=="MinuteFrame" || this.ClassName=="KLineFrame")
|
|
20432
20494
|
{
|
|
20433
|
-
this.DivFrameToolbar=new JSDivFrameToolbar();
|
|
20495
|
+
this.DivFrameToolbar=g_JSDOMFactory.Create('JSDivFrameToolbar');//new JSDivFrameToolbar();
|
|
20434
20496
|
this.DivFrameToolbar.HQChart=hqchart;
|
|
20435
20497
|
this.DivFrameToolbar.DivHQChart=divHQChart;
|
|
20436
20498
|
this.DivFrameToolbar.FrameID=frameID;
|
|
@@ -22710,6 +22772,13 @@ function OverlayMinuteFrame()
|
|
|
22710
22772
|
this.IsShareY=false; //使用和主框架公用Y轴
|
|
22711
22773
|
this.IsCalculateYMaxMin=true; //是否计算Y最大最小值
|
|
22712
22774
|
this.IsShowMainFrame=0; //是否显示在主框架坐标上 1=左边 2=右边
|
|
22775
|
+
this.MainFrame=null; //主框架
|
|
22776
|
+
|
|
22777
|
+
this.GetLockRect=function()
|
|
22778
|
+
{
|
|
22779
|
+
if (!this.MainFrame || !this.MainFrame.GetLockRect) return null;
|
|
22780
|
+
return this.MainFrame.GetLockRect();
|
|
22781
|
+
}
|
|
22713
22782
|
|
|
22714
22783
|
this.Draw=function()
|
|
22715
22784
|
{
|
|
@@ -22768,6 +22837,13 @@ function OverlayMinuteHScreenFrame()
|
|
|
22768
22837
|
|
|
22769
22838
|
this.ClassName="OverlayMinuteHScreenFrame";
|
|
22770
22839
|
this.IsShow=true; //坐标是否显示
|
|
22840
|
+
this.MainFrame=null; //主框架
|
|
22841
|
+
|
|
22842
|
+
this.GetLockRect=function()
|
|
22843
|
+
{
|
|
22844
|
+
if (!this.MainFrame || !this.MainFrame.GetLockRect) return null;
|
|
22845
|
+
return this.MainFrame.GetLockRect();
|
|
22846
|
+
}
|
|
22771
22847
|
|
|
22772
22848
|
this.Draw=function()
|
|
22773
22849
|
{
|
|
@@ -24155,6 +24231,12 @@ function OverlayKLineFrame()
|
|
|
24155
24231
|
}
|
|
24156
24232
|
}
|
|
24157
24233
|
|
|
24234
|
+
this.GetLockRect=function()
|
|
24235
|
+
{
|
|
24236
|
+
if (!this.MainFrame || !this.MainFrame.GetLockRect) return null;
|
|
24237
|
+
return this.MainFrame.GetLockRect();
|
|
24238
|
+
}
|
|
24239
|
+
|
|
24158
24240
|
this.Draw=function()
|
|
24159
24241
|
{
|
|
24160
24242
|
this.Buttons=[];
|
|
@@ -25467,6 +25549,12 @@ function OverlayKLineHScreenFrame()
|
|
|
25467
25549
|
this.TitleColor=g_JSChartResource.OverlayFrame.TitleColor;
|
|
25468
25550
|
this.TitleFont=g_JSChartResource.OverlayFrame.TitleFont;
|
|
25469
25551
|
|
|
25552
|
+
this.GetLockRect=function()
|
|
25553
|
+
{
|
|
25554
|
+
if (!this.MainFrame || !this.MainFrame.GetLockRect) return null;
|
|
25555
|
+
return this.MainFrame.GetLockRect();
|
|
25556
|
+
}
|
|
25557
|
+
|
|
25470
25558
|
this.Draw=function()
|
|
25471
25559
|
{
|
|
25472
25560
|
this.SplitXYCoordinate();
|
|
@@ -26673,7 +26761,7 @@ function HQTradeFrame()
|
|
|
26673
26761
|
|
|
26674
26762
|
this.DrawLock=function()
|
|
26675
26763
|
{
|
|
26676
|
-
for (var i
|
|
26764
|
+
for (var i=0; i<this.SubFrame.length; ++i)
|
|
26677
26765
|
{
|
|
26678
26766
|
var item = this.SubFrame[i];
|
|
26679
26767
|
item.Frame.DrawLock();
|
|
@@ -26695,10 +26783,21 @@ function HQTradeFrame()
|
|
|
26695
26783
|
|
|
26696
26784
|
this.CalculateLock=function()
|
|
26697
26785
|
{
|
|
26698
|
-
for (var i
|
|
26786
|
+
for (var i=0, j=0; i<this.SubFrame.length; ++i)
|
|
26699
26787
|
{
|
|
26700
26788
|
var item = this.SubFrame[i];
|
|
26701
|
-
|
|
26789
|
+
var aryLockData=[];
|
|
26790
|
+
if (item.Frame.IndexLock.IsLocked) aryLockData.push({ Data:item.Frame.IndexLock, IsOverlay:false });
|
|
26791
|
+
for(j=0; j<item.OverlayIndex.length; ++j)
|
|
26792
|
+
{
|
|
26793
|
+
var subItem=item.OverlayIndex[j];
|
|
26794
|
+
if (subItem.Frame.IndexLock.IsLocked===true)
|
|
26795
|
+
{
|
|
26796
|
+
aryLockData.push({ Data:subItem.Frame.IndexLock, IsOverlay:true } );
|
|
26797
|
+
}
|
|
26798
|
+
}
|
|
26799
|
+
|
|
26800
|
+
item.Frame.CalculateLock(aryLockData);
|
|
26702
26801
|
}
|
|
26703
26802
|
}
|
|
26704
26803
|
|
|
@@ -30938,9 +31037,20 @@ function IChartPainting()
|
|
|
30938
31037
|
var x=left+width/2;
|
|
30939
31038
|
var y=top+height/2;
|
|
30940
31039
|
|
|
31040
|
+
var bHScreen=this.ChartFrame.IsHScreen;
|
|
31041
|
+
if (bHScreen)
|
|
31042
|
+
{
|
|
31043
|
+
this.Canvas.save();
|
|
31044
|
+
this.Canvas.translate(x, y);
|
|
31045
|
+
this.Canvas.rotate(90 * Math.PI / 180);
|
|
31046
|
+
x=0,y=0;
|
|
31047
|
+
}
|
|
31048
|
+
|
|
30941
31049
|
this.Canvas.textAlign="center";
|
|
30942
31050
|
this.Canvas.textBaseline="middle";
|
|
30943
31051
|
this.Canvas.fillText(this.NotSupportMessage,x,y);
|
|
31052
|
+
|
|
31053
|
+
if (bHScreen) this.Canvas.restore();
|
|
30944
31054
|
}
|
|
30945
31055
|
|
|
30946
31056
|
this.GetTooltipData=function(x,y,tooltip)
|
|
@@ -42845,6 +42955,13 @@ function ChartStickLine()
|
|
|
42845
42955
|
xOffset=this.ChartBorder.GetTop()+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;
|
|
42846
42956
|
}
|
|
42847
42957
|
|
|
42958
|
+
var lockRect=this.GetLockRect();
|
|
42959
|
+
if (lockRect)
|
|
42960
|
+
{
|
|
42961
|
+
if (this.IsHScreen) chartright=lockRect.Top;
|
|
42962
|
+
else chartright=lockRect.Left;
|
|
42963
|
+
}
|
|
42964
|
+
|
|
42848
42965
|
var isMinute=this.IsMinuteFrame();
|
|
42849
42966
|
|
|
42850
42967
|
if (isMinute)
|
|
@@ -51920,6 +52037,39 @@ function ChartDrawFlagText()
|
|
|
51920
52037
|
}
|
|
51921
52038
|
}
|
|
51922
52039
|
|
|
52040
|
+
function IndexLockData()
|
|
52041
|
+
{
|
|
52042
|
+
this.IsLocked=false;
|
|
52043
|
+
this.LockCount = 20; // 锁最新的几个数据
|
|
52044
|
+
this.BGColor = g_JSChartResource.IndexLock.BGColor;
|
|
52045
|
+
this.TextColor = g_JSChartResource.IndexLock.TextColor;
|
|
52046
|
+
this.Font = g_JSChartResource.IndexLock.Font;
|
|
52047
|
+
this.Title = g_JSChartResource.IndexLock.Title;
|
|
52048
|
+
this.LockID; //锁ID
|
|
52049
|
+
this.IndexName; //指标名字
|
|
52050
|
+
this.IndexID; //指标ID
|
|
52051
|
+
|
|
52052
|
+
this.SetData=function(lockData)
|
|
52053
|
+
{
|
|
52054
|
+
if (!lockData) //空 解锁
|
|
52055
|
+
{
|
|
52056
|
+
this.IsLocked=false;
|
|
52057
|
+
return;
|
|
52058
|
+
}
|
|
52059
|
+
|
|
52060
|
+
this.IsLocked=true;
|
|
52061
|
+
if (lockData.Callback) this.Callback=lockData.Callback; //回调 !!废弃
|
|
52062
|
+
if (lockData.IndexName) this.IndexName=lockData.IndexName; //指标名字
|
|
52063
|
+
if (lockData.IndexID) this.IndexID=lockData.IndexID; //指标ID
|
|
52064
|
+
if (lockData.ID) this.LockID=lockData.ID; //锁ID
|
|
52065
|
+
if (lockData.BG) this.BGColor=lockData.BG; //背景色
|
|
52066
|
+
if (lockData.Text) this.Title= lockData.Text;
|
|
52067
|
+
if (lockData.TextColor) this.TextColor=lockData.TextColor;
|
|
52068
|
+
if (lockData.Font) this.Font=lockData.Font;
|
|
52069
|
+
if (lockData.Count) this.LockCount=lockData.Count;
|
|
52070
|
+
}
|
|
52071
|
+
}
|
|
52072
|
+
|
|
51923
52073
|
//锁 支持横屏
|
|
51924
52074
|
function ChartLock()
|
|
51925
52075
|
{
|
|
@@ -51928,17 +52078,41 @@ function ChartLock()
|
|
|
51928
52078
|
delete this.newMethod;
|
|
51929
52079
|
|
|
51930
52080
|
this.ClassName="ChartLock";
|
|
52081
|
+
this.AryData=null;
|
|
52082
|
+
this.LockRect=null; //上锁区域
|
|
52083
|
+
|
|
51931
52084
|
this.LockCount = 20; // 锁最新的几个数据
|
|
51932
52085
|
this.BGColor = g_JSChartResource.IndexLock.BGColor;
|
|
51933
52086
|
this.TextColor = g_JSChartResource.IndexLock.TextColor;
|
|
51934
52087
|
this.Font = g_JSChartResource.IndexLock.Font;
|
|
51935
52088
|
this.Title = g_JSChartResource.IndexLock.Title;
|
|
51936
|
-
|
|
52089
|
+
|
|
51937
52090
|
this.LockID; //锁ID
|
|
51938
52091
|
this.Callback; //回调
|
|
51939
52092
|
this.IndexName; //指标名字
|
|
51940
52093
|
this.IndexID; //指标ID
|
|
51941
52094
|
|
|
52095
|
+
this.MinWidthText=" 付费指标 "
|
|
52096
|
+
|
|
52097
|
+
this.SetData=function(aryData)
|
|
52098
|
+
{
|
|
52099
|
+
this.AryData=aryData;
|
|
52100
|
+
|
|
52101
|
+
if (IFrameSplitOperator.IsNonEmptyArray(this.AryData))
|
|
52102
|
+
{
|
|
52103
|
+
var item=this.AryData[0].Data; //取第一个锁
|
|
52104
|
+
|
|
52105
|
+
this.LockCount = item.LockCount;
|
|
52106
|
+
this.BGColor = item.BGColor
|
|
52107
|
+
this.TextColor = item.TextColor
|
|
52108
|
+
this.Font = item.Font
|
|
52109
|
+
this.Title = item.Title
|
|
52110
|
+
this.LockID=item.LockID; //锁ID
|
|
52111
|
+
this.Callback=item.Callback; //回调
|
|
52112
|
+
this.IndexName=item.IndexName; //指标名字
|
|
52113
|
+
this.IndexID=item.IndexID; //指标ID
|
|
52114
|
+
}
|
|
52115
|
+
}
|
|
51942
52116
|
|
|
51943
52117
|
this.CalculateTextSize=function(aryText, defaultFont, out)
|
|
51944
52118
|
{
|
|
@@ -51960,7 +52134,7 @@ function ChartLock()
|
|
|
51960
52134
|
}
|
|
51961
52135
|
else
|
|
51962
52136
|
{
|
|
51963
|
-
|
|
52137
|
+
if (item.Font)
|
|
51964
52138
|
{
|
|
51965
52139
|
this.Canvas.font=item.Font;
|
|
51966
52140
|
lineHeight=this.Canvas.measureText("擎").width;
|
|
@@ -52006,12 +52180,7 @@ function ChartLock()
|
|
|
52006
52180
|
this.Draw=function(bDraw)
|
|
52007
52181
|
{
|
|
52008
52182
|
this.LockRect=null;
|
|
52009
|
-
if (!
|
|
52010
|
-
if (this.NotSupportMessage)
|
|
52011
|
-
{
|
|
52012
|
-
this.DrawNotSupportmessage();
|
|
52013
|
-
return;
|
|
52014
|
-
}
|
|
52183
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(this.AryData)) return;
|
|
52015
52184
|
|
|
52016
52185
|
var bHScreen=this.ChartFrame.IsHScreen;
|
|
52017
52186
|
var bMinute=this.IsMinuteFrame();
|
|
@@ -52052,35 +52221,59 @@ function ChartLock()
|
|
|
52052
52221
|
}
|
|
52053
52222
|
}
|
|
52054
52223
|
|
|
52224
|
+
this.Canvas.font=this.Font;
|
|
52225
|
+
var minWidth=this.Canvas.measureText(this.MinWidthText).width;
|
|
52226
|
+
|
|
52227
|
+
var aryText=null;
|
|
52228
|
+
if (Array.isArray(this.Title)) aryText=this.Title;
|
|
52229
|
+
else aryText=[{Text:this.Title}];
|
|
52230
|
+
|
|
52231
|
+
var outSize={ };
|
|
52232
|
+
if (!this.CalculateTextSize(aryText, this.Font, outSize)) outSize=null;
|
|
52233
|
+
if (outSize && outSize.Width+8>minWidth) minWidth=outSize.Width+8; //确保文字可以显示
|
|
52234
|
+
|
|
52055
52235
|
if (bHScreen)
|
|
52056
52236
|
{
|
|
52057
52237
|
var rtBG={ Left:border.Left, Right:border.RightEx, Top:left, Bottom:border.Bottom };
|
|
52058
52238
|
rtBG.Width=rtBG.Right-rtBG.Left;
|
|
52059
52239
|
rtBG.Height=rtBG.Bottom-rtBG.Top;
|
|
52060
|
-
|
|
52061
|
-
|
|
52062
|
-
|
|
52063
|
-
|
|
52240
|
+
if (rtBG.Height<minWidth)
|
|
52241
|
+
{
|
|
52242
|
+
rtBG.Height=minWidth;
|
|
52243
|
+
rtBG.Top=rtBG.Bottom-rtBG.Height;
|
|
52244
|
+
}
|
|
52064
52245
|
this.LockRect=rtBG; //保存上锁区域
|
|
52246
|
+
|
|
52247
|
+
if (bDraw)
|
|
52248
|
+
{
|
|
52249
|
+
var bgColor=this.SetFillStyle(this.BGColor, rtBG.Left, rtBG.Top, rtBG.Right, rtBG.Top);
|
|
52250
|
+
this.Canvas.fillStyle =bgColor;
|
|
52251
|
+
this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
|
|
52252
|
+
}
|
|
52065
52253
|
}
|
|
52066
52254
|
else
|
|
52067
52255
|
{
|
|
52068
52256
|
var rtBG={ Left:left, Right:border.RightEx, Top:border.TopTitle, Bottom:border.Bottom };
|
|
52069
52257
|
rtBG.Width=rtBG.Right-rtBG.Left;
|
|
52070
52258
|
rtBG.Height=rtBG.Bottom-rtBG.Top;
|
|
52071
|
-
|
|
52072
|
-
|
|
52073
|
-
|
|
52074
|
-
|
|
52259
|
+
if (rtBG.Width<minWidth)
|
|
52260
|
+
{
|
|
52261
|
+
rtBG.Width=minWidth;
|
|
52262
|
+
rtBG.Left=rtBG.Right-rtBG.Width;
|
|
52263
|
+
}
|
|
52075
52264
|
this.LockRect=rtBG; //保存上锁区域
|
|
52265
|
+
|
|
52266
|
+
if (bDraw)
|
|
52267
|
+
{
|
|
52268
|
+
//上下渐变
|
|
52269
|
+
var bgColor=this.SetFillStyle(this.BGColor, rtBG.Left, rtBG.Top, rtBG.Left, rtBG.Bottom);
|
|
52270
|
+
this.Canvas.fillStyle =bgColor;
|
|
52271
|
+
this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
|
|
52272
|
+
}
|
|
52076
52273
|
}
|
|
52077
52274
|
|
|
52078
|
-
|
|
52079
|
-
if (
|
|
52080
|
-
else aryText=[{Text:this.Title}];
|
|
52081
|
-
|
|
52082
|
-
var outSize={ };
|
|
52083
|
-
if (!this.CalculateTextSize(aryText, this.Font, outSize)) return;
|
|
52275
|
+
if (!bDraw) return;
|
|
52276
|
+
if (!outSize) return;
|
|
52084
52277
|
|
|
52085
52278
|
this.Canvas.textAlign='left';
|
|
52086
52279
|
this.Canvas.textBaseline='bottom';
|
|
@@ -52091,67 +52284,54 @@ function ChartLock()
|
|
|
52091
52284
|
var top=rtBG.Top+(rtBG.Height-outSize.Width)/2;
|
|
52092
52285
|
if (outSize.Width>rtBG.Height) top=rtBG.Bottom-outSize.Width;
|
|
52093
52286
|
var left=rtBG.Left+(rtBG.Width-outSize.Height)/2;
|
|
52094
|
-
|
|
52095
52287
|
this.Canvas.save();
|
|
52096
52288
|
this.Canvas.translate(left, top);
|
|
52097
52289
|
this.Canvas.rotate(90 * Math.PI / 180);
|
|
52098
|
-
var
|
|
52099
|
-
for(var i=0;i<outSize.AryText.length;++i)
|
|
52100
|
-
{
|
|
52101
|
-
var item=outSize.AryText[i];
|
|
52102
|
-
if (item.Color) this.Canvas.fillStyle=item.Color;
|
|
52103
|
-
else this.Canvas.fillStyle=this.TextColor;
|
|
52104
|
-
|
|
52105
|
-
if (item.Font) this.Canvas.font = item.Font;
|
|
52106
|
-
else this.Canvas.font = this.Font;
|
|
52107
|
-
|
|
52108
|
-
yText+=item.Height;
|
|
52109
|
-
this.Canvas.fillText(item.Text, xText, yText+item.YOffset);
|
|
52110
|
-
}
|
|
52111
|
-
|
|
52112
|
-
this.Canvas.restore();
|
|
52290
|
+
var left=0,top=0;
|
|
52113
52291
|
}
|
|
52114
52292
|
else
|
|
52115
52293
|
{
|
|
52116
52294
|
var left=rtBG.Left+(rtBG.Width-outSize.Width)/2;
|
|
52117
52295
|
if (outSize.Width>rtBG.Width) left=rtBG.Right-outSize.Width;
|
|
52118
52296
|
var top=rtBG.Top+(rtBG.Height-outSize.Height)/2;
|
|
52119
|
-
|
|
52120
|
-
|
|
52121
|
-
|
|
52297
|
+
}
|
|
52298
|
+
|
|
52299
|
+
var yText=top, xText=left;
|
|
52300
|
+
for(var i=0;i<outSize.AryText.length;++i)
|
|
52301
|
+
{
|
|
52302
|
+
var item=outSize.AryText[i];
|
|
52303
|
+
xText=left;
|
|
52304
|
+
if (item.Image)
|
|
52122
52305
|
{
|
|
52123
|
-
|
|
52124
|
-
if (item.Image)
|
|
52306
|
+
if (item.Align===1)
|
|
52125
52307
|
{
|
|
52126
|
-
xText
|
|
52127
|
-
if (item.Align===1)
|
|
52128
|
-
{
|
|
52129
|
-
if (outSize.Width>item.Width) xText+=(outSize.Width-item.Width)/2;
|
|
52130
|
-
}
|
|
52131
|
-
|
|
52132
|
-
this.Canvas.drawImage(item.Image.Data, xText, yText, item.Image.Width, item.Image.Height);
|
|
52133
|
-
|
|
52134
|
-
yText+=item.Height;
|
|
52308
|
+
if (outSize.Width>item.Width) xText+=(outSize.Width-item.Width)/2;
|
|
52135
52309
|
}
|
|
52136
|
-
else
|
|
52137
|
-
{
|
|
52138
|
-
if (item.Color) this.Canvas.fillStyle=item.Color;
|
|
52139
|
-
else this.Canvas.fillStyle=this.TextColor;
|
|
52140
52310
|
|
|
52141
|
-
|
|
52142
|
-
else this.Canvas.font = this.Font;
|
|
52311
|
+
this.Canvas.drawImage(item.Image.Data, xText, yText, item.Image.Width, item.Image.Height);
|
|
52143
52312
|
|
|
52144
|
-
|
|
52145
|
-
|
|
52146
|
-
|
|
52147
|
-
|
|
52148
|
-
|
|
52149
|
-
|
|
52313
|
+
yText+=item.Height;
|
|
52314
|
+
}
|
|
52315
|
+
else
|
|
52316
|
+
{
|
|
52317
|
+
if (item.Color) this.Canvas.fillStyle=item.Color;
|
|
52318
|
+
else this.Canvas.fillStyle=this.TextColor;
|
|
52150
52319
|
|
|
52151
|
-
|
|
52320
|
+
if (item.Font) this.Canvas.font = item.Font;
|
|
52321
|
+
else this.Canvas.font = this.Font;
|
|
52322
|
+
|
|
52323
|
+
yText+=item.Height;
|
|
52324
|
+
|
|
52325
|
+
if (item.Align===1)
|
|
52326
|
+
{
|
|
52327
|
+
if (outSize.Width>item.Width) xText+=(outSize.Width-item.Width)/2;
|
|
52152
52328
|
}
|
|
52153
|
-
|
|
52329
|
+
|
|
52330
|
+
this.Canvas.fillText(item.Text, xText, yText+item.YOffset);
|
|
52331
|
+
}
|
|
52154
52332
|
}
|
|
52333
|
+
|
|
52334
|
+
if (bHScreen) this.Canvas.restore();
|
|
52155
52335
|
}
|
|
52156
52336
|
|
|
52157
52337
|
//x,y是否在上锁区域
|
|
@@ -52161,7 +52341,7 @@ function ChartLock()
|
|
|
52161
52341
|
|
|
52162
52342
|
if (Path2DHelper.PtInRect(x,y,this.LockRect))
|
|
52163
52343
|
{
|
|
52164
|
-
tooltip.Data={ ID:this.LockID, Callback:this.Callback, IndexName:this.IndexName, IndexID:this.IndexID };
|
|
52344
|
+
tooltip.Data={ ID:this.LockID, Callback:this.Callback, IndexName:this.IndexName, IndexID:this.IndexID, Data:this.AryData };
|
|
52165
52345
|
tooltip.ChartPaint=this;
|
|
52166
52346
|
return true;
|
|
52167
52347
|
}
|
|
@@ -87118,6 +87298,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
87118
87298
|
frame.GetEventCallback=(id)=> { return this.GetEventCallback(id); };
|
|
87119
87299
|
frame.GlobalOption=this.GlobalOption;
|
|
87120
87300
|
frame.CreateDivFrameToolbar(this, i, this.UIElement.parentNode);
|
|
87301
|
+
frame.CreateLockPaint();
|
|
87121
87302
|
|
|
87122
87303
|
frame.HorizontalMax=20;
|
|
87123
87304
|
frame.HorizontalMin=10;
|
|
@@ -87219,6 +87400,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
87219
87400
|
frame.XSplitOperator.Symbol=this.Symbol;
|
|
87220
87401
|
frame.XSplitOperator.Period=this.Period;
|
|
87221
87402
|
frame.CreateDivFrameToolbar(this, id, this.UIElement.parentNode);
|
|
87403
|
+
frame.CreateLockPaint();
|
|
87222
87404
|
|
|
87223
87405
|
//K线数据绑定
|
|
87224
87406
|
var xPointCouont=this.Frame.SubFrame[0].Frame.XPointCount;
|
|
@@ -89678,7 +89860,6 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
89678
89860
|
|
|
89679
89861
|
|
|
89680
89862
|
subFrame.YSpecificMaxMin=null; //清空指定最大最小值
|
|
89681
|
-
subFrame.IsLocked=false; //解除上锁
|
|
89682
89863
|
subFrame.YSplitScale = null; //清空固定刻度
|
|
89683
89864
|
subFrame.YSplitOperator.SplitType=subFrame.YSplitOperator.DefaultSplitType; //还原Y坐标分割模式
|
|
89684
89865
|
|
|
@@ -89976,7 +90157,6 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
89976
90157
|
|
|
89977
90158
|
|
|
89978
90159
|
this.Frame.SubFrame[windowIndex].Frame.YSpecificMaxMin=null; //清空指定最大最小值
|
|
89979
|
-
this.Frame.SubFrame[windowIndex].Frame.IsLocked=false; //解除上锁
|
|
89980
90160
|
this.Frame.SubFrame[windowIndex].Frame.YSplitScale = null; //清空固定刻度
|
|
89981
90161
|
|
|
89982
90162
|
this.ChartPaint=paint;
|
|
@@ -90034,7 +90214,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
90034
90214
|
}
|
|
90035
90215
|
else if (obj.Script) //动态执行脚本
|
|
90036
90216
|
{
|
|
90037
|
-
indexInfo={ Script:obj.Script, ID:obj.
|
|
90217
|
+
indexInfo={ Script:obj.Script, ID:obj.IndexName, Name:obj.IndexName};
|
|
90038
90218
|
if (obj.Name) indexInfo.Name=obj.Name;
|
|
90039
90219
|
}
|
|
90040
90220
|
else
|
|
@@ -90369,7 +90549,6 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
90369
90549
|
this.DeleteIndexPaint(i);
|
|
90370
90550
|
var frame=this.Frame.SubFrame[i];
|
|
90371
90551
|
frame.YSpecificMaxMin=null;
|
|
90372
|
-
frame.IsLocked=false;
|
|
90373
90552
|
frame.YSplitScale = null;
|
|
90374
90553
|
}
|
|
90375
90554
|
|
|
@@ -90749,51 +90928,6 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
90749
90928
|
}
|
|
90750
90929
|
}
|
|
90751
90930
|
|
|
90752
|
-
//锁|解锁指标 { Index:指标名字,IsLocked:是否要锁上,Callback:回调 }
|
|
90753
|
-
this.LockIndex=function(lockData)
|
|
90754
|
-
{
|
|
90755
|
-
if (!lockData) return;
|
|
90756
|
-
if (!lockData.IndexName) return;
|
|
90757
|
-
|
|
90758
|
-
for(let i in this.WindowIndex)
|
|
90759
|
-
{
|
|
90760
|
-
let item=this.WindowIndex[i];
|
|
90761
|
-
if (!item) conintue;
|
|
90762
|
-
if (item.Name==lockData.IndexName)
|
|
90763
|
-
{
|
|
90764
|
-
item.SetLock(lockData);
|
|
90765
|
-
this.Update();
|
|
90766
|
-
break;
|
|
90767
|
-
}
|
|
90768
|
-
}
|
|
90769
|
-
}
|
|
90770
|
-
|
|
90771
|
-
this.TryClickLock=function(x,y)
|
|
90772
|
-
{
|
|
90773
|
-
for(var i=0;i<this.Frame.SubFrame.length; ++i)
|
|
90774
|
-
{
|
|
90775
|
-
var item=this.Frame.SubFrame[i];
|
|
90776
|
-
if (!item.Frame.IsLocked) continue;
|
|
90777
|
-
if (!item.Frame.LockPaint) continue;
|
|
90778
|
-
|
|
90779
|
-
var tooltip=new TooltipData();
|
|
90780
|
-
if (!item.Frame.LockPaint.GetTooltipData(x,y,tooltip)) continue;
|
|
90781
|
-
|
|
90782
|
-
tooltip.HQChart=this;
|
|
90783
|
-
var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_INDEX_LOCK);
|
|
90784
|
-
if (event && event.Callback)
|
|
90785
|
-
{
|
|
90786
|
-
var sendData={ FrameID:item.Frame.Identify, Data:tooltip };
|
|
90787
|
-
event.Callback(event,sendData,this);
|
|
90788
|
-
}
|
|
90789
|
-
|
|
90790
|
-
if (tooltip.Data.Callback) tooltip.Data.Callback(tooltip);
|
|
90791
|
-
return true;
|
|
90792
|
-
}
|
|
90793
|
-
|
|
90794
|
-
return false;
|
|
90795
|
-
}
|
|
90796
|
-
|
|
90797
90931
|
this.TryClickIndexTitle=function(x,y)
|
|
90798
90932
|
{
|
|
90799
90933
|
for(var i in this.TitlePaint)
|
|
@@ -96783,6 +96917,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
96783
96917
|
frame.XPointCount=243;
|
|
96784
96918
|
frame.HQChart=this;
|
|
96785
96919
|
frame.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
96920
|
+
frame.CreateLockPaint();
|
|
96786
96921
|
|
|
96787
96922
|
if (i>=2)
|
|
96788
96923
|
{
|
|
@@ -96894,6 +97029,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
96894
97029
|
frame.YSplitOperator.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
96895
97030
|
frame.XSplitOperator.Symbol=this.Symbol;
|
|
96896
97031
|
frame.CreateDivFrameToolbar(this, id, this.UIElement.parentNode);
|
|
97032
|
+
frame.CreateLockPaint();
|
|
96897
97033
|
|
|
96898
97034
|
if (this.DayCount>1)
|
|
96899
97035
|
{
|
|
@@ -97019,7 +97155,6 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
97019
97155
|
//清空指定最大最小值
|
|
97020
97156
|
|
|
97021
97157
|
subFrame.YSpecificMaxMin=null;
|
|
97022
|
-
subFrame.IsLocked=false; //解除上锁
|
|
97023
97158
|
subFrame.YSplitOperator.SplitType=subFrame.YSplitOperator.DefaultSplitType; //还原Y坐标分割模式
|
|
97024
97159
|
|
|
97025
97160
|
this.ChartPaint=paint;
|
|
@@ -97252,7 +97387,6 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
97252
97387
|
this.DeleteIndexPaint(i);
|
|
97253
97388
|
var frame=this.Frame.SubFrame[i];
|
|
97254
97389
|
frame.YSpecificMaxMin=null;
|
|
97255
|
-
frame.IsLocked=false;
|
|
97256
97390
|
frame.YSplitScale = null;
|
|
97257
97391
|
}
|
|
97258
97392
|
|
|
@@ -99499,9 +99633,9 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
99499
99633
|
{
|
|
99500
99634
|
overlayFrame=new OverlayIndexItem();
|
|
99501
99635
|
overlayFrame.Identify='Position_Line_Frame';
|
|
99502
|
-
|
|
99503
|
-
if (this.ClassName=="MinuteChartContainer") frame=new OverlayMinuteFrame();
|
|
99504
|
-
else frame=new OverlayMinuteHScreenFrame();
|
|
99636
|
+
frame=this.CreateOverlayFrame();
|
|
99637
|
+
//if (this.ClassName=="MinuteChartContainer") frame=new OverlayMinuteFrame();
|
|
99638
|
+
//else frame=new OverlayMinuteHScreenFrame();
|
|
99505
99639
|
|
|
99506
99640
|
frame.Canvas=this.Canvas;
|
|
99507
99641
|
frame.MainFrame=subFrame.Frame;
|
|
@@ -99684,9 +99818,9 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
99684
99818
|
var subFrame=this.Frame.SubFrame[windowIndex];
|
|
99685
99819
|
var overlayFrame=new OverlayIndexItem();
|
|
99686
99820
|
if (obj.Identify) overlayFrame.Identify=obj.Identify; //由外部指定id
|
|
99687
|
-
var frame=
|
|
99688
|
-
if (this.ClassName=="MinuteChartContainer") frame=new OverlayMinuteFrame();
|
|
99689
|
-
else frame=new OverlayMinuteHScreenFrame();
|
|
99821
|
+
var frame=this.CreateOverlayFrame();
|
|
99822
|
+
//if (this.ClassName=="MinuteChartContainer") frame=new OverlayMinuteFrame();
|
|
99823
|
+
//else frame=new OverlayMinuteHScreenFrame();
|
|
99690
99824
|
frame.Canvas=this.Canvas;
|
|
99691
99825
|
frame.MainFrame=subFrame.Frame;
|
|
99692
99826
|
frame.ChartBorder=subFrame.Frame.ChartBorder;
|
|
@@ -100600,25 +100734,6 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
100600
100734
|
|
|
100601
100735
|
return false;
|
|
100602
100736
|
}
|
|
100603
|
-
|
|
100604
|
-
this.TryClickLock=function(x,y)
|
|
100605
|
-
{
|
|
100606
|
-
for(var i=0;i<this.Frame.SubFrame.length; ++i)
|
|
100607
|
-
{
|
|
100608
|
-
var item=this.Frame.SubFrame[i];
|
|
100609
|
-
if (!item.Frame.IsLocked) continue;
|
|
100610
|
-
if (!item.Frame.LockPaint) continue;
|
|
100611
|
-
|
|
100612
|
-
var tooltip=new TooltipData();
|
|
100613
|
-
if (!item.Frame.LockPaint.GetTooltipData(x,y,tooltip)) continue;
|
|
100614
|
-
|
|
100615
|
-
tooltip.HQChart=this;
|
|
100616
|
-
if (tooltip.Data.Callback) tooltip.Data.Callback(tooltip);
|
|
100617
|
-
return true;
|
|
100618
|
-
}
|
|
100619
|
-
|
|
100620
|
-
return false;
|
|
100621
|
-
}
|
|
100622
100737
|
}
|
|
100623
100738
|
|
|
100624
100739
|
//盘前数据
|
|
@@ -102570,6 +102685,7 @@ function KLineChartHScreenContainer(uielement)
|
|
|
102570
102685
|
frame.RightSpaceCount=this.RightSpaceCount; //右边
|
|
102571
102686
|
frame.GetEventCallback=(id)=> { return this.GetEventCallback(id); };
|
|
102572
102687
|
frame.GlobalOption=this.GlobalOption;
|
|
102688
|
+
frame.CreateLockPaint();
|
|
102573
102689
|
|
|
102574
102690
|
frame.HorizontalMax=20;
|
|
102575
102691
|
frame.HorizontalMin=10;
|
|
@@ -102758,6 +102874,7 @@ function MinuteChartHScreenContainer(uielement)
|
|
|
102758
102874
|
frame.XPointCount=243;
|
|
102759
102875
|
frame.HQChart=this;
|
|
102760
102876
|
frame.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
102877
|
+
frame.CreateLockPaint();
|
|
102761
102878
|
|
|
102762
102879
|
var DEFAULT_HORIZONTAL=[9,8,7,6,5,4,3,2,1];
|
|
102763
102880
|
frame.HorizontalMax=DEFAULT_HORIZONTAL[0];
|
|
@@ -109533,8 +109650,6 @@ function JSDivFrameToolbar()
|
|
|
109533
109650
|
this.SetToolbar(aryButton); //重新设置按钮
|
|
109534
109651
|
}
|
|
109535
109652
|
|
|
109536
|
-
|
|
109537
|
-
|
|
109538
109653
|
this.Destroy=function()
|
|
109539
109654
|
{
|
|
109540
109655
|
if (this.DivToolbar)
|
|
@@ -109716,6 +109831,37 @@ JSDivFrameToolbar.GetDfaultButtons=function()
|
|
|
109716
109831
|
}
|
|
109717
109832
|
|
|
109718
109833
|
|
|
109834
|
+
|
|
109835
|
+
//DOM工厂类
|
|
109836
|
+
function JSDOMFactory()
|
|
109837
|
+
{
|
|
109838
|
+
//[key:name, { Create:function(divElement) { return new class(divElement); }} ]
|
|
109839
|
+
this.DataMap=new Map(
|
|
109840
|
+
[
|
|
109841
|
+
["JSDivFrameToolbar", { Create:function(option) { return new JSDivFrameToolbar(option); } }],
|
|
109842
|
+
]);
|
|
109843
|
+
|
|
109844
|
+
this.Create=function(name, option)
|
|
109845
|
+
{
|
|
109846
|
+
if (!this.DataMap.has(name))
|
|
109847
|
+
{
|
|
109848
|
+
JSConsole.Chart.Warn(`[JSDOMFactory::Create] can't find class=${name}.`);
|
|
109849
|
+
return null;
|
|
109850
|
+
}
|
|
109851
|
+
|
|
109852
|
+
var item=this.DataMap.get(name);
|
|
109853
|
+
return item.Create(option);
|
|
109854
|
+
}
|
|
109855
|
+
|
|
109856
|
+
this.Add=function(name, option)
|
|
109857
|
+
{
|
|
109858
|
+
this.DataMap.set(name, { Create:option.Create } );
|
|
109859
|
+
}
|
|
109860
|
+
}
|
|
109861
|
+
|
|
109862
|
+
var g_JSDOMFactory=new JSDOMFactory();
|
|
109863
|
+
|
|
109864
|
+
|
|
109719
109865
|
function JSToolbarTooltip()
|
|
109720
109866
|
{
|
|
109721
109867
|
this.DivTooltip=null;
|
|
@@ -130328,7 +130474,7 @@ function ScriptIndex(name,script,args,option)
|
|
|
130328
130474
|
Name:hqChart.Name,
|
|
130329
130475
|
Data:hisData,
|
|
130330
130476
|
SourceData:hqChart.SourceData,
|
|
130331
|
-
Callback:this.RecvResultData, CallbackParam:param,
|
|
130477
|
+
Callback:(arg1, arg2)=>{ this.RecvResultData(arg1, arg2); }, CallbackParam:param,
|
|
130332
130478
|
Async:true,
|
|
130333
130479
|
MaxRequestDataCount:hqChart.MaxRequestDataCount,
|
|
130334
130480
|
MaxRequestMinuteDayCount:hqChart.MaxRequestMinuteDayCount,
|
|
@@ -133017,6 +133163,18 @@ function OverlayScriptIndex(name,script,args,option)
|
|
|
133017
133163
|
param.Self.OutVar=outVar;
|
|
133018
133164
|
param.Self.BindData(hqChart,windowIndex,hisData);
|
|
133019
133165
|
|
|
133166
|
+
var frame=this.OverlayIndex.Frame.Frame;
|
|
133167
|
+
if (this.IsLocked==false) //不上锁
|
|
133168
|
+
{
|
|
133169
|
+
frame.SetLock(null);
|
|
133170
|
+
}
|
|
133171
|
+
else //上锁
|
|
133172
|
+
{
|
|
133173
|
+
let lockData={ IsLocked:true,Callback:this.LockCallback,IndexName:this.Name ,ID:this.LockID, IndexID:this.ID,
|
|
133174
|
+
BG:this.LockBG,Text:this.LockText,TextColor:this.LockTextColor, Font:this.LockFont, Count:this.LockCount, MinWidth:this.LockMinWidth };
|
|
133175
|
+
frame.SetLock(lockData);
|
|
133176
|
+
}
|
|
133177
|
+
|
|
133020
133178
|
param.HQChart.UpdataDataoffset(); //更新数据偏移
|
|
133021
133179
|
param.HQChart.UpdateFrameMaxMin(); //调整坐标最大 最小值
|
|
133022
133180
|
|
|
@@ -134877,20 +135035,20 @@ function APIScriptIndex(name,script,args,option, isOverlay)
|
|
|
134877
135035
|
}
|
|
134878
135036
|
this.BindData(hqChart,windowIndex,hisData);
|
|
134879
135037
|
|
|
134880
|
-
|
|
135038
|
+
var frame=hqChart.Frame.SubFrame[windowIndex].Frame;
|
|
135039
|
+
if (this.IsOverlayIndex) frame=this.OverlayIndex.Frame.Frame;
|
|
135040
|
+
|
|
135041
|
+
if (this.IsLocked==false) //不上锁
|
|
134881
135042
|
{
|
|
134882
|
-
|
|
134883
|
-
{
|
|
134884
|
-
hqChart.Frame.SubFrame[windowIndex].Frame.SetLock(null);
|
|
134885
|
-
}
|
|
134886
|
-
else //上锁
|
|
134887
|
-
{
|
|
134888
|
-
let lockData={ IsLocked:true,Callback:this.LockCallback,IndexName:this.Name ,ID:this.LockID,
|
|
134889
|
-
BG:this.LockBG,Text:this.LockText,TextColor:this.LockTextColor, Font:this.LockFont, Count:this.LockCount, MinWidth:this.LockMinWidth };
|
|
134890
|
-
hqChart.Frame.SubFrame[windowIndex].Frame.SetLock(lockData);
|
|
134891
|
-
}
|
|
135043
|
+
frame.SetLock(null);
|
|
134892
135044
|
}
|
|
134893
|
-
|
|
135045
|
+
else //上锁
|
|
135046
|
+
{
|
|
135047
|
+
let lockData={ IsLocked:true,Callback:this.LockCallback,IndexName:this.Name ,ID:this.LockID,IndexID:this.ID,
|
|
135048
|
+
BG:this.LockBG,Text:this.LockText,TextColor:this.LockTextColor, Font:this.LockFont, Count:this.LockCount, MinWidth:this.LockMinWidth };
|
|
135049
|
+
frame.SetLock(lockData);
|
|
135050
|
+
}
|
|
135051
|
+
|
|
134894
135052
|
hqChart.UpdataDataoffset(); //更新数据偏移
|
|
134895
135053
|
hqChart.UpdateFrameMaxMin(); //调整坐标最大 最小值
|
|
134896
135054
|
|
|
@@ -164218,7 +164376,7 @@ function JSDialogSearchIndex()
|
|
|
164218
164376
|
|
|
164219
164377
|
this.MaxRowCount=30; //行
|
|
164220
164378
|
this.ColCount=3; //列
|
|
164221
|
-
this.MaxGroupCount=
|
|
164379
|
+
this.MaxGroupCount=20; //分类最多个数
|
|
164222
164380
|
|
|
164223
164381
|
this.AryData=[];
|
|
164224
164382
|
this.AryGroup=[]; //分类
|
|
@@ -164499,12 +164657,14 @@ function JSDialogSearchIndex()
|
|
|
164499
164657
|
else if (indexItem.Type==1) //自定义脚本指标
|
|
164500
164658
|
{
|
|
164501
164659
|
var indexData={ ID:indexItem.ID, Name:indexItem.Name, Script:indexItem.Script, Args:indexItem.Args };
|
|
164660
|
+
if (indexItem.Lock) indexData.Lock=indexItem.Lock;
|
|
164502
164661
|
this.HQChart.ChangeScriptIndex(this.OpData.WindowIndex, indexData);
|
|
164503
164662
|
}
|
|
164504
164663
|
else if (indexItem.Type==2) //api指标
|
|
164505
164664
|
{
|
|
164506
|
-
var
|
|
164507
|
-
|
|
164665
|
+
var indexData={ API: { ID:indexItem.ID, Name:indexItem.Name, Args:indexItem.Args, Url:'local'} };
|
|
164666
|
+
if (indexItem.Lock) indexData.Lock=indexItem.Lock;
|
|
164667
|
+
this.HQChart.ChangeAPIIndex(this.OpData.WindowIndex, indexData);
|
|
164508
164668
|
}
|
|
164509
164669
|
else if (indexItem.Type==3) //指标模板
|
|
164510
164670
|
{
|
|
@@ -164524,11 +164684,13 @@ function JSDialogSearchIndex()
|
|
|
164524
164684
|
else if (indexItem.Type==1) //自定义脚本指标
|
|
164525
164685
|
{
|
|
164526
164686
|
var obj={ WindowIndex:this.OpData.WindowIndex, IndexName:indexItem.ID, Name:indexItem.Name, Script:indexItem.Script, Args:indexItem.Args };
|
|
164687
|
+
if (indexItem.Lock) obj.Lock=indexItem.Lock;
|
|
164527
164688
|
this.HQChart.AddOverlayIndex(obj);
|
|
164528
164689
|
}
|
|
164529
164690
|
else if (indexItem.Type==2) //api指标
|
|
164530
164691
|
{
|
|
164531
164692
|
var obj={ WindowIndex:this.OpData.WindowIndex, API: { ID:indexItem.ID, Name:indexItem.Name, Args:indexItem.Args, Url:'local'} };
|
|
164693
|
+
if (indexItem.Lock) obj.Lock=indexItem.Lock;
|
|
164532
164694
|
this.HQChart.AddOverlayIndex(obj);
|
|
164533
164695
|
}
|
|
164534
164696
|
else if (indexItem.Type==3) //指标模板
|
|
@@ -164555,6 +164717,7 @@ function JSDialogSearchIndex()
|
|
|
164555
164717
|
else if (indexItem.Type==2) //api指标
|
|
164556
164718
|
{
|
|
164557
164719
|
var indexData={ API: { ID:indexItem.ID, Name:indexItem.Name, Args:indexItem.Args, Url:'local'} };
|
|
164720
|
+
if (indexItem.Lock) indexData.Lock=indexItem.Lock;
|
|
164558
164721
|
this.HQChart.AddAPIIndexWindow(indexData, this.OpData);
|
|
164559
164722
|
}
|
|
164560
164723
|
else if (indexItem.Type==3) //指标模板
|
|
@@ -164978,8 +165141,21 @@ JSDialogSearchIndex.GetDefaultIndexData=function()
|
|
|
164978
165141
|
Group:{ ID:"自定义", Name:"自定义"} ,
|
|
164979
165142
|
AryIndex:
|
|
164980
165143
|
[
|
|
164981
|
-
{ Name:"收盘线(后台指标)", ID:"
|
|
164982
|
-
{ Name:"高低均价(自定义脚本)", ID:"HIGH_LOW_AV", Type:1,
|
|
165144
|
+
{ Name:"收盘线(后台指标)", ID:"API-DRAWTEXTREL", Type:2, Args:null },
|
|
165145
|
+
{ Name:"高低均价(自定义脚本)", ID:"HIGH_LOW_AV", Type:1, Script:"均价:(H+L)/2;高:H;低:L;", Args:[ { Name:'N', Value:20}, { Name:'M', Value:6}]},
|
|
165146
|
+
{ Name:"指标异常(后台指标)", ID:"API_ERRORMESSAGE", Type:2, Args:null,}
|
|
165147
|
+
]
|
|
165148
|
+
},
|
|
165149
|
+
{
|
|
165150
|
+
Group:{ ID:"付费指标", Name:"付费指标"} ,
|
|
165151
|
+
AryIndex:
|
|
165152
|
+
[
|
|
165153
|
+
{ Name:"面积图(后台指标)", ID:"API-DRAWBAND", Type:2, Args:null, Lock:{ IsLocked:true } },
|
|
165154
|
+
{
|
|
165155
|
+
Name:"波段量能跟庄-波段量能", ID:"TEST_INDEX_4AE0_1", Type:1, Args:null,
|
|
165156
|
+
Script:TEST_INDEX_4AE0_1,
|
|
165157
|
+
Lock:{ IsLocked:true }
|
|
165158
|
+
}
|
|
164983
165159
|
]
|
|
164984
165160
|
},
|
|
164985
165161
|
{
|
|
@@ -165479,6 +165655,25 @@ function JSDialogModifyIndexParam()
|
|
|
165479
165655
|
}
|
|
165480
165656
|
|
|
165481
165657
|
|
|
165658
|
+
/////////////////////////////////////////////////////////////////////////////////////////////
|
|
165659
|
+
//测试指标
|
|
165660
|
+
|
|
165661
|
+
var TEST_INDEX_4AE0_1=`能量:=SQRT(VOL)*(((C-(H+L)/2))/((H+L)/2));
|
|
165662
|
+
平滑能量:=EMA(能量,16);
|
|
165663
|
+
能量惯性:EMA(平滑能量,16);
|
|
165664
|
+
DRAWICON(能量惯性>0 AND REF(能量惯性,1)<0,0,1);
|
|
165665
|
+
STICKLINE(能量惯性>=0,(能量惯性-能量惯性*0.05),(能量惯性-能量惯性*0.15),3,0), COLOR0000CC;
|
|
165666
|
+
STICKLINE(能量惯性>=0,(能量惯性-能量惯性*0.2),(能量惯性-能量惯性*0.35),3,0), COLOR0066FF;
|
|
165667
|
+
STICKLINE(能量惯性>=0,(能量惯性-能量惯性*0.4),(能量惯性-能量惯性*0.55),3,0),COLOR0099FF;
|
|
165668
|
+
STICKLINE(能量惯性>=0,(能量惯性-能量惯性*0.6),(能量惯性-能量惯性*0.75),3,0), COLOR00CCFF;
|
|
165669
|
+
STICKLINE(能量惯性>=0,(能量惯性-能量惯性*0.8),(能量惯性-能量惯性*0.95),3,0), COLOR00FFFF;
|
|
165670
|
+
STICKLINE(能量惯性<0,(能量惯性-能量惯性*0.05),(能量惯性-能量惯性*0.15),3,0), COLORFF3300;
|
|
165671
|
+
STICKLINE(能量惯性<0,(能量惯性-能量惯性*0.2),(能量惯性-能量惯性*0.35),3,0), COLORFF6600;
|
|
165672
|
+
STICKLINE(能量惯性<0,(能量惯性-能量惯性*0.4),(能量惯性-能量惯性*0.55),3,0), COLORFF9900;
|
|
165673
|
+
STICKLINE(能量惯性<0,(能量惯性-能量惯性*0.6),(能量惯性-能量惯性*0.75),3,0), COLORFFCC00;
|
|
165674
|
+
STICKLINE(能量惯性<0,(能量惯性-能量惯性*0.8),(能量惯性-能量惯性*0.95),3,0), COLORFFFF00;`
|
|
165675
|
+
|
|
165676
|
+
|
|
165482
165677
|
|
|
165483
165678
|
|
|
165484
165679
|
///////////////////////////////////////////////////////////////////////////////////
|
|
@@ -165602,7 +165797,7 @@ function HQChartScriptWorker()
|
|
|
165602
165797
|
|
|
165603
165798
|
|
|
165604
165799
|
|
|
165605
|
-
var HQCHART_VERSION="1.1.
|
|
165800
|
+
var HQCHART_VERSION="1.1.15120";
|
|
165606
165801
|
|
|
165607
165802
|
function PrintHQChartVersion()
|
|
165608
165803
|
{
|
|
@@ -165769,6 +165964,7 @@ export default {
|
|
|
165769
165964
|
JSCHART_MENU_ID:JSCHART_MENU_ID,
|
|
165770
165965
|
JSCHART_TRADE_STATUS_ID:JSCHART_TRADE_STATUS_ID, //交易状态
|
|
165771
165966
|
JSCHART_CORSSCURSOR_STATUS_ID:JSCHART_CORSSCURSOR_STATUS_ID, //十字光标状态
|
|
165967
|
+
CONDITION_PERIOD:CONDITION_PERIOD, //指标周期条件枚举
|
|
165772
165968
|
},
|
|
165773
165969
|
|
|
165774
165970
|
|