hqchart 1.1.13135 → 1.1.13140
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/src/jscommon/umychart.js
CHANGED
|
@@ -6870,13 +6870,18 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
6870
6870
|
{
|
|
6871
6871
|
ID:key, Frame:frame, ChartPaint:[] , Max:null, Min:null,
|
|
6872
6872
|
OverlayFrame:[], //共享坐标
|
|
6873
|
-
SingleOverlay:[]
|
|
6873
|
+
SingleOverlay:[], //独立坐标
|
|
6874
|
+
MainOverlayFrame:[null, null], //叠加坐标在主坐标显示[0]=left [1]=right
|
|
6874
6875
|
};
|
|
6875
6876
|
|
|
6876
6877
|
for(var j=0;j<subItem.OverlayIndex.length;++j)
|
|
6877
6878
|
{
|
|
6878
6879
|
var overlayItem=subItem.OverlayIndex[j];
|
|
6879
6880
|
var overlayFrame=overlayItem.Frame;
|
|
6881
|
+
|
|
6882
|
+
if (overlayFrame.IsShowMainFrame===1) item.MainOverlayFrame[0]= overlayFrame;
|
|
6883
|
+
else if (overlayFrame.IsShowMainFrame===2) item.MainOverlayFrame[1]= overlayFrame;
|
|
6884
|
+
|
|
6880
6885
|
if (overlayFrame.IsShareY)
|
|
6881
6886
|
{
|
|
6882
6887
|
if (!overlayFrame.MainFrame) continue;
|
|
@@ -6892,7 +6897,6 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
6892
6897
|
{
|
|
6893
6898
|
item.SingleOverlay.push(overlayItem);
|
|
6894
6899
|
}
|
|
6895
|
-
|
|
6896
6900
|
}
|
|
6897
6901
|
|
|
6898
6902
|
mapFrame.set(key, item);
|
|
@@ -6977,6 +6981,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
6977
6981
|
item.OverlayFrame[j].XYSplit=true;
|
|
6978
6982
|
}
|
|
6979
6983
|
|
|
6984
|
+
//叠加坐标显示在主图坐标 需要同步
|
|
6985
|
+
for(var i=0;i<item.MainOverlayFrame.length;++i)
|
|
6986
|
+
{
|
|
6987
|
+
var subItem=item.MainOverlayFrame[i];
|
|
6988
|
+
if (subItem) subItem.XYSplit=true;
|
|
6989
|
+
}
|
|
6990
|
+
|
|
6980
6991
|
//独立坐标叠加指标
|
|
6981
6992
|
for(var i=0;i<item.SingleOverlay.length;++i)
|
|
6982
6993
|
{
|
|
@@ -9959,6 +9970,8 @@ function AverageWidthFrame()
|
|
|
9959
9970
|
this.XTextExtend; //[0]=底部 { Align:0=默认(居中), 1=左对齐 }
|
|
9960
9971
|
this.XLineExtend; //[0]=底部 { Mode:1, Color: } Mode=1 分割线 Mode=2短线
|
|
9961
9972
|
|
|
9973
|
+
this.FrameData={ SubFrameItem:null }; //窗口框架信息
|
|
9974
|
+
|
|
9962
9975
|
//画图工具刻度
|
|
9963
9976
|
|
|
9964
9977
|
this.DrawPicture={
|
|
@@ -11908,6 +11921,25 @@ function AverageWidthFrame()
|
|
|
11908
11921
|
|
|
11909
11922
|
if (divToolbar.style.display!='none') divToolbar.style.display='none';
|
|
11910
11923
|
}
|
|
11924
|
+
|
|
11925
|
+
this.GetMainOverlayFrame=function()
|
|
11926
|
+
{
|
|
11927
|
+
if (!this.FrameData || !this.FrameData.SubFrameItem) return null;
|
|
11928
|
+
|
|
11929
|
+
var subFrame=this.FrameData.SubFrameItem;
|
|
11930
|
+
var leftFrame=null, rightFrame=null;
|
|
11931
|
+
for(var i=0;i<subFrame.OverlayIndex.length;++i)
|
|
11932
|
+
{
|
|
11933
|
+
var item=subFrame.OverlayIndex[i];
|
|
11934
|
+
var overlayFrame=item.Frame;
|
|
11935
|
+
if (overlayFrame.IsShowMainFrame==2) rightFrame=overlayFrame;
|
|
11936
|
+
else if (overlayFrame.IsShowMainFrame==1) leftFrame=overlayFrame;
|
|
11937
|
+
}
|
|
11938
|
+
|
|
11939
|
+
if (!leftFrame && !rightFrame) return null;
|
|
11940
|
+
|
|
11941
|
+
return [leftFrame, rightFrame];
|
|
11942
|
+
}
|
|
11911
11943
|
}
|
|
11912
11944
|
|
|
11913
11945
|
function MinuteFrame()
|
|
@@ -14017,7 +14049,7 @@ function OverlayMinuteFrame()
|
|
|
14017
14049
|
this.HorizontalMax=this.MainFrame.HorizontalMax;
|
|
14018
14050
|
this.HorizontalMin=this.MainFrame.HorizontalMin;
|
|
14019
14051
|
this.HorizontalInfo=[];
|
|
14020
|
-
for(var i
|
|
14052
|
+
for(var i=0; i<this.MainFrame.HorizontalInfo.length; ++i)
|
|
14021
14053
|
{
|
|
14022
14054
|
var item=this.MainFrame.HorizontalInfo[i];
|
|
14023
14055
|
this.HorizontalInfo.push(item);
|
|
@@ -14027,7 +14059,7 @@ function OverlayMinuteFrame()
|
|
|
14027
14059
|
{
|
|
14028
14060
|
if (this.YSplitOperator!=null) this.YSplitOperator.Operator();
|
|
14029
14061
|
}
|
|
14030
|
-
|
|
14062
|
+
|
|
14031
14063
|
// if (this.XSplitOperator!=null) this.XSplitOperator.Operator(); 子坐标和主坐标X轴一致 所以不用计算
|
|
14032
14064
|
}
|
|
14033
14065
|
}
|
|
@@ -15361,6 +15393,7 @@ function OverlayKLineFrame()
|
|
|
15361
15393
|
|
|
15362
15394
|
this.MainFrame=null; //主框架
|
|
15363
15395
|
this.IsShareY=false; //使用和主框架公用Y轴
|
|
15396
|
+
this.IsShowMainFrame=0; //是否显示在主框架坐标上 1=左边 2=右边
|
|
15364
15397
|
this.IsCalculateYMaxMin=true; //是否计算Y最大最小值
|
|
15365
15398
|
this.RightOffset=50;
|
|
15366
15399
|
this.PenBorder=g_JSChartResource.OverlayFrame.BolderPen; //'rgb(0,0,0)'
|
|
@@ -15571,8 +15604,6 @@ function OverlayKLineFrame()
|
|
|
15571
15604
|
{
|
|
15572
15605
|
if (this.YSplitOperator!=null) this.YSplitOperator.Operator();
|
|
15573
15606
|
}
|
|
15574
|
-
|
|
15575
|
-
// if (this.XSplitOperator!=null) this.XSplitOperator.Operator(); 子坐标和主坐标X轴一致 所以不用计算
|
|
15576
15607
|
}
|
|
15577
15608
|
|
|
15578
15609
|
//画Y轴
|
|
@@ -22594,6 +22625,14 @@ function ChartKLine()
|
|
|
22594
22625
|
this.IsThinAKBar=true; //美国线 柱子是否是线段 (false=柱子)
|
|
22595
22626
|
|
|
22596
22627
|
this.HighLowBarColor=g_JSChartResource.HighLowBarColor;
|
|
22628
|
+
this.HighLowTextConfig=
|
|
22629
|
+
{
|
|
22630
|
+
FontName:g_JSChartResource.HighLowText.FontName,
|
|
22631
|
+
MaxSize:g_JSChartResource.HighLowText.MaxSize,
|
|
22632
|
+
MinSize:g_JSChartResource.HighLowText.MinSize,
|
|
22633
|
+
Color:g_JSChartResource.HighLowText.Color, //未用
|
|
22634
|
+
MaxText:g_JSChartResource.HighLowText.MaxText
|
|
22635
|
+
};
|
|
22597
22636
|
|
|
22598
22637
|
this.HLCAreaConfig=
|
|
22599
22638
|
{
|
|
@@ -25044,6 +25083,12 @@ function ChartKLine()
|
|
|
25044
25083
|
var top=this.ChartBorder.GetTopEx();
|
|
25045
25084
|
var bottom=this.ChartBorder.GetBottomEx();
|
|
25046
25085
|
if (this.ChartBorder.BottomSpace>0) bottom+=1;
|
|
25086
|
+
|
|
25087
|
+
if (this.DrawType==13) //需要显示文字,裁剪要大点
|
|
25088
|
+
{
|
|
25089
|
+
top=this.ChartBorder.GetTopTitle();
|
|
25090
|
+
bottom=this.ChartBorder.GetBottom();
|
|
25091
|
+
}
|
|
25047
25092
|
}
|
|
25048
25093
|
|
|
25049
25094
|
this.Canvas.beginPath();
|
|
@@ -26867,6 +26912,15 @@ function ChartKLine()
|
|
|
26867
26912
|
|
|
26868
26913
|
this.Canvas.fillStyle=this.HighLowBarColor;
|
|
26869
26914
|
this.Canvas.strokeStyle=this.HighLowBarColor;
|
|
26915
|
+
var defaultfloatPrecision=GetfloatPrecision(this.Symbol);
|
|
26916
|
+
var font=this.GetHighLowTextFont(dataWidth,distanceWidth);
|
|
26917
|
+
var bShowText=false;
|
|
26918
|
+
if (font)
|
|
26919
|
+
{
|
|
26920
|
+
bShowText=true;
|
|
26921
|
+
this.Canvas.font=font;
|
|
26922
|
+
}
|
|
26923
|
+
|
|
26870
26924
|
for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length && j<xPointCount;++i,++j,xOffset+=(dataWidth+distanceWidth),++this.ShowRange.DataCount)
|
|
26871
26925
|
{
|
|
26872
26926
|
var data=this.Data.Data[i];
|
|
@@ -26893,6 +26947,7 @@ function ChartKLine()
|
|
|
26893
26947
|
else
|
|
26894
26948
|
{
|
|
26895
26949
|
this.Canvas.fillRect(ToFixedRect(left),ToFixedRect(yBarTop),ToFixedRect(dataWidth),ToFixedRect(barHeight));
|
|
26950
|
+
if (bShowText) this.DrawHighLowText(yHigh, yLow, x, data, defaultfloatPrecision);
|
|
26896
26951
|
//TODO:文字输出
|
|
26897
26952
|
}
|
|
26898
26953
|
}
|
|
@@ -26932,6 +26987,38 @@ function ChartKLine()
|
|
|
26932
26987
|
}
|
|
26933
26988
|
}
|
|
26934
26989
|
|
|
26990
|
+
this.DrawHighLowText=function(yHigh, yLow, x, kItem, floatPrecision)
|
|
26991
|
+
{
|
|
26992
|
+
this.Canvas.textAlign="center";
|
|
26993
|
+
|
|
26994
|
+
var text=kItem.High.toFixed(floatPrecision);
|
|
26995
|
+
this.Canvas.textBaseline="bottom";
|
|
26996
|
+
this.Canvas.fillText(text,x,yHigh-2);
|
|
26997
|
+
|
|
26998
|
+
var text=kItem.Low.toFixed(floatPrecision);
|
|
26999
|
+
this.Canvas.textBaseline="top";
|
|
27000
|
+
this.Canvas.fillText(text,x,yLow+3);
|
|
27001
|
+
}
|
|
27002
|
+
|
|
27003
|
+
this.GetHighLowTextFont=function(dataWidth, distanceWidth)
|
|
27004
|
+
{
|
|
27005
|
+
var barWidth=dataWidth+distanceWidth;
|
|
27006
|
+
var text=this.HighLowTextConfig.MaxText;
|
|
27007
|
+
var min=Math.min(this.HighLowTextConfig.MaxSize,this.HighLowTextConfig.MinSize);
|
|
27008
|
+
var max=Math.max(this.HighLowTextConfig.MaxSize,this.HighLowTextConfig.MinSize);
|
|
27009
|
+
|
|
27010
|
+
for(var i=max; i>=min; --i)
|
|
27011
|
+
{
|
|
27012
|
+
var font=`${i*GetDevicePixelRatio()}px ${this.HighLowTextConfig.FontName}`;
|
|
27013
|
+
this.Canvas.font=font;
|
|
27014
|
+
var textWidth=this.Canvas.measureText(text).width;
|
|
27015
|
+
if (textWidth<=barWidth)
|
|
27016
|
+
return font;
|
|
27017
|
+
}
|
|
27018
|
+
|
|
27019
|
+
return null;
|
|
27020
|
+
}
|
|
27021
|
+
|
|
26935
27022
|
//////////////////////////////////////////////////////////////
|
|
26936
27023
|
//标识缺口
|
|
26937
27024
|
//
|
|
@@ -45697,6 +45784,7 @@ function FrameSplitY()
|
|
|
45697
45784
|
if (this.SplitType!=1) this.Frame.HorizontalInfo = this.Filter(this.Frame.HorizontalInfo,(splitData.Max>0 && splitData.Min<0));
|
|
45698
45785
|
|
|
45699
45786
|
this.RightFrameSplitY();
|
|
45787
|
+
this.MainOverlayFrameSplitY(); //主图Y轴绑定叠加Y轴坐标
|
|
45700
45788
|
this.CallAcutionSplitY(this.SplitCount,splitData);
|
|
45701
45789
|
|
|
45702
45790
|
if (this.EnableRemoveZero) this.RemoveZero(this.Frame.HorizontalInfo);
|
|
@@ -45917,6 +46005,41 @@ function FrameSplitY()
|
|
|
45917
46005
|
}
|
|
45918
46006
|
}
|
|
45919
46007
|
|
|
46008
|
+
this.MainOverlayFrameSplitY=function()
|
|
46009
|
+
{
|
|
46010
|
+
if (!this.Frame.GetMainOverlayFrame) return;
|
|
46011
|
+
var aryOverlayFrame=this.Frame.GetMainOverlayFrame();
|
|
46012
|
+
if (!aryOverlayFrame ) return;
|
|
46013
|
+
|
|
46014
|
+
if (aryOverlayFrame[1])
|
|
46015
|
+
{
|
|
46016
|
+
var rightFrame=aryOverlayFrame[1];
|
|
46017
|
+
if (rightFrame.YSplitOperator) rightFrame.YSplitOperator.Operator();
|
|
46018
|
+
|
|
46019
|
+
for(var i=0;i<this.Frame.HorizontalInfo.length;++i)
|
|
46020
|
+
{
|
|
46021
|
+
var item=this.Frame.HorizontalInfo[i];
|
|
46022
|
+
var y=this.Frame.GetYFromData(item.Value);
|
|
46023
|
+
var yValue=rightFrame.GetYData(y);
|
|
46024
|
+
item.Message[1] = IFrameSplitOperator.FormatValueString(yValue, this.FloatPrecision,this.LanguageID);
|
|
46025
|
+
}
|
|
46026
|
+
}
|
|
46027
|
+
|
|
46028
|
+
if (aryOverlayFrame[0])
|
|
46029
|
+
{
|
|
46030
|
+
var leftFrame=aryOverlayFrame[0];
|
|
46031
|
+
if (leftFrame.YSplitOperator) leftFrame.YSplitOperator.Operator();
|
|
46032
|
+
|
|
46033
|
+
for(var i=0;i<this.Frame.HorizontalInfo.length;++i)
|
|
46034
|
+
{
|
|
46035
|
+
var item=this.Frame.HorizontalInfo[i];
|
|
46036
|
+
var y=this.Frame.GetYFromData(item.Value);
|
|
46037
|
+
var yValue=leftFrame.GetYData(y);
|
|
46038
|
+
item.Message[0] = IFrameSplitOperator.FormatValueString(yValue, this.FloatPrecision,this.LanguageID);
|
|
46039
|
+
}
|
|
46040
|
+
}
|
|
46041
|
+
}
|
|
46042
|
+
|
|
45920
46043
|
this.CustomCoordinate=function()
|
|
45921
46044
|
{
|
|
45922
46045
|
this.Frame.CustomHorizontalInfo=[];
|
|
@@ -63076,6 +63199,7 @@ function JSChartResource()
|
|
|
63076
63199
|
this.UnchagneBarColor="rgb(0,0,0)"; //平盘柱子颜色
|
|
63077
63200
|
this.EmptyBarBGColor="rgb(255,255,255)"; //空心柱子背景色
|
|
63078
63201
|
this.HighLowBarColor='rgb(41,98,255)'; //high low bar 颜色
|
|
63202
|
+
this.HighLowText={ FontName:"arial", MaxSize:30, MinSize:4, Color:"rgb(41,98,255)", MaxText:"9999.9" };
|
|
63079
63203
|
|
|
63080
63204
|
this.SplashScreen=
|
|
63081
63205
|
{
|
|
@@ -64246,6 +64370,16 @@ function JSChartResource()
|
|
|
64246
64370
|
if (style.UnchagneBarColor) this.UnchagneBarColor = style.UnchagneBarColor;
|
|
64247
64371
|
if (style.EmptyBarBGColor) this.EmptyBarBGColor=style.EmptyBarBGColor;
|
|
64248
64372
|
if (style.HighLowBarColor) this.HighLowBarColor=style.HighLowBarColor;
|
|
64373
|
+
if (style.HighLowText)
|
|
64374
|
+
{
|
|
64375
|
+
var dest=this.HighLowText;
|
|
64376
|
+
var item=style.HighLowText;
|
|
64377
|
+
if (item.FontName) dest.FontName=item.FontName;
|
|
64378
|
+
if (item.Color) dest.Color=item.Color;
|
|
64379
|
+
if (item.MaxText) dest.MaxText=item.MaxText;
|
|
64380
|
+
if (IFrameSplitOperator.IsPlusNumber(item.MaxSize)) dest.MaxSize=item.MaxSize;
|
|
64381
|
+
if (IFrameSplitOperator.IsPlusNumber(item.MinSize)) dest.MinSize=item.MinSize;
|
|
64382
|
+
}
|
|
64249
64383
|
|
|
64250
64384
|
if (style.SplashScreen)
|
|
64251
64385
|
{
|
|
@@ -65416,7 +65550,7 @@ function KLineCustomCalulate()
|
|
|
65416
65550
|
["RenkoCalculate", { Create:function() { return new RenkoCalculate(); } }],
|
|
65417
65551
|
["HeikinAshiCalculate", { Create:function() { return new HeikinAshiCalculate(); } }],
|
|
65418
65552
|
["LineBreakCalcuate", { Create:function() { return new LineBreakCalcuate(); } }],
|
|
65419
|
-
["KagiCalculate", { Create:function(){ return new
|
|
65553
|
+
["KagiCalculate", { Create:function(){ return new KagiCalculate(); } }]
|
|
65420
65554
|
]
|
|
65421
65555
|
);
|
|
65422
65556
|
|
|
@@ -65599,7 +65733,38 @@ function RenkoCalculate()
|
|
|
65599
65733
|
//
|
|
65600
65734
|
function KagiCalculate()
|
|
65601
65735
|
{
|
|
65736
|
+
this.Symbol;
|
|
65737
|
+
this.SourceData;
|
|
65738
|
+
this.FloatPrecision=2; //品种小数位数
|
|
65739
|
+
this.ATR={ Count:14 }; //使用ATR计算砖块大小
|
|
65602
65740
|
|
|
65741
|
+
this.RecvHistoryData=function(sourceData, option) //历史日线数据
|
|
65742
|
+
{
|
|
65743
|
+
this.Symbol=option.Symbol;
|
|
65744
|
+
this.SourceData=sourceData;
|
|
65745
|
+
this.FloatPrecision=GetfloatPrecision(this.Symbol);
|
|
65746
|
+
return this.Calculate(sourceData);
|
|
65747
|
+
}
|
|
65748
|
+
|
|
65749
|
+
this.Calculate=function(sourceData)
|
|
65750
|
+
{
|
|
65751
|
+
var bindData=new ChartData();
|
|
65752
|
+
bindData.Data=[]
|
|
65753
|
+
bindData.Right=sourceData.Right;
|
|
65754
|
+
bindData.Period=sourceData.Period;
|
|
65755
|
+
bindData.DataType=sourceData.DataType;
|
|
65756
|
+
bindData.Symbol=sourceData.symbol;
|
|
65757
|
+
|
|
65758
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(sourceData.Data)) return bindData;
|
|
65759
|
+
|
|
65760
|
+
var periodCount=this.ATR.Count;
|
|
65761
|
+
|
|
65762
|
+
var kItem=sourceData.Data[0];
|
|
65763
|
+
this.LastData=HistoryData.Copy(kItem);
|
|
65764
|
+
for(var i=1; i<sourceData.Data.length; )
|
|
65765
|
+
{
|
|
65766
|
+
}
|
|
65767
|
+
}
|
|
65603
65768
|
}
|
|
65604
65769
|
|
|
65605
65770
|
//////////////////////////////////////////////////////////////////
|
|
@@ -66979,6 +67144,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
66979
67144
|
}
|
|
66980
67145
|
|
|
66981
67146
|
var subFrame=new SubFrameItem();
|
|
67147
|
+
frame.FrameData.SubFrameItem=subFrame;
|
|
66982
67148
|
subFrame.Frame=frame;
|
|
66983
67149
|
if (i==0)
|
|
66984
67150
|
subFrame.Height=20;
|
|
@@ -67045,6 +67211,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
67045
67211
|
}
|
|
67046
67212
|
|
|
67047
67213
|
var subFrame=new SubFrameItem();
|
|
67214
|
+
frame.FrameData.SubFrameItem=subFrame;
|
|
67048
67215
|
subFrame.Frame=frame;
|
|
67049
67216
|
subFrame.Height=10;
|
|
67050
67217
|
|
|
@@ -69564,6 +69731,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
69564
69731
|
else if (obj.ShowRightText===false) frame.IsShow=false;
|
|
69565
69732
|
if (IFrameSplitOperator.IsBool(obj.ShowToolbar)) frame.IsShowToolbar=obj.ShowToolbar; //废弃
|
|
69566
69733
|
if (IFrameSplitOperator.IsBool(obj.IsShareY)) frame.IsShareY=obj.IsShareY;
|
|
69734
|
+
if (IFrameSplitOperator.IsNumber(obj.IsShowMainFrame)) frame.IsShowMainFrame=obj.IsShowMainFrame;
|
|
69567
69735
|
//if (IFrameSplitOperator.IsBool(obj.IsShowIndexTitle)) frame.IsShowIndexTitle=obj.IsShowIndexTitle;
|
|
69568
69736
|
if (IFrameSplitOperator.IsBool(obj.IsCalculateYMaxMin)) frame.IsCalculateYMaxMin=obj.IsCalculateYMaxMin; //是否计算Y最大最小值
|
|
69569
69737
|
|
|
@@ -10762,13 +10762,18 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
10762
10762
|
{
|
|
10763
10763
|
ID:key, Frame:frame, ChartPaint:[] , Max:null, Min:null,
|
|
10764
10764
|
OverlayFrame:[], //共享坐标
|
|
10765
|
-
SingleOverlay:[]
|
|
10765
|
+
SingleOverlay:[], //独立坐标
|
|
10766
|
+
MainOverlayFrame:[null, null], //叠加坐标在主坐标显示[0]=left [1]=right
|
|
10766
10767
|
};
|
|
10767
10768
|
|
|
10768
10769
|
for(var j=0;j<subItem.OverlayIndex.length;++j)
|
|
10769
10770
|
{
|
|
10770
10771
|
var overlayItem=subItem.OverlayIndex[j];
|
|
10771
10772
|
var overlayFrame=overlayItem.Frame;
|
|
10773
|
+
|
|
10774
|
+
if (overlayFrame.IsShowMainFrame===1) item.MainOverlayFrame[0]= overlayFrame;
|
|
10775
|
+
else if (overlayFrame.IsShowMainFrame===2) item.MainOverlayFrame[1]= overlayFrame;
|
|
10776
|
+
|
|
10772
10777
|
if (overlayFrame.IsShareY)
|
|
10773
10778
|
{
|
|
10774
10779
|
if (!overlayFrame.MainFrame) continue;
|
|
@@ -10784,7 +10789,6 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
10784
10789
|
{
|
|
10785
10790
|
item.SingleOverlay.push(overlayItem);
|
|
10786
10791
|
}
|
|
10787
|
-
|
|
10788
10792
|
}
|
|
10789
10793
|
|
|
10790
10794
|
mapFrame.set(key, item);
|
|
@@ -10869,6 +10873,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
10869
10873
|
item.OverlayFrame[j].XYSplit=true;
|
|
10870
10874
|
}
|
|
10871
10875
|
|
|
10876
|
+
//叠加坐标显示在主图坐标 需要同步
|
|
10877
|
+
for(var i=0;i<item.MainOverlayFrame.length;++i)
|
|
10878
|
+
{
|
|
10879
|
+
var subItem=item.MainOverlayFrame[i];
|
|
10880
|
+
if (subItem) subItem.XYSplit=true;
|
|
10881
|
+
}
|
|
10882
|
+
|
|
10872
10883
|
//独立坐标叠加指标
|
|
10873
10884
|
for(var i=0;i<item.SingleOverlay.length;++i)
|
|
10874
10885
|
{
|
|
@@ -13851,6 +13862,8 @@ function AverageWidthFrame()
|
|
|
13851
13862
|
this.XTextExtend; //[0]=底部 { Align:0=默认(居中), 1=左对齐 }
|
|
13852
13863
|
this.XLineExtend; //[0]=底部 { Mode:1, Color: } Mode=1 分割线 Mode=2短线
|
|
13853
13864
|
|
|
13865
|
+
this.FrameData={ SubFrameItem:null }; //窗口框架信息
|
|
13866
|
+
|
|
13854
13867
|
//画图工具刻度
|
|
13855
13868
|
|
|
13856
13869
|
this.DrawPicture={
|
|
@@ -15800,6 +15813,25 @@ function AverageWidthFrame()
|
|
|
15800
15813
|
|
|
15801
15814
|
if (divToolbar.style.display!='none') divToolbar.style.display='none';
|
|
15802
15815
|
}
|
|
15816
|
+
|
|
15817
|
+
this.GetMainOverlayFrame=function()
|
|
15818
|
+
{
|
|
15819
|
+
if (!this.FrameData || !this.FrameData.SubFrameItem) return null;
|
|
15820
|
+
|
|
15821
|
+
var subFrame=this.FrameData.SubFrameItem;
|
|
15822
|
+
var leftFrame=null, rightFrame=null;
|
|
15823
|
+
for(var i=0;i<subFrame.OverlayIndex.length;++i)
|
|
15824
|
+
{
|
|
15825
|
+
var item=subFrame.OverlayIndex[i];
|
|
15826
|
+
var overlayFrame=item.Frame;
|
|
15827
|
+
if (overlayFrame.IsShowMainFrame==2) rightFrame=overlayFrame;
|
|
15828
|
+
else if (overlayFrame.IsShowMainFrame==1) leftFrame=overlayFrame;
|
|
15829
|
+
}
|
|
15830
|
+
|
|
15831
|
+
if (!leftFrame && !rightFrame) return null;
|
|
15832
|
+
|
|
15833
|
+
return [leftFrame, rightFrame];
|
|
15834
|
+
}
|
|
15803
15835
|
}
|
|
15804
15836
|
|
|
15805
15837
|
function MinuteFrame()
|
|
@@ -17909,7 +17941,7 @@ function OverlayMinuteFrame()
|
|
|
17909
17941
|
this.HorizontalMax=this.MainFrame.HorizontalMax;
|
|
17910
17942
|
this.HorizontalMin=this.MainFrame.HorizontalMin;
|
|
17911
17943
|
this.HorizontalInfo=[];
|
|
17912
|
-
for(var i
|
|
17944
|
+
for(var i=0; i<this.MainFrame.HorizontalInfo.length; ++i)
|
|
17913
17945
|
{
|
|
17914
17946
|
var item=this.MainFrame.HorizontalInfo[i];
|
|
17915
17947
|
this.HorizontalInfo.push(item);
|
|
@@ -17919,7 +17951,7 @@ function OverlayMinuteFrame()
|
|
|
17919
17951
|
{
|
|
17920
17952
|
if (this.YSplitOperator!=null) this.YSplitOperator.Operator();
|
|
17921
17953
|
}
|
|
17922
|
-
|
|
17954
|
+
|
|
17923
17955
|
// if (this.XSplitOperator!=null) this.XSplitOperator.Operator(); 子坐标和主坐标X轴一致 所以不用计算
|
|
17924
17956
|
}
|
|
17925
17957
|
}
|
|
@@ -19253,6 +19285,7 @@ function OverlayKLineFrame()
|
|
|
19253
19285
|
|
|
19254
19286
|
this.MainFrame=null; //主框架
|
|
19255
19287
|
this.IsShareY=false; //使用和主框架公用Y轴
|
|
19288
|
+
this.IsShowMainFrame=0; //是否显示在主框架坐标上 1=左边 2=右边
|
|
19256
19289
|
this.IsCalculateYMaxMin=true; //是否计算Y最大最小值
|
|
19257
19290
|
this.RightOffset=50;
|
|
19258
19291
|
this.PenBorder=g_JSChartResource.OverlayFrame.BolderPen; //'rgb(0,0,0)'
|
|
@@ -19463,8 +19496,6 @@ function OverlayKLineFrame()
|
|
|
19463
19496
|
{
|
|
19464
19497
|
if (this.YSplitOperator!=null) this.YSplitOperator.Operator();
|
|
19465
19498
|
}
|
|
19466
|
-
|
|
19467
|
-
// if (this.XSplitOperator!=null) this.XSplitOperator.Operator(); 子坐标和主坐标X轴一致 所以不用计算
|
|
19468
19499
|
}
|
|
19469
19500
|
|
|
19470
19501
|
//画Y轴
|
|
@@ -26486,6 +26517,14 @@ function ChartKLine()
|
|
|
26486
26517
|
this.IsThinAKBar=true; //美国线 柱子是否是线段 (false=柱子)
|
|
26487
26518
|
|
|
26488
26519
|
this.HighLowBarColor=g_JSChartResource.HighLowBarColor;
|
|
26520
|
+
this.HighLowTextConfig=
|
|
26521
|
+
{
|
|
26522
|
+
FontName:g_JSChartResource.HighLowText.FontName,
|
|
26523
|
+
MaxSize:g_JSChartResource.HighLowText.MaxSize,
|
|
26524
|
+
MinSize:g_JSChartResource.HighLowText.MinSize,
|
|
26525
|
+
Color:g_JSChartResource.HighLowText.Color, //未用
|
|
26526
|
+
MaxText:g_JSChartResource.HighLowText.MaxText
|
|
26527
|
+
};
|
|
26489
26528
|
|
|
26490
26529
|
this.HLCAreaConfig=
|
|
26491
26530
|
{
|
|
@@ -28936,6 +28975,12 @@ function ChartKLine()
|
|
|
28936
28975
|
var top=this.ChartBorder.GetTopEx();
|
|
28937
28976
|
var bottom=this.ChartBorder.GetBottomEx();
|
|
28938
28977
|
if (this.ChartBorder.BottomSpace>0) bottom+=1;
|
|
28978
|
+
|
|
28979
|
+
if (this.DrawType==13) //需要显示文字,裁剪要大点
|
|
28980
|
+
{
|
|
28981
|
+
top=this.ChartBorder.GetTopTitle();
|
|
28982
|
+
bottom=this.ChartBorder.GetBottom();
|
|
28983
|
+
}
|
|
28939
28984
|
}
|
|
28940
28985
|
|
|
28941
28986
|
this.Canvas.beginPath();
|
|
@@ -30759,6 +30804,15 @@ function ChartKLine()
|
|
|
30759
30804
|
|
|
30760
30805
|
this.Canvas.fillStyle=this.HighLowBarColor;
|
|
30761
30806
|
this.Canvas.strokeStyle=this.HighLowBarColor;
|
|
30807
|
+
var defaultfloatPrecision=GetfloatPrecision(this.Symbol);
|
|
30808
|
+
var font=this.GetHighLowTextFont(dataWidth,distanceWidth);
|
|
30809
|
+
var bShowText=false;
|
|
30810
|
+
if (font)
|
|
30811
|
+
{
|
|
30812
|
+
bShowText=true;
|
|
30813
|
+
this.Canvas.font=font;
|
|
30814
|
+
}
|
|
30815
|
+
|
|
30762
30816
|
for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length && j<xPointCount;++i,++j,xOffset+=(dataWidth+distanceWidth),++this.ShowRange.DataCount)
|
|
30763
30817
|
{
|
|
30764
30818
|
var data=this.Data.Data[i];
|
|
@@ -30785,6 +30839,7 @@ function ChartKLine()
|
|
|
30785
30839
|
else
|
|
30786
30840
|
{
|
|
30787
30841
|
this.Canvas.fillRect(ToFixedRect(left),ToFixedRect(yBarTop),ToFixedRect(dataWidth),ToFixedRect(barHeight));
|
|
30842
|
+
if (bShowText) this.DrawHighLowText(yHigh, yLow, x, data, defaultfloatPrecision);
|
|
30788
30843
|
//TODO:文字输出
|
|
30789
30844
|
}
|
|
30790
30845
|
}
|
|
@@ -30824,6 +30879,38 @@ function ChartKLine()
|
|
|
30824
30879
|
}
|
|
30825
30880
|
}
|
|
30826
30881
|
|
|
30882
|
+
this.DrawHighLowText=function(yHigh, yLow, x, kItem, floatPrecision)
|
|
30883
|
+
{
|
|
30884
|
+
this.Canvas.textAlign="center";
|
|
30885
|
+
|
|
30886
|
+
var text=kItem.High.toFixed(floatPrecision);
|
|
30887
|
+
this.Canvas.textBaseline="bottom";
|
|
30888
|
+
this.Canvas.fillText(text,x,yHigh-2);
|
|
30889
|
+
|
|
30890
|
+
var text=kItem.Low.toFixed(floatPrecision);
|
|
30891
|
+
this.Canvas.textBaseline="top";
|
|
30892
|
+
this.Canvas.fillText(text,x,yLow+3);
|
|
30893
|
+
}
|
|
30894
|
+
|
|
30895
|
+
this.GetHighLowTextFont=function(dataWidth, distanceWidth)
|
|
30896
|
+
{
|
|
30897
|
+
var barWidth=dataWidth+distanceWidth;
|
|
30898
|
+
var text=this.HighLowTextConfig.MaxText;
|
|
30899
|
+
var min=Math.min(this.HighLowTextConfig.MaxSize,this.HighLowTextConfig.MinSize);
|
|
30900
|
+
var max=Math.max(this.HighLowTextConfig.MaxSize,this.HighLowTextConfig.MinSize);
|
|
30901
|
+
|
|
30902
|
+
for(var i=max; i>=min; --i)
|
|
30903
|
+
{
|
|
30904
|
+
var font=`${i*GetDevicePixelRatio()}px ${this.HighLowTextConfig.FontName}`;
|
|
30905
|
+
this.Canvas.font=font;
|
|
30906
|
+
var textWidth=this.Canvas.measureText(text).width;
|
|
30907
|
+
if (textWidth<=barWidth)
|
|
30908
|
+
return font;
|
|
30909
|
+
}
|
|
30910
|
+
|
|
30911
|
+
return null;
|
|
30912
|
+
}
|
|
30913
|
+
|
|
30827
30914
|
//////////////////////////////////////////////////////////////
|
|
30828
30915
|
//标识缺口
|
|
30829
30916
|
//
|
|
@@ -49589,6 +49676,7 @@ function FrameSplitY()
|
|
|
49589
49676
|
if (this.SplitType!=1) this.Frame.HorizontalInfo = this.Filter(this.Frame.HorizontalInfo,(splitData.Max>0 && splitData.Min<0));
|
|
49590
49677
|
|
|
49591
49678
|
this.RightFrameSplitY();
|
|
49679
|
+
this.MainOverlayFrameSplitY(); //主图Y轴绑定叠加Y轴坐标
|
|
49592
49680
|
this.CallAcutionSplitY(this.SplitCount,splitData);
|
|
49593
49681
|
|
|
49594
49682
|
if (this.EnableRemoveZero) this.RemoveZero(this.Frame.HorizontalInfo);
|
|
@@ -49809,6 +49897,41 @@ function FrameSplitY()
|
|
|
49809
49897
|
}
|
|
49810
49898
|
}
|
|
49811
49899
|
|
|
49900
|
+
this.MainOverlayFrameSplitY=function()
|
|
49901
|
+
{
|
|
49902
|
+
if (!this.Frame.GetMainOverlayFrame) return;
|
|
49903
|
+
var aryOverlayFrame=this.Frame.GetMainOverlayFrame();
|
|
49904
|
+
if (!aryOverlayFrame ) return;
|
|
49905
|
+
|
|
49906
|
+
if (aryOverlayFrame[1])
|
|
49907
|
+
{
|
|
49908
|
+
var rightFrame=aryOverlayFrame[1];
|
|
49909
|
+
if (rightFrame.YSplitOperator) rightFrame.YSplitOperator.Operator();
|
|
49910
|
+
|
|
49911
|
+
for(var i=0;i<this.Frame.HorizontalInfo.length;++i)
|
|
49912
|
+
{
|
|
49913
|
+
var item=this.Frame.HorizontalInfo[i];
|
|
49914
|
+
var y=this.Frame.GetYFromData(item.Value);
|
|
49915
|
+
var yValue=rightFrame.GetYData(y);
|
|
49916
|
+
item.Message[1] = IFrameSplitOperator.FormatValueString(yValue, this.FloatPrecision,this.LanguageID);
|
|
49917
|
+
}
|
|
49918
|
+
}
|
|
49919
|
+
|
|
49920
|
+
if (aryOverlayFrame[0])
|
|
49921
|
+
{
|
|
49922
|
+
var leftFrame=aryOverlayFrame[0];
|
|
49923
|
+
if (leftFrame.YSplitOperator) leftFrame.YSplitOperator.Operator();
|
|
49924
|
+
|
|
49925
|
+
for(var i=0;i<this.Frame.HorizontalInfo.length;++i)
|
|
49926
|
+
{
|
|
49927
|
+
var item=this.Frame.HorizontalInfo[i];
|
|
49928
|
+
var y=this.Frame.GetYFromData(item.Value);
|
|
49929
|
+
var yValue=leftFrame.GetYData(y);
|
|
49930
|
+
item.Message[0] = IFrameSplitOperator.FormatValueString(yValue, this.FloatPrecision,this.LanguageID);
|
|
49931
|
+
}
|
|
49932
|
+
}
|
|
49933
|
+
}
|
|
49934
|
+
|
|
49812
49935
|
this.CustomCoordinate=function()
|
|
49813
49936
|
{
|
|
49814
49937
|
this.Frame.CustomHorizontalInfo=[];
|
|
@@ -66968,6 +67091,7 @@ function JSChartResource()
|
|
|
66968
67091
|
this.UnchagneBarColor="rgb(0,0,0)"; //平盘柱子颜色
|
|
66969
67092
|
this.EmptyBarBGColor="rgb(255,255,255)"; //空心柱子背景色
|
|
66970
67093
|
this.HighLowBarColor='rgb(41,98,255)'; //high low bar 颜色
|
|
67094
|
+
this.HighLowText={ FontName:"arial", MaxSize:30, MinSize:4, Color:"rgb(41,98,255)", MaxText:"9999.9" };
|
|
66971
67095
|
|
|
66972
67096
|
this.SplashScreen=
|
|
66973
67097
|
{
|
|
@@ -68138,6 +68262,16 @@ function JSChartResource()
|
|
|
68138
68262
|
if (style.UnchagneBarColor) this.UnchagneBarColor = style.UnchagneBarColor;
|
|
68139
68263
|
if (style.EmptyBarBGColor) this.EmptyBarBGColor=style.EmptyBarBGColor;
|
|
68140
68264
|
if (style.HighLowBarColor) this.HighLowBarColor=style.HighLowBarColor;
|
|
68265
|
+
if (style.HighLowText)
|
|
68266
|
+
{
|
|
68267
|
+
var dest=this.HighLowText;
|
|
68268
|
+
var item=style.HighLowText;
|
|
68269
|
+
if (item.FontName) dest.FontName=item.FontName;
|
|
68270
|
+
if (item.Color) dest.Color=item.Color;
|
|
68271
|
+
if (item.MaxText) dest.MaxText=item.MaxText;
|
|
68272
|
+
if (IFrameSplitOperator.IsPlusNumber(item.MaxSize)) dest.MaxSize=item.MaxSize;
|
|
68273
|
+
if (IFrameSplitOperator.IsPlusNumber(item.MinSize)) dest.MinSize=item.MinSize;
|
|
68274
|
+
}
|
|
68141
68275
|
|
|
68142
68276
|
if (style.SplashScreen)
|
|
68143
68277
|
{
|
|
@@ -69308,7 +69442,7 @@ function KLineCustomCalulate()
|
|
|
69308
69442
|
["RenkoCalculate", { Create:function() { return new RenkoCalculate(); } }],
|
|
69309
69443
|
["HeikinAshiCalculate", { Create:function() { return new HeikinAshiCalculate(); } }],
|
|
69310
69444
|
["LineBreakCalcuate", { Create:function() { return new LineBreakCalcuate(); } }],
|
|
69311
|
-
["KagiCalculate", { Create:function(){ return new
|
|
69445
|
+
["KagiCalculate", { Create:function(){ return new KagiCalculate(); } }]
|
|
69312
69446
|
]
|
|
69313
69447
|
);
|
|
69314
69448
|
|
|
@@ -69491,7 +69625,38 @@ function RenkoCalculate()
|
|
|
69491
69625
|
//
|
|
69492
69626
|
function KagiCalculate()
|
|
69493
69627
|
{
|
|
69628
|
+
this.Symbol;
|
|
69629
|
+
this.SourceData;
|
|
69630
|
+
this.FloatPrecision=2; //品种小数位数
|
|
69631
|
+
this.ATR={ Count:14 }; //使用ATR计算砖块大小
|
|
69494
69632
|
|
|
69633
|
+
this.RecvHistoryData=function(sourceData, option) //历史日线数据
|
|
69634
|
+
{
|
|
69635
|
+
this.Symbol=option.Symbol;
|
|
69636
|
+
this.SourceData=sourceData;
|
|
69637
|
+
this.FloatPrecision=GetfloatPrecision(this.Symbol);
|
|
69638
|
+
return this.Calculate(sourceData);
|
|
69639
|
+
}
|
|
69640
|
+
|
|
69641
|
+
this.Calculate=function(sourceData)
|
|
69642
|
+
{
|
|
69643
|
+
var bindData=new ChartData();
|
|
69644
|
+
bindData.Data=[]
|
|
69645
|
+
bindData.Right=sourceData.Right;
|
|
69646
|
+
bindData.Period=sourceData.Period;
|
|
69647
|
+
bindData.DataType=sourceData.DataType;
|
|
69648
|
+
bindData.Symbol=sourceData.symbol;
|
|
69649
|
+
|
|
69650
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(sourceData.Data)) return bindData;
|
|
69651
|
+
|
|
69652
|
+
var periodCount=this.ATR.Count;
|
|
69653
|
+
|
|
69654
|
+
var kItem=sourceData.Data[0];
|
|
69655
|
+
this.LastData=HistoryData.Copy(kItem);
|
|
69656
|
+
for(var i=1; i<sourceData.Data.length; )
|
|
69657
|
+
{
|
|
69658
|
+
}
|
|
69659
|
+
}
|
|
69495
69660
|
}
|
|
69496
69661
|
|
|
69497
69662
|
//////////////////////////////////////////////////////////////////
|
|
@@ -70871,6 +71036,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
70871
71036
|
}
|
|
70872
71037
|
|
|
70873
71038
|
var subFrame=new SubFrameItem();
|
|
71039
|
+
frame.FrameData.SubFrameItem=subFrame;
|
|
70874
71040
|
subFrame.Frame=frame;
|
|
70875
71041
|
if (i==0)
|
|
70876
71042
|
subFrame.Height=20;
|
|
@@ -70937,6 +71103,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
70937
71103
|
}
|
|
70938
71104
|
|
|
70939
71105
|
var subFrame=new SubFrameItem();
|
|
71106
|
+
frame.FrameData.SubFrameItem=subFrame;
|
|
70940
71107
|
subFrame.Frame=frame;
|
|
70941
71108
|
subFrame.Height=10;
|
|
70942
71109
|
|
|
@@ -73456,6 +73623,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
73456
73623
|
else if (obj.ShowRightText===false) frame.IsShow=false;
|
|
73457
73624
|
if (IFrameSplitOperator.IsBool(obj.ShowToolbar)) frame.IsShowToolbar=obj.ShowToolbar; //废弃
|
|
73458
73625
|
if (IFrameSplitOperator.IsBool(obj.IsShareY)) frame.IsShareY=obj.IsShareY;
|
|
73626
|
+
if (IFrameSplitOperator.IsNumber(obj.IsShowMainFrame)) frame.IsShowMainFrame=obj.IsShowMainFrame;
|
|
73459
73627
|
//if (IFrameSplitOperator.IsBool(obj.IsShowIndexTitle)) frame.IsShowIndexTitle=obj.IsShowIndexTitle;
|
|
73460
73628
|
if (IFrameSplitOperator.IsBool(obj.IsCalculateYMaxMin)) frame.IsCalculateYMaxMin=obj.IsCalculateYMaxMin; //是否计算Y最大最小值
|
|
73461
73629
|
|
|
@@ -131588,7 +131756,7 @@ function ScrollBarBGChart()
|
|
|
131588
131756
|
|
|
131589
131757
|
|
|
131590
131758
|
|
|
131591
|
-
var HQCHART_VERSION="1.1.
|
|
131759
|
+
var HQCHART_VERSION="1.1.13139";
|
|
131592
131760
|
|
|
131593
131761
|
function PrintHQChartVersion()
|
|
131594
131762
|
{
|