hqchart 1.1.14870 → 1.1.14876
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 +28 -23
- package/package.json +1 -1
- package/src/jscommon/umychart.complier.js +59 -0
- package/src/jscommon/umychart.js +114 -31
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +174 -32
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.vue.js +174 -32
package/src/jscommon/umychart.js
CHANGED
|
@@ -261,6 +261,16 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
261
261
|
}
|
|
262
262
|
}
|
|
263
263
|
|
|
264
|
+
/////////////////////////////////////////////////////////////////////////////////
|
|
265
|
+
//属性设置
|
|
266
|
+
//
|
|
267
|
+
|
|
268
|
+
this.SetPressKeyboardConfig=function(chart, option)
|
|
269
|
+
{
|
|
270
|
+
if (!chart || !option) return;
|
|
271
|
+
if (IFrameSplitOperator.IsBool(option.PauseUpdate)) chart.PressKeyboardConfig.PauseUpdate=option.PauseUpdate;
|
|
272
|
+
}
|
|
273
|
+
|
|
264
274
|
//历史K线图
|
|
265
275
|
this.CreateKLineChartContainer=function(option)
|
|
266
276
|
{
|
|
@@ -421,6 +431,8 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
421
431
|
if (IFrameSplitOperator.IsBool(item.EnableMoveOn)) chart.SelectedChart.EnableMoveOn=item.EnableMoveOn;
|
|
422
432
|
}
|
|
423
433
|
|
|
434
|
+
if (option.PressKeyboardConfig) this.SetPressKeyboardConfig(chart, option.PressKeyboardConfig);
|
|
435
|
+
|
|
424
436
|
if (!option.Windows || option.Windows.length<=0) return null;
|
|
425
437
|
|
|
426
438
|
//K线扩展计算方法配置
|
|
@@ -998,6 +1010,8 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
998
1010
|
if (IFrameSplitOperator.IsBool(item.EnableMoveOn)) chart.SelectedChart.EnableMoveOn=item.EnableMoveOn;
|
|
999
1011
|
}
|
|
1000
1012
|
|
|
1013
|
+
if (option.PressKeyboardConfig) this.SetPressKeyboardConfig(chart, option.PressKeyboardConfig);
|
|
1014
|
+
|
|
1001
1015
|
if (chart.ClassName=="MinuteChartContainer")
|
|
1002
1016
|
{
|
|
1003
1017
|
if (!option.DragSelectRect)
|
|
@@ -1902,18 +1916,6 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
1902
1916
|
this.OnSize( {Type:1} );
|
|
1903
1917
|
}
|
|
1904
1918
|
|
|
1905
|
-
//创建工具条
|
|
1906
|
-
this.CreateToolbar=function(option)
|
|
1907
|
-
{
|
|
1908
|
-
|
|
1909
|
-
}
|
|
1910
|
-
|
|
1911
|
-
//创建设置div窗口
|
|
1912
|
-
this.CreateSettingDiv=function(option)
|
|
1913
|
-
{
|
|
1914
|
-
|
|
1915
|
-
}
|
|
1916
|
-
|
|
1917
1919
|
this.Focus=function()
|
|
1918
1920
|
{
|
|
1919
1921
|
if (this.CanvasElement) this.CanvasElement.focus();
|
|
@@ -3219,6 +3221,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
3219
3221
|
this.PressTime=500;
|
|
3220
3222
|
this.IsPress=false; //是否长按
|
|
3221
3223
|
this.IsPressKeyboard=false; //是否键盘按键
|
|
3224
|
+
this.PressKeyboardConfig={ PauseUpdate:false, }; //按键以后 是否涨停数据更新
|
|
3222
3225
|
|
|
3223
3226
|
this.NetworkFilter; //网络请求回调 function(data, callback);
|
|
3224
3227
|
this.LastMouseStatus={ MouseOnToolbar:null }; // MouseOnToolbar={ Rect:{}, Title: }
|
|
@@ -3806,6 +3809,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
3806
3809
|
|
|
3807
3810
|
this.DestroyPopMenu();
|
|
3808
3811
|
|
|
3812
|
+
if (this.DestroyPopMinuteChart) this.DestroyPopMinuteChart();
|
|
3813
|
+
|
|
3809
3814
|
this.StopLatestPointFlash();
|
|
3810
3815
|
|
|
3811
3816
|
document.oncontextmenu=null;
|
|
@@ -12115,6 +12120,16 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
12115
12120
|
|
|
12116
12121
|
return false;
|
|
12117
12122
|
}
|
|
12123
|
+
|
|
12124
|
+
//键盘下按暂停更新
|
|
12125
|
+
this.IsPauseUpdateByKeyboard=function()
|
|
12126
|
+
{
|
|
12127
|
+
if (!this.IsPressKeyboard) return false;
|
|
12128
|
+
if (!this.PressKeyboardConfig) return false;
|
|
12129
|
+
if (!this.PressKeyboardConfig.PauseUpdate) return false;
|
|
12130
|
+
|
|
12131
|
+
return true;
|
|
12132
|
+
}
|
|
12118
12133
|
}
|
|
12119
12134
|
|
|
12120
12135
|
function GetDevicePixelRatio()
|
|
@@ -33785,6 +33800,7 @@ function ChartKLineTable()
|
|
|
33785
33800
|
|
|
33786
33801
|
this.TextFont;
|
|
33787
33802
|
this.TextColor='rgb(0,0,0)';
|
|
33803
|
+
this.Style=0; //0=全部窗口模式 1=顶部指定行数 2=底部指定行数;
|
|
33788
33804
|
|
|
33789
33805
|
this.AryTableData=[];
|
|
33790
33806
|
this.MapCache=null; //key=date/date-time value={ Date:, Time:, Data:[ ] }
|
|
@@ -33810,9 +33826,15 @@ function ChartKLineTable()
|
|
|
33810
33826
|
{
|
|
33811
33827
|
if (!this.BGColor) return;
|
|
33812
33828
|
|
|
33813
|
-
|
|
33829
|
+
this.Canvas.fillStyle=this.BGColor;
|
|
33830
|
+
if ((this.Style===1 || this.Style===2) && this.RowHeightType==1)
|
|
33831
|
+
{
|
|
33832
|
+
var height=this.RowCount*this.RowHeight;
|
|
33833
|
+
height=Math.min(rtBG.Height,height);
|
|
33834
|
+
this.Canvas.fillRect(rtBG.Left+1, rtBG.Top, rtBG.Width-2, height);
|
|
33835
|
+
}
|
|
33836
|
+
else
|
|
33814
33837
|
{
|
|
33815
|
-
this.Canvas.fillStyle=this.BGColor;
|
|
33816
33838
|
this.Canvas.fillRect(rtBG.Left+1, rtBG.Top, rtBG.Width-1, rtBG.Height);
|
|
33817
33839
|
}
|
|
33818
33840
|
}
|
|
@@ -33821,8 +33843,11 @@ function ChartKLineTable()
|
|
|
33821
33843
|
{
|
|
33822
33844
|
if (!this.BorderColor) return;
|
|
33823
33845
|
|
|
33846
|
+
var lineCount=30;
|
|
33847
|
+
if (this.Style===1 || this.Style===2) lineCount=this.RowCount+1;
|
|
33848
|
+
|
|
33824
33849
|
var yLine=rtBG.Top;
|
|
33825
|
-
for(var i=0;i<
|
|
33850
|
+
for(var i=0;i<lineCount;++i)
|
|
33826
33851
|
{
|
|
33827
33852
|
this.Canvas.beginPath();
|
|
33828
33853
|
this.Canvas.moveTo(rtBG.Left,ToFixedPoint(yLine));
|
|
@@ -33872,12 +33897,29 @@ function ChartKLineTable()
|
|
|
33872
33897
|
var bottom=border.Bottom;
|
|
33873
33898
|
|
|
33874
33899
|
//绘制背景
|
|
33875
|
-
|
|
33876
|
-
|
|
33877
|
-
|
|
33878
|
-
|
|
33879
|
-
|
|
33900
|
+
if (this.Style===1)
|
|
33901
|
+
{
|
|
33902
|
+
var rtBG={ Left:border.LeftEx, Top:border.TopTitle, Right:border.RightEx, Bottom:border.TopEx };
|
|
33903
|
+
rtBG.Width=rtBG.Right-rtBG.Left;
|
|
33904
|
+
rtBG.Height=rtBG.Bottom-rtBG.Top;
|
|
33905
|
+
}
|
|
33906
|
+
else if (this.Style===2)
|
|
33907
|
+
{
|
|
33908
|
+
var rtBG={ Left:border.LeftEx, Top:border.BottomEx, Right:border.RightEx, Bottom:border.Bottom };
|
|
33909
|
+
rtBG.Width=rtBG.Right-rtBG.Left;
|
|
33910
|
+
rtBG.Height=rtBG.Bottom-rtBG.Top;
|
|
33911
|
+
top=rtBG.Top;
|
|
33912
|
+
}
|
|
33913
|
+
else
|
|
33914
|
+
{
|
|
33915
|
+
var rtBG={ Left:border.LeftEx, Top:top, Right:border.RightEx, Bottom:bottom };
|
|
33916
|
+
rtBG.Width=rtBG.Right-rtBG.Left;
|
|
33917
|
+
rtBG.Height=rtBG.Bottom-rtBG.Top;
|
|
33918
|
+
}
|
|
33919
|
+
|
|
33880
33920
|
this.CalculateRowHeight(rtBG);
|
|
33921
|
+
|
|
33922
|
+
this.DrawBG(rtBG);
|
|
33881
33923
|
|
|
33882
33924
|
var itemHeight=this.RowHeight;
|
|
33883
33925
|
var itemWidth=dataWidth+distanceWidth;
|
|
@@ -33910,7 +33952,7 @@ function ChartKLineTable()
|
|
|
33910
33952
|
if (!bDrawName) this.DrawRow(mapItem, top, bottom, left, right); //绘制一列
|
|
33911
33953
|
}
|
|
33912
33954
|
|
|
33913
|
-
if (this.RowNamePosition==3) this.DrawRightRowName();
|
|
33955
|
+
if (this.RowNamePosition==3) this.DrawRightRowName(rtBG);
|
|
33914
33956
|
|
|
33915
33957
|
this.DrawBorder(rtBG);
|
|
33916
33958
|
}
|
|
@@ -33957,20 +33999,51 @@ function ChartKLineTable()
|
|
|
33957
33999
|
}
|
|
33958
34000
|
|
|
33959
34001
|
//绘制右侧行名
|
|
33960
|
-
this.DrawRightRowName=function()
|
|
34002
|
+
this.DrawRightRowName=function(rtBG)
|
|
33961
34003
|
{
|
|
33962
34004
|
var border=this.ChartFrame.GetBorder();
|
|
33963
34005
|
|
|
33964
34006
|
if (this.BGColor)
|
|
33965
34007
|
{
|
|
33966
|
-
|
|
33967
|
-
|
|
33968
|
-
|
|
33969
|
-
|
|
33970
|
-
|
|
34008
|
+
if (this.Style===1)
|
|
34009
|
+
{
|
|
34010
|
+
var height=this.RowCount*this.RowHeight;
|
|
34011
|
+
height=Math.min(rtBG.Height,height);
|
|
34012
|
+
var width=border.ChartWidth-rtBG.Right-2;
|
|
34013
|
+
var maxTextWidth=0;
|
|
34014
|
+
for(var i=0;i<this.RowName.length;++i)
|
|
34015
|
+
{
|
|
34016
|
+
var item=this.RowName[i];
|
|
34017
|
+
if (!item || !item.Name) continue;
|
|
34018
|
+
|
|
34019
|
+
var textWidth=this.Canvas.measureText(item.Name).width;
|
|
34020
|
+
if (textWidth>maxTextWidth) maxTextWidth=textWidth;
|
|
34021
|
+
}
|
|
34022
|
+
if (maxTextWidth>0)
|
|
34023
|
+
{
|
|
34024
|
+
maxTextWidth+=4;
|
|
34025
|
+
width=Math.min(width, maxTextWidth);
|
|
34026
|
+
}
|
|
34027
|
+
|
|
34028
|
+
var rtRightBG={Left:rtBG.Right+1, Top:rtBG.Top+1, Width:width, Height:height };
|
|
34029
|
+
rtRightBG.Right=rtRightBG.Left+rtRightBG.Width;
|
|
34030
|
+
rtRightBG.Bottom=rtRightBG.Top+rtRightBG.Height;
|
|
34031
|
+
|
|
34032
|
+
|
|
34033
|
+
this.Canvas.fillStyle=this.BGColor;
|
|
34034
|
+
this.Canvas.fillRect(rtRightBG.Left, rtRightBG.Top, rtRightBG.Width, rtRightBG.Height);
|
|
34035
|
+
}
|
|
34036
|
+
else
|
|
34037
|
+
{
|
|
34038
|
+
var rtRightBG={Left:border.RightEx, Top:border.Top, Right:border.ChartWidth, Bottom:border.Bottom };
|
|
34039
|
+
rtRightBG.Width=rtRightBG.Right-rtRightBG.Left;
|
|
34040
|
+
rtRightBG.Height=rtRightBG.Bottom-rtRightBG.Top;
|
|
34041
|
+
this.Canvas.fillStyle=this.BGColor;
|
|
34042
|
+
this.Canvas.fillRect(rtRightBG.Left+1, rtRightBG.Top, rtRightBG.Width-2, rtRightBG.Height);
|
|
34043
|
+
}
|
|
33971
34044
|
}
|
|
33972
34045
|
|
|
33973
|
-
var x=
|
|
34046
|
+
var x=rtBG.Right, y=rtBG.Top;
|
|
33974
34047
|
var yOffset=3;
|
|
33975
34048
|
if (this.ItemMergin.YOffset) yOffset=this.ItemMergin.YOffset;
|
|
33976
34049
|
for(var i=0;i<this.RowName.length;++i)
|
|
@@ -80772,6 +80845,13 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
80772
80845
|
this.PopMinuteChart=null;
|
|
80773
80846
|
}
|
|
80774
80847
|
|
|
80848
|
+
this.ClosePopMinuteChart=function()
|
|
80849
|
+
{
|
|
80850
|
+
if (!this.PopMinuteChart) return;
|
|
80851
|
+
|
|
80852
|
+
this.PopMinuteChart.Close();
|
|
80853
|
+
}
|
|
80854
|
+
|
|
80775
80855
|
this.ShowMinuteChartDialog=function(data, x,y)
|
|
80776
80856
|
{
|
|
80777
80857
|
if (!this.PopMinuteChart) return;
|
|
@@ -82538,7 +82618,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
82538
82618
|
this.RecvRealtimeData=function(data)
|
|
82539
82619
|
{
|
|
82540
82620
|
if (this.IsOnTouch==true) return; //正在操作手势不更新数据
|
|
82541
|
-
if (this.
|
|
82621
|
+
if (this.IsPauseUpdateByKeyboard()) return; //正在操作键盘不更新数据
|
|
82542
82622
|
|
|
82543
82623
|
if (data.Ver==3.0)
|
|
82544
82624
|
{
|
|
@@ -82885,7 +82965,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
82885
82965
|
this.RecvMinuteRealtimeDataV2=function(data) //新版本的
|
|
82886
82966
|
{
|
|
82887
82967
|
if (this.IsOnTouch==true) return; //正在操作中不更新数据
|
|
82888
|
-
if (this.
|
|
82968
|
+
if (this.IsPauseUpdateByKeyboard()) return; //正在操作键盘不更新数据
|
|
82889
82969
|
|
|
82890
82970
|
if (this.EnableVerifyRecvData && data.symbol!=this.Symbol)
|
|
82891
82971
|
{
|
|
@@ -83360,6 +83440,8 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
83360
83440
|
//周期切换
|
|
83361
83441
|
this.ChangePeriod=function(period,option)
|
|
83362
83442
|
{
|
|
83443
|
+
this.ClosePopMinuteChart();
|
|
83444
|
+
|
|
83363
83445
|
var oldData={ Period:this.Period, Right:this.Right, KLineDrawType:this.KLineDrawType, Symbol:this.Symbol};
|
|
83364
83446
|
|
|
83365
83447
|
var isChangeKLineDrawType=false;
|
|
@@ -84918,6 +85000,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
84918
85000
|
this.ClearIndexRunCount();
|
|
84919
85001
|
this.UnlockCorssCursor();
|
|
84920
85002
|
this.Frame.ClearYCoordinateMaxMin();
|
|
85003
|
+
this.ClosePopMinuteChart();
|
|
84921
85004
|
|
|
84922
85005
|
|
|
84923
85006
|
this.Symbol=symbol;
|
|
@@ -92556,7 +92639,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
92556
92639
|
return;
|
|
92557
92640
|
}
|
|
92558
92641
|
|
|
92559
|
-
if (this.IsOnTouch==true || this.
|
|
92642
|
+
if (this.IsOnTouch==true || this.IsPauseUpdateByKeyboard()) //正在操作中不更新数据
|
|
92560
92643
|
{
|
|
92561
92644
|
if (this.SourceData && IFrameSplitOperator.IsNonEmptyArray(this.SourceData.Data))
|
|
92562
92645
|
{
|
|
@@ -4357,6 +4357,16 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
4357
4357
|
}
|
|
4358
4358
|
}
|
|
4359
4359
|
|
|
4360
|
+
/////////////////////////////////////////////////////////////////////////////////
|
|
4361
|
+
//属性设置
|
|
4362
|
+
//
|
|
4363
|
+
|
|
4364
|
+
this.SetPressKeyboardConfig=function(chart, option)
|
|
4365
|
+
{
|
|
4366
|
+
if (!chart || !option) return;
|
|
4367
|
+
if (IFrameSplitOperator.IsBool(option.PauseUpdate)) chart.PressKeyboardConfig.PauseUpdate=option.PauseUpdate;
|
|
4368
|
+
}
|
|
4369
|
+
|
|
4360
4370
|
//历史K线图
|
|
4361
4371
|
this.CreateKLineChartContainer=function(option)
|
|
4362
4372
|
{
|
|
@@ -4517,6 +4527,8 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
4517
4527
|
if (IFrameSplitOperator.IsBool(item.EnableMoveOn)) chart.SelectedChart.EnableMoveOn=item.EnableMoveOn;
|
|
4518
4528
|
}
|
|
4519
4529
|
|
|
4530
|
+
if (option.PressKeyboardConfig) this.SetPressKeyboardConfig(chart, option.PressKeyboardConfig);
|
|
4531
|
+
|
|
4520
4532
|
if (!option.Windows || option.Windows.length<=0) return null;
|
|
4521
4533
|
|
|
4522
4534
|
//K线扩展计算方法配置
|
|
@@ -5094,6 +5106,8 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
5094
5106
|
if (IFrameSplitOperator.IsBool(item.EnableMoveOn)) chart.SelectedChart.EnableMoveOn=item.EnableMoveOn;
|
|
5095
5107
|
}
|
|
5096
5108
|
|
|
5109
|
+
if (option.PressKeyboardConfig) this.SetPressKeyboardConfig(chart, option.PressKeyboardConfig);
|
|
5110
|
+
|
|
5097
5111
|
if (chart.ClassName=="MinuteChartContainer")
|
|
5098
5112
|
{
|
|
5099
5113
|
if (!option.DragSelectRect)
|
|
@@ -5998,18 +6012,6 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
5998
6012
|
this.OnSize( {Type:1} );
|
|
5999
6013
|
}
|
|
6000
6014
|
|
|
6001
|
-
//创建工具条
|
|
6002
|
-
this.CreateToolbar=function(option)
|
|
6003
|
-
{
|
|
6004
|
-
|
|
6005
|
-
}
|
|
6006
|
-
|
|
6007
|
-
//创建设置div窗口
|
|
6008
|
-
this.CreateSettingDiv=function(option)
|
|
6009
|
-
{
|
|
6010
|
-
|
|
6011
|
-
}
|
|
6012
|
-
|
|
6013
6015
|
this.Focus=function()
|
|
6014
6016
|
{
|
|
6015
6017
|
if (this.CanvasElement) this.CanvasElement.focus();
|
|
@@ -7315,6 +7317,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
7315
7317
|
this.PressTime=500;
|
|
7316
7318
|
this.IsPress=false; //是否长按
|
|
7317
7319
|
this.IsPressKeyboard=false; //是否键盘按键
|
|
7320
|
+
this.PressKeyboardConfig={ PauseUpdate:false, }; //按键以后 是否涨停数据更新
|
|
7318
7321
|
|
|
7319
7322
|
this.NetworkFilter; //网络请求回调 function(data, callback);
|
|
7320
7323
|
this.LastMouseStatus={ MouseOnToolbar:null }; // MouseOnToolbar={ Rect:{}, Title: }
|
|
@@ -7902,6 +7905,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
7902
7905
|
|
|
7903
7906
|
this.DestroyPopMenu();
|
|
7904
7907
|
|
|
7908
|
+
if (this.DestroyPopMinuteChart) this.DestroyPopMinuteChart();
|
|
7909
|
+
|
|
7905
7910
|
this.StopLatestPointFlash();
|
|
7906
7911
|
|
|
7907
7912
|
document.oncontextmenu=null;
|
|
@@ -16211,6 +16216,16 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
16211
16216
|
|
|
16212
16217
|
return false;
|
|
16213
16218
|
}
|
|
16219
|
+
|
|
16220
|
+
//键盘下按暂停更新
|
|
16221
|
+
this.IsPauseUpdateByKeyboard=function()
|
|
16222
|
+
{
|
|
16223
|
+
if (!this.IsPressKeyboard) return false;
|
|
16224
|
+
if (!this.PressKeyboardConfig) return false;
|
|
16225
|
+
if (!this.PressKeyboardConfig.PauseUpdate) return false;
|
|
16226
|
+
|
|
16227
|
+
return true;
|
|
16228
|
+
}
|
|
16214
16229
|
}
|
|
16215
16230
|
|
|
16216
16231
|
function GetDevicePixelRatio()
|
|
@@ -37881,6 +37896,7 @@ function ChartKLineTable()
|
|
|
37881
37896
|
|
|
37882
37897
|
this.TextFont;
|
|
37883
37898
|
this.TextColor='rgb(0,0,0)';
|
|
37899
|
+
this.Style=0; //0=全部窗口模式 1=顶部指定行数 2=底部指定行数;
|
|
37884
37900
|
|
|
37885
37901
|
this.AryTableData=[];
|
|
37886
37902
|
this.MapCache=null; //key=date/date-time value={ Date:, Time:, Data:[ ] }
|
|
@@ -37906,9 +37922,15 @@ function ChartKLineTable()
|
|
|
37906
37922
|
{
|
|
37907
37923
|
if (!this.BGColor) return;
|
|
37908
37924
|
|
|
37909
|
-
|
|
37925
|
+
this.Canvas.fillStyle=this.BGColor;
|
|
37926
|
+
if ((this.Style===1 || this.Style===2) && this.RowHeightType==1)
|
|
37927
|
+
{
|
|
37928
|
+
var height=this.RowCount*this.RowHeight;
|
|
37929
|
+
height=Math.min(rtBG.Height,height);
|
|
37930
|
+
this.Canvas.fillRect(rtBG.Left+1, rtBG.Top, rtBG.Width-2, height);
|
|
37931
|
+
}
|
|
37932
|
+
else
|
|
37910
37933
|
{
|
|
37911
|
-
this.Canvas.fillStyle=this.BGColor;
|
|
37912
37934
|
this.Canvas.fillRect(rtBG.Left+1, rtBG.Top, rtBG.Width-1, rtBG.Height);
|
|
37913
37935
|
}
|
|
37914
37936
|
}
|
|
@@ -37917,8 +37939,11 @@ function ChartKLineTable()
|
|
|
37917
37939
|
{
|
|
37918
37940
|
if (!this.BorderColor) return;
|
|
37919
37941
|
|
|
37942
|
+
var lineCount=30;
|
|
37943
|
+
if (this.Style===1 || this.Style===2) lineCount=this.RowCount+1;
|
|
37944
|
+
|
|
37920
37945
|
var yLine=rtBG.Top;
|
|
37921
|
-
for(var i=0;i<
|
|
37946
|
+
for(var i=0;i<lineCount;++i)
|
|
37922
37947
|
{
|
|
37923
37948
|
this.Canvas.beginPath();
|
|
37924
37949
|
this.Canvas.moveTo(rtBG.Left,ToFixedPoint(yLine));
|
|
@@ -37968,12 +37993,29 @@ function ChartKLineTable()
|
|
|
37968
37993
|
var bottom=border.Bottom;
|
|
37969
37994
|
|
|
37970
37995
|
//绘制背景
|
|
37971
|
-
|
|
37972
|
-
|
|
37973
|
-
|
|
37974
|
-
|
|
37975
|
-
|
|
37996
|
+
if (this.Style===1)
|
|
37997
|
+
{
|
|
37998
|
+
var rtBG={ Left:border.LeftEx, Top:border.TopTitle, Right:border.RightEx, Bottom:border.TopEx };
|
|
37999
|
+
rtBG.Width=rtBG.Right-rtBG.Left;
|
|
38000
|
+
rtBG.Height=rtBG.Bottom-rtBG.Top;
|
|
38001
|
+
}
|
|
38002
|
+
else if (this.Style===2)
|
|
38003
|
+
{
|
|
38004
|
+
var rtBG={ Left:border.LeftEx, Top:border.BottomEx, Right:border.RightEx, Bottom:border.Bottom };
|
|
38005
|
+
rtBG.Width=rtBG.Right-rtBG.Left;
|
|
38006
|
+
rtBG.Height=rtBG.Bottom-rtBG.Top;
|
|
38007
|
+
top=rtBG.Top;
|
|
38008
|
+
}
|
|
38009
|
+
else
|
|
38010
|
+
{
|
|
38011
|
+
var rtBG={ Left:border.LeftEx, Top:top, Right:border.RightEx, Bottom:bottom };
|
|
38012
|
+
rtBG.Width=rtBG.Right-rtBG.Left;
|
|
38013
|
+
rtBG.Height=rtBG.Bottom-rtBG.Top;
|
|
38014
|
+
}
|
|
38015
|
+
|
|
37976
38016
|
this.CalculateRowHeight(rtBG);
|
|
38017
|
+
|
|
38018
|
+
this.DrawBG(rtBG);
|
|
37977
38019
|
|
|
37978
38020
|
var itemHeight=this.RowHeight;
|
|
37979
38021
|
var itemWidth=dataWidth+distanceWidth;
|
|
@@ -38006,7 +38048,7 @@ function ChartKLineTable()
|
|
|
38006
38048
|
if (!bDrawName) this.DrawRow(mapItem, top, bottom, left, right); //绘制一列
|
|
38007
38049
|
}
|
|
38008
38050
|
|
|
38009
|
-
if (this.RowNamePosition==3) this.DrawRightRowName();
|
|
38051
|
+
if (this.RowNamePosition==3) this.DrawRightRowName(rtBG);
|
|
38010
38052
|
|
|
38011
38053
|
this.DrawBorder(rtBG);
|
|
38012
38054
|
}
|
|
@@ -38053,20 +38095,51 @@ function ChartKLineTable()
|
|
|
38053
38095
|
}
|
|
38054
38096
|
|
|
38055
38097
|
//绘制右侧行名
|
|
38056
|
-
this.DrawRightRowName=function()
|
|
38098
|
+
this.DrawRightRowName=function(rtBG)
|
|
38057
38099
|
{
|
|
38058
38100
|
var border=this.ChartFrame.GetBorder();
|
|
38059
38101
|
|
|
38060
38102
|
if (this.BGColor)
|
|
38061
38103
|
{
|
|
38062
|
-
|
|
38063
|
-
|
|
38064
|
-
|
|
38065
|
-
|
|
38066
|
-
|
|
38104
|
+
if (this.Style===1)
|
|
38105
|
+
{
|
|
38106
|
+
var height=this.RowCount*this.RowHeight;
|
|
38107
|
+
height=Math.min(rtBG.Height,height);
|
|
38108
|
+
var width=border.ChartWidth-rtBG.Right-2;
|
|
38109
|
+
var maxTextWidth=0;
|
|
38110
|
+
for(var i=0;i<this.RowName.length;++i)
|
|
38111
|
+
{
|
|
38112
|
+
var item=this.RowName[i];
|
|
38113
|
+
if (!item || !item.Name) continue;
|
|
38114
|
+
|
|
38115
|
+
var textWidth=this.Canvas.measureText(item.Name).width;
|
|
38116
|
+
if (textWidth>maxTextWidth) maxTextWidth=textWidth;
|
|
38117
|
+
}
|
|
38118
|
+
if (maxTextWidth>0)
|
|
38119
|
+
{
|
|
38120
|
+
maxTextWidth+=4;
|
|
38121
|
+
width=Math.min(width, maxTextWidth);
|
|
38122
|
+
}
|
|
38123
|
+
|
|
38124
|
+
var rtRightBG={Left:rtBG.Right+1, Top:rtBG.Top+1, Width:width, Height:height };
|
|
38125
|
+
rtRightBG.Right=rtRightBG.Left+rtRightBG.Width;
|
|
38126
|
+
rtRightBG.Bottom=rtRightBG.Top+rtRightBG.Height;
|
|
38127
|
+
|
|
38128
|
+
|
|
38129
|
+
this.Canvas.fillStyle=this.BGColor;
|
|
38130
|
+
this.Canvas.fillRect(rtRightBG.Left, rtRightBG.Top, rtRightBG.Width, rtRightBG.Height);
|
|
38131
|
+
}
|
|
38132
|
+
else
|
|
38133
|
+
{
|
|
38134
|
+
var rtRightBG={Left:border.RightEx, Top:border.Top, Right:border.ChartWidth, Bottom:border.Bottom };
|
|
38135
|
+
rtRightBG.Width=rtRightBG.Right-rtRightBG.Left;
|
|
38136
|
+
rtRightBG.Height=rtRightBG.Bottom-rtRightBG.Top;
|
|
38137
|
+
this.Canvas.fillStyle=this.BGColor;
|
|
38138
|
+
this.Canvas.fillRect(rtRightBG.Left+1, rtRightBG.Top, rtRightBG.Width-2, rtRightBG.Height);
|
|
38139
|
+
}
|
|
38067
38140
|
}
|
|
38068
38141
|
|
|
38069
|
-
var x=
|
|
38142
|
+
var x=rtBG.Right, y=rtBG.Top;
|
|
38070
38143
|
var yOffset=3;
|
|
38071
38144
|
if (this.ItemMergin.YOffset) yOffset=this.ItemMergin.YOffset;
|
|
38072
38145
|
for(var i=0;i<this.RowName.length;++i)
|
|
@@ -84868,6 +84941,13 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
84868
84941
|
this.PopMinuteChart=null;
|
|
84869
84942
|
}
|
|
84870
84943
|
|
|
84944
|
+
this.ClosePopMinuteChart=function()
|
|
84945
|
+
{
|
|
84946
|
+
if (!this.PopMinuteChart) return;
|
|
84947
|
+
|
|
84948
|
+
this.PopMinuteChart.Close();
|
|
84949
|
+
}
|
|
84950
|
+
|
|
84871
84951
|
this.ShowMinuteChartDialog=function(data, x,y)
|
|
84872
84952
|
{
|
|
84873
84953
|
if (!this.PopMinuteChart) return;
|
|
@@ -86634,7 +86714,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
86634
86714
|
this.RecvRealtimeData=function(data)
|
|
86635
86715
|
{
|
|
86636
86716
|
if (this.IsOnTouch==true) return; //正在操作手势不更新数据
|
|
86637
|
-
if (this.
|
|
86717
|
+
if (this.IsPauseUpdateByKeyboard()) return; //正在操作键盘不更新数据
|
|
86638
86718
|
|
|
86639
86719
|
if (data.Ver==3.0)
|
|
86640
86720
|
{
|
|
@@ -86981,7 +87061,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
86981
87061
|
this.RecvMinuteRealtimeDataV2=function(data) //新版本的
|
|
86982
87062
|
{
|
|
86983
87063
|
if (this.IsOnTouch==true) return; //正在操作中不更新数据
|
|
86984
|
-
if (this.
|
|
87064
|
+
if (this.IsPauseUpdateByKeyboard()) return; //正在操作键盘不更新数据
|
|
86985
87065
|
|
|
86986
87066
|
if (this.EnableVerifyRecvData && data.symbol!=this.Symbol)
|
|
86987
87067
|
{
|
|
@@ -87456,6 +87536,8 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
87456
87536
|
//周期切换
|
|
87457
87537
|
this.ChangePeriod=function(period,option)
|
|
87458
87538
|
{
|
|
87539
|
+
this.ClosePopMinuteChart();
|
|
87540
|
+
|
|
87459
87541
|
var oldData={ Period:this.Period, Right:this.Right, KLineDrawType:this.KLineDrawType, Symbol:this.Symbol};
|
|
87460
87542
|
|
|
87461
87543
|
var isChangeKLineDrawType=false;
|
|
@@ -89014,6 +89096,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
89014
89096
|
this.ClearIndexRunCount();
|
|
89015
89097
|
this.UnlockCorssCursor();
|
|
89016
89098
|
this.Frame.ClearYCoordinateMaxMin();
|
|
89099
|
+
this.ClosePopMinuteChart();
|
|
89017
89100
|
|
|
89018
89101
|
|
|
89019
89102
|
this.Symbol=symbol;
|
|
@@ -96652,7 +96735,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
96652
96735
|
return;
|
|
96653
96736
|
}
|
|
96654
96737
|
|
|
96655
|
-
if (this.IsOnTouch==true || this.
|
|
96738
|
+
if (this.IsOnTouch==true || this.IsPauseUpdateByKeyboard()) //正在操作中不更新数据
|
|
96656
96739
|
{
|
|
96657
96740
|
if (this.SourceData && IFrameSplitOperator.IsNonEmptyArray(this.SourceData.Data))
|
|
96658
96741
|
{
|
|
@@ -130463,6 +130546,9 @@ function OverlayScriptIndex(name,script,args,option)
|
|
|
130463
130546
|
case SCRIPT_CHART_NAME.BASELINE_BAR:
|
|
130464
130547
|
this.CreateBaseLineBar(hqChart,windowIndex,item,i);
|
|
130465
130548
|
break;
|
|
130549
|
+
case SCRIPT_CHART_NAME.KLINE_TABLE:
|
|
130550
|
+
this.CreateKLineTable(hqChart,windowIndex,item,i);
|
|
130551
|
+
break;
|
|
130466
130552
|
case "DRAWCOLORKLINE":
|
|
130467
130553
|
this.CreateDrawColorKLine(hqChart,windowIndex,item,i);
|
|
130468
130554
|
break;
|
|
@@ -131272,6 +131358,7 @@ function OverlayScriptIndex(name,script,args,option)
|
|
|
131272
131358
|
}
|
|
131273
131359
|
|
|
131274
131360
|
chart.BuildCacheData();
|
|
131361
|
+
this.SetChartIndexName(chart);
|
|
131275
131362
|
frame.ChartPaint.push(chart);
|
|
131276
131363
|
}
|
|
131277
131364
|
|
|
@@ -131302,6 +131389,61 @@ function OverlayScriptIndex(name,script,args,option)
|
|
|
131302
131389
|
frame.ChartPaint.push(chart);
|
|
131303
131390
|
}
|
|
131304
131391
|
|
|
131392
|
+
this.CreateKLineTable=function(hqChart,windowIndex,varItem,id)
|
|
131393
|
+
{
|
|
131394
|
+
var overlayIndex=this.OverlayIndex;
|
|
131395
|
+
var frame=overlayIndex.Frame;
|
|
131396
|
+
var chart=new ChartKLineTable();
|
|
131397
|
+
chart.Canvas=hqChart.Canvas;
|
|
131398
|
+
chart.Name=varItem.Name;
|
|
131399
|
+
chart.HQChart=hqChart;
|
|
131400
|
+
chart.ChartBorder=frame.Frame.ChartBorder;
|
|
131401
|
+
chart.ChartFrame=frame.Frame;
|
|
131402
|
+
chart.Identify=overlayIndex.Identify;
|
|
131403
|
+
|
|
131404
|
+
chart.Data=hqChart.GetKData(); //绑定K线
|
|
131405
|
+
chart.AryTableData=varItem.Draw.DrawData;
|
|
131406
|
+
if (IFrameSplitOperator.IsNumber(varItem.Draw.RowCount)) chart.RowCount=varItem.Draw.RowCount;
|
|
131407
|
+
if (IFrameSplitOperator.IsNonEmptyArray(varItem.Draw.RowName)) chart.RowName=varItem.Draw.RowName;
|
|
131408
|
+
|
|
131409
|
+
var config=varItem.Draw.Config;
|
|
131410
|
+
if (config)
|
|
131411
|
+
{
|
|
131412
|
+
if (config.BGColor) chart.BGColor=config.BGColor;
|
|
131413
|
+
if (config.TextColor) chart.TextColor=config.TextColor;
|
|
131414
|
+
if (config.BorderColor) chart.BorderColor=config.BorderColor;
|
|
131415
|
+
if (IFrameSplitOperator.IsNumber(config.RowNamePosition)) chart.RowNamePosition=config.RowNamePosition;
|
|
131416
|
+
if (IFrameSplitOperator.IsNumber(config.RowHeightType)) chart.RowHeightType=config.RowHeightType;
|
|
131417
|
+
if (IFrameSplitOperator.IsNumber(config.Style)) chart.Style=config.Style;
|
|
131418
|
+
|
|
131419
|
+
if (config.ItemMergin)
|
|
131420
|
+
{
|
|
131421
|
+
var subItem=config.ItemMergin;
|
|
131422
|
+
if (IFrameSplitOperator.IsNumber(subItem.Left)) chart.ItemMergin.Left=subItem.Left;
|
|
131423
|
+
if (IFrameSplitOperator.IsNumber(subItem.Top)) chart.ItemMergin.Top=subItem.Top;
|
|
131424
|
+
if (IFrameSplitOperator.IsNumber(subItem.Bottom)) chart.ItemMergin.Bottom=subItem.Bottom;
|
|
131425
|
+
if (IFrameSplitOperator.IsNumber(subItem.Right)) chart.ItemMergin.Right=subItem.Right;
|
|
131426
|
+
if (IFrameSplitOperator.IsNumber(subItem.YOffset)) chart.ItemMergin.YOffset=subItem.YOffset;
|
|
131427
|
+
}
|
|
131428
|
+
|
|
131429
|
+
if (config.TextFont)
|
|
131430
|
+
{
|
|
131431
|
+
var subItem=config.TextFont;
|
|
131432
|
+
if (IFrameSplitOperator.IsNumber(subItem.FontMaxSize)) chart.TextFontConfig.FontMaxSize=subItem.FontMaxSize;
|
|
131433
|
+
if (subItem.Family) chart.TextFontConfig.Family=subItem.Family;
|
|
131434
|
+
}
|
|
131435
|
+
}
|
|
131436
|
+
|
|
131437
|
+
chart.BuildCacheData();
|
|
131438
|
+
frame.ChartPaint.push(chart);
|
|
131439
|
+
|
|
131440
|
+
var titleIndex=windowIndex+1;
|
|
131441
|
+
var titlePaint=hqChart.TitlePaint[titleIndex];
|
|
131442
|
+
var titleData=new DynamicTitleData(chart.Data,chart.BarName,chart.BarColor);
|
|
131443
|
+
titleData.DataType="ChartKLineTable";
|
|
131444
|
+
titlePaint.OverlayIndex.get(overlayIndex.Identify).Data[id]=titleData;
|
|
131445
|
+
}
|
|
131446
|
+
|
|
131305
131447
|
|
|
131306
131448
|
//创建通道
|
|
131307
131449
|
this.CreateChannel=function(hqChart,windowIndex,varItem,id)
|
|
@@ -150595,7 +150737,7 @@ function ScrollBarBGChart()
|
|
|
150595
150737
|
|
|
150596
150738
|
|
|
150597
150739
|
|
|
150598
|
-
var HQCHART_VERSION="1.1.
|
|
150740
|
+
var HQCHART_VERSION="1.1.14875";
|
|
150599
150741
|
|
|
150600
150742
|
function PrintHQChartVersion()
|
|
150601
150743
|
{
|