hqchart 1.1.12977 → 1.1.12988
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 +36 -18
- package/package.json +1 -1
- package/src/jscommon/umychart.js +336 -4
- package/src/jscommon/umychart.style.js +6 -0
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +343 -5
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.vue.js +343 -5
package/src/jscommon/umychart.js
CHANGED
|
@@ -519,9 +519,16 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
519
519
|
|
|
520
520
|
if (option.KLine)
|
|
521
521
|
{
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
if (option.KLine.
|
|
522
|
+
var item=option.KLine;
|
|
523
|
+
var klineChart=chart.ChartPaint[0];
|
|
524
|
+
if (option.KLine.ShowKLine == false) klineChart.IsShow = false;
|
|
525
|
+
if (option.KLine.InfoPosition>0) klineChart.InfoPosition=option.KLine.InfoPosition;
|
|
526
|
+
if (IFrameSplitOperator.IsBool(item.IsShowMaxMinPrice)) klineChart.IsShowMaxMinPrice=item.IsShowMaxMinPrice;
|
|
527
|
+
if (item.PriceGap)
|
|
528
|
+
{
|
|
529
|
+
if (IFrameSplitOperator.IsBool(item.PriceGap.Enable)) klineChart.PriceGap.Enable=item.PriceGap.Enable;
|
|
530
|
+
if (IFrameSplitOperator.IsNumber(item.PriceGap.Count)) klineChart.PriceGap.Count=item.PriceGap.Count;
|
|
531
|
+
}
|
|
525
532
|
}
|
|
526
533
|
|
|
527
534
|
if(option.KLineTitle)
|
|
@@ -2100,6 +2107,15 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
2100
2107
|
return this.JSChartContainer.ExportData(option);
|
|
2101
2108
|
}
|
|
2102
2109
|
}
|
|
2110
|
+
|
|
2111
|
+
this.ChangePriceGap=function(option)
|
|
2112
|
+
{
|
|
2113
|
+
if(this.JSChartContainer && typeof(this.JSChartContainer.ChangePriceGap)=='function')
|
|
2114
|
+
{
|
|
2115
|
+
JSConsole.Chart.Log('[JSChart:ChangePriceGap] ');
|
|
2116
|
+
return this.JSChartContainer.ChangePriceGap(option);
|
|
2117
|
+
}
|
|
2118
|
+
}
|
|
2103
2119
|
}
|
|
2104
2120
|
|
|
2105
2121
|
JSChart.LastVersion=null; //最新的版本号
|
|
@@ -22533,6 +22549,15 @@ function ChartKLine()
|
|
|
22533
22549
|
this.AryOrderFlowBorder=[]; //订单流边框 临时变量
|
|
22534
22550
|
|
|
22535
22551
|
this.ChartHeatMap; //=new ChartHeatMap();
|
|
22552
|
+
|
|
22553
|
+
//未回补的价格缺口
|
|
22554
|
+
this.PriceGap={ Enable:false, Count:1 };
|
|
22555
|
+
this.PriceGapStyple=
|
|
22556
|
+
{
|
|
22557
|
+
Line:{ Color:g_JSChartResource.PriceGapStyple.Line.Color },
|
|
22558
|
+
Text:{ Color:g_JSChartResource.PriceGapStyple.Text.Color, Font: g_JSChartResource.PriceGapStyple.Text.Font }
|
|
22559
|
+
};
|
|
22560
|
+
this.AryPriceGapCache=[]; //缺口数据 { }
|
|
22536
22561
|
|
|
22537
22562
|
this.ReloadResource=function(resource)
|
|
22538
22563
|
{
|
|
@@ -22633,6 +22658,7 @@ function ChartKLine()
|
|
|
22633
22658
|
eventUnchangeKLine=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_UNCHANGE_KLINE_COLOR);
|
|
22634
22659
|
}
|
|
22635
22660
|
|
|
22661
|
+
var preKItemInfo=null;
|
|
22636
22662
|
for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length && j<xPointCount;++i,++j,xOffset+=(dataWidth+distanceWidth),++this.ShowRange.DataCount)
|
|
22637
22663
|
{
|
|
22638
22664
|
var data=this.Data.Data[i];
|
|
@@ -22649,6 +22675,8 @@ function ChartKLine()
|
|
|
22649
22675
|
var yClose=this.GetYFromData(data.Close,false);
|
|
22650
22676
|
this.DrawKRange.End=i;
|
|
22651
22677
|
|
|
22678
|
+
var kItemInfo={ Data:data, Coordinate:{ X:x, Low:yLow, High:yHigh, Close:yClose, Open:yClose, Left:left, Right:right }};
|
|
22679
|
+
|
|
22652
22680
|
if (ptMax.Value==null || ptMax.Value<data.High) //求最大值
|
|
22653
22681
|
{
|
|
22654
22682
|
ptMax.X=x;
|
|
@@ -22767,6 +22795,17 @@ function ChartKLine()
|
|
|
22767
22795
|
var infoItem={Xleft:left,XRight:right, YMax:yHigh, XCenter:x, YMin:yLow, DayData:data, Index:j};
|
|
22768
22796
|
this.DrawInfo(infoItem);
|
|
22769
22797
|
}
|
|
22798
|
+
|
|
22799
|
+
if (this.PriceGap.Enable && preKItemInfo)
|
|
22800
|
+
{
|
|
22801
|
+
this.CheckPriceGrap(data);
|
|
22802
|
+
|
|
22803
|
+
var value=this.IsPriceGrap(kItemInfo,preKItemInfo);
|
|
22804
|
+
if (value>0)
|
|
22805
|
+
this.AryPriceGapCache.push({ Data:[preKItemInfo, kItemInfo], Type:value });
|
|
22806
|
+
}
|
|
22807
|
+
|
|
22808
|
+
preKItemInfo=kItemInfo;
|
|
22770
22809
|
}
|
|
22771
22810
|
|
|
22772
22811
|
this.PtMax=ptMax;
|
|
@@ -22903,6 +22942,7 @@ function ChartKLine()
|
|
|
22903
22942
|
this.ShowRange.ShowCount=xPointCount;
|
|
22904
22943
|
this.DrawKRange.Start=this.Data.DataOffset;
|
|
22905
22944
|
|
|
22945
|
+
var preKItemInfo=null;
|
|
22906
22946
|
for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length && j<xPointCount;++i,++j,xOffset+=(dataWidth+distanceWidth),++this.ShowRange.DataCount)
|
|
22907
22947
|
{
|
|
22908
22948
|
var data=this.Data.Data[i];
|
|
@@ -22940,6 +22980,24 @@ function ChartKLine()
|
|
|
22940
22980
|
{
|
|
22941
22981
|
ptLast={ X:x, Y:yClose, XLeft:left, XRight:right, KItem:data, ChartRight:chartright };
|
|
22942
22982
|
}
|
|
22983
|
+
|
|
22984
|
+
if (this.PriceGap.Enable )
|
|
22985
|
+
{
|
|
22986
|
+
var yLow=this.GetYFromData(data.Low, false);
|
|
22987
|
+
var yHigh=this.GetYFromData(data.High, false);
|
|
22988
|
+
var yOpen=this.GetYFromData(data.Open, false);
|
|
22989
|
+
|
|
22990
|
+
var kItemInfo={ Data:data, Coordinate:{ X:x, Low:yLow, High:yHigh, Close:yClose, Open:yClose, Left:left, Right:right }};
|
|
22991
|
+
|
|
22992
|
+
if (preKItemInfo)
|
|
22993
|
+
{
|
|
22994
|
+
this.CheckPriceGrap(data);
|
|
22995
|
+
var value=this.IsPriceGrap(kItemInfo,preKItemInfo);
|
|
22996
|
+
if (value>0) this.AryPriceGapCache.push({ Data:[preKItemInfo, kItemInfo], Type:value });
|
|
22997
|
+
}
|
|
22998
|
+
|
|
22999
|
+
preKItemInfo=kItemInfo;
|
|
23000
|
+
}
|
|
22943
23001
|
}
|
|
22944
23002
|
|
|
22945
23003
|
this.DrawLastPointEvent(ptLast); //通知外部绘制最后一个点
|
|
@@ -23013,6 +23071,7 @@ function ChartKLine()
|
|
|
23013
23071
|
this.ShowRange.ShowCount=xPointCount;
|
|
23014
23072
|
this.DrawKRange.Start=this.Data.DataOffset;
|
|
23015
23073
|
|
|
23074
|
+
var preKItemInfo=null;
|
|
23016
23075
|
for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length && j<xPointCount;++i,++j,xOffset+=(dataWidth+distanceWidth),++this.ShowRange.DataCount)
|
|
23017
23076
|
{
|
|
23018
23077
|
var data=this.Data.Data[i];
|
|
@@ -23037,6 +23096,24 @@ function ChartKLine()
|
|
|
23037
23096
|
if (isHScreen) this.Canvas.lineTo(yClose,x);
|
|
23038
23097
|
else this.Canvas.lineTo(x,yClose);
|
|
23039
23098
|
}
|
|
23099
|
+
|
|
23100
|
+
if (this.PriceGap.Enable )
|
|
23101
|
+
{
|
|
23102
|
+
var yLow=this.GetYFromData(data.Low, false);
|
|
23103
|
+
var yHigh=this.GetYFromData(data.High, false);
|
|
23104
|
+
var yOpen=this.GetYFromData(data.Open, false);
|
|
23105
|
+
|
|
23106
|
+
var kItemInfo={ Data:data, Coordinate:{ X:x, Low:yLow, High:yHigh, Close:yClose, Open:yClose, Left:left, Right:right }};
|
|
23107
|
+
|
|
23108
|
+
if (preKItemInfo)
|
|
23109
|
+
{
|
|
23110
|
+
this.CheckPriceGrap(data);
|
|
23111
|
+
var value=this.IsPriceGrap(kItemInfo,preKItemInfo);
|
|
23112
|
+
if (value>0) this.AryPriceGapCache.push({ Data:[preKItemInfo, kItemInfo], Type:value });
|
|
23113
|
+
}
|
|
23114
|
+
|
|
23115
|
+
preKItemInfo=kItemInfo;
|
|
23116
|
+
}
|
|
23040
23117
|
}
|
|
23041
23118
|
|
|
23042
23119
|
if (bFirstPoint==false) this.Canvas.stroke();
|
|
@@ -23079,6 +23156,7 @@ function ChartKLine()
|
|
|
23079
23156
|
eventUnchangeKLine=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_UNCHANGE_KLINE_COLOR);
|
|
23080
23157
|
}
|
|
23081
23158
|
|
|
23159
|
+
var preKItemInfo=null;
|
|
23082
23160
|
for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length && j<xPointCount;++i,++j,xOffset+=(dataWidth+distanceWidth),++this.ShowRange.DataCount)
|
|
23083
23161
|
{
|
|
23084
23162
|
var data=this.Data.Data[i];
|
|
@@ -23095,6 +23173,8 @@ function ChartKLine()
|
|
|
23095
23173
|
var yClose=this.GetYFromData(data.Close, false);
|
|
23096
23174
|
var y=yHigh;
|
|
23097
23175
|
|
|
23176
|
+
var kItemInfo={ Data:data, Coordinate:{ X:x, Low:yLow, High:yHigh, Close:yClose, Open:yClose, Left:left, Right:right }};
|
|
23177
|
+
|
|
23098
23178
|
this.DrawKRange.End=i;
|
|
23099
23179
|
if (ptMax.Value==null || ptMax.Value<data.High) //求最大值
|
|
23100
23180
|
{
|
|
@@ -23198,6 +23278,17 @@ function ChartKLine()
|
|
|
23198
23278
|
{
|
|
23199
23279
|
ptLast={ X:x, Y:yClose, XLeft:left, XRight:right, KItem:data, ChartRight:chartright };
|
|
23200
23280
|
}
|
|
23281
|
+
|
|
23282
|
+
if (this.PriceGap.Enable && preKItemInfo)
|
|
23283
|
+
{
|
|
23284
|
+
this.CheckPriceGrap(data);
|
|
23285
|
+
|
|
23286
|
+
var value=this.IsPriceGrap(kItemInfo,preKItemInfo);
|
|
23287
|
+
if (value>0)
|
|
23288
|
+
this.AryPriceGapCache.push({ Data:[preKItemInfo, kItemInfo], Type:value });
|
|
23289
|
+
}
|
|
23290
|
+
|
|
23291
|
+
preKItemInfo=kItemInfo;
|
|
23201
23292
|
}
|
|
23202
23293
|
|
|
23203
23294
|
this.DrawLastPointEvent(ptLast); //通知外部绘制最后一个点
|
|
@@ -24836,6 +24927,7 @@ function ChartKLine()
|
|
|
24836
24927
|
this.PtMax={X:null,Y:null,Value:null,Align:'left'}; //清空最大
|
|
24837
24928
|
this.PtMin={X:null,Y:null,Value:null,Align:'left'}; //清空最小
|
|
24838
24929
|
this.DrawKRange={ Start:null, End:null };
|
|
24930
|
+
this.AryPriceGapCache=[];
|
|
24839
24931
|
|
|
24840
24932
|
this.ChartFrame.ChartKLine={Max:null, Min:null }; //保存K线上 显示最大最小值坐标
|
|
24841
24933
|
|
|
@@ -24876,6 +24968,7 @@ function ChartKLine()
|
|
|
24876
24968
|
{
|
|
24877
24969
|
this.DrawCloseLine();
|
|
24878
24970
|
this.Canvas.restore();
|
|
24971
|
+
if (this.PriceGap.Enable) this.DrawPriceGap();
|
|
24879
24972
|
return;
|
|
24880
24973
|
}
|
|
24881
24974
|
else if (this.DrawType==2)
|
|
@@ -24936,8 +25029,11 @@ function ChartKLine()
|
|
|
24936
25029
|
|
|
24937
25030
|
if (this.TradeIcon) this.DrawTradeIcon()
|
|
24938
25031
|
else this.DrawTrade();
|
|
25032
|
+
|
|
24939
25033
|
this.Canvas.restore();
|
|
24940
25034
|
|
|
25035
|
+
if (this.PriceGap.Enable) this.DrawPriceGap();
|
|
25036
|
+
|
|
24941
25037
|
if (this.IsShowMaxMinPrice) //标注最大值最小值
|
|
24942
25038
|
{
|
|
24943
25039
|
if (this.ChartFrame.IsHScreen===true) this.HScreenDrawMaxMinPrice(this.PtMax,this.PtMin);
|
|
@@ -26693,6 +26789,169 @@ function ChartKLine()
|
|
|
26693
26789
|
|
|
26694
26790
|
}
|
|
26695
26791
|
}
|
|
26792
|
+
|
|
26793
|
+
//////////////////////////////////////////////////////////////
|
|
26794
|
+
//标识缺口
|
|
26795
|
+
//
|
|
26796
|
+
/////////////////////////////////////////////////////////////
|
|
26797
|
+
this.DrawPriceGap=function()
|
|
26798
|
+
{
|
|
26799
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(this.AryPriceGapCache)) return;
|
|
26800
|
+
if (this.PriceGap.Count<=0) return;
|
|
26801
|
+
|
|
26802
|
+
var index=this.AryPriceGapCache.length-this.PriceGap.Count;
|
|
26803
|
+
if (index<0) index=0;
|
|
26804
|
+
|
|
26805
|
+
var isHScreen=(this.ChartFrame.IsHScreen===true);
|
|
26806
|
+
var border=null;
|
|
26807
|
+
|
|
26808
|
+
if (isHScreen) border=this.ChartBorder.GetHScreenBorder();
|
|
26809
|
+
else border=this.ChartBorder.GetBorder();
|
|
26810
|
+
|
|
26811
|
+
this.Canvas.font=this.PriceGapStyple.Text.Font;
|
|
26812
|
+
this.Canvas.textAlign = 'left';
|
|
26813
|
+
this.Canvas.textBaseline = 'bottom';
|
|
26814
|
+
var textHeight=this.Canvas.measureText("擎").width;
|
|
26815
|
+
var decNum=GetfloatPrecision(this.Symbol);
|
|
26816
|
+
|
|
26817
|
+
for(var i=index;i<this.AryPriceGapCache.length;++i)
|
|
26818
|
+
{
|
|
26819
|
+
var item=this.AryPriceGapCache[i];
|
|
26820
|
+
var start=item.Data[0];
|
|
26821
|
+
var end=item.Data[1];
|
|
26822
|
+
var rect=null, rtText=null, text=null;
|
|
26823
|
+
if (item.Type==1) //上缺口
|
|
26824
|
+
{
|
|
26825
|
+
if (isHScreen)
|
|
26826
|
+
{
|
|
26827
|
+
rect={ Left:start.Coordinate.High, Right:end.Coordinate.Low, Top:start.Coordinate.X, Bottom: border.Bottom };
|
|
26828
|
+
rect.Width=rect.Right-rect.Left;
|
|
26829
|
+
rect.Height=rect.Bottom-rect.Top;
|
|
26830
|
+
|
|
26831
|
+
rtText={ Left:start.Coordinate.High-textHeight-2, Top:start.Coordinate.Right+2, Height:textHeight };
|
|
26832
|
+
rtText.Bottom=rtText.Top+rtText.Height;
|
|
26833
|
+
}
|
|
26834
|
+
else
|
|
26835
|
+
{
|
|
26836
|
+
rect={ Left:start.Coordinate.X, Right:border.Right, Top:end.Coordinate.Low, Bottom:start.Coordinate.High };
|
|
26837
|
+
rect.Width=rect.Right-rect.Left;
|
|
26838
|
+
rect.Height=rect.Bottom-rect.Top;
|
|
26839
|
+
|
|
26840
|
+
rtText={ Left:start.Coordinate.Right+2, Top:rect.Bottom+2, Right:rect.Right, Height:textHeight };
|
|
26841
|
+
rtText.Bottom=rtText.Top+rtText.Height;
|
|
26842
|
+
}
|
|
26843
|
+
|
|
26844
|
+
text=`${start.Data.High.toFixed(decNum)}-${end.Data.Low.toFixed(decNum)}`;
|
|
26845
|
+
|
|
26846
|
+
}
|
|
26847
|
+
else if (item.Type==2) //下缺口
|
|
26848
|
+
{
|
|
26849
|
+
if (isHScreen)
|
|
26850
|
+
{
|
|
26851
|
+
rect={ Left:start.Coordinate.Low, Right:end.Coordinate.High, Top:start.Coordinate.X, Bottom: border.Bottom };
|
|
26852
|
+
rect.Width=rect.Right-rect.Left;
|
|
26853
|
+
rect.Height=rect.Bottom-rect.Top;
|
|
26854
|
+
|
|
26855
|
+
rtText={ Left:start.Coordinate.Low+2, Top:start.Coordinate.Right+2, Height:textHeight };
|
|
26856
|
+
rtText.Bottom=rtText.Top+rtText.Height;
|
|
26857
|
+
}
|
|
26858
|
+
else
|
|
26859
|
+
{
|
|
26860
|
+
rect={ Left:start.Coordinate.X, Right:border.Right, Top:start.Coordinate.Low, Bottom:end.Coordinate.High };
|
|
26861
|
+
rect.Width=rect.Right-rect.Left;
|
|
26862
|
+
rect.Height=rect.Bottom-rect.Top;
|
|
26863
|
+
|
|
26864
|
+
rtText={ Left:start.Coordinate.Right+2, Bottom:rect.Top, Right:rect.Right, Height:textHeight };
|
|
26865
|
+
rtText.Top=rtText.Bottom-rtText.Height;
|
|
26866
|
+
}
|
|
26867
|
+
|
|
26868
|
+
text=`${start.Data.Low.toFixed(decNum)}-${end.Data.High.toFixed(decNum)}`;
|
|
26869
|
+
}
|
|
26870
|
+
else
|
|
26871
|
+
{
|
|
26872
|
+
continue;
|
|
26873
|
+
}
|
|
26874
|
+
|
|
26875
|
+
if (!rect) return;
|
|
26876
|
+
|
|
26877
|
+
this.Canvas.fillStyle=this.PriceGapStyple.Line.Color;
|
|
26878
|
+
this.Canvas.fillRect(rect.Left, rect.Top,rect.Width, rect.Height);
|
|
26879
|
+
|
|
26880
|
+
if (rtText)
|
|
26881
|
+
{
|
|
26882
|
+
var textWidth=this.Canvas.measureText(text).width;
|
|
26883
|
+
rtText.Width=textWidth;
|
|
26884
|
+
rtText.Right=rtText.Left+rtText.Width;
|
|
26885
|
+
|
|
26886
|
+
this.Canvas.fillStyle=this.PriceGapStyple.Text.Color;
|
|
26887
|
+
|
|
26888
|
+
if (isHScreen)
|
|
26889
|
+
{
|
|
26890
|
+
this.Canvas.save();
|
|
26891
|
+
this.Canvas.translate(rtText.Left, rtText.Top);
|
|
26892
|
+
this.Canvas.rotate(90 * Math.PI / 180);
|
|
26893
|
+
this.Canvas.fillText(text,0,0);
|
|
26894
|
+
this.Canvas.restore();
|
|
26895
|
+
}
|
|
26896
|
+
else
|
|
26897
|
+
{
|
|
26898
|
+
if (rtText.Right>rect.Right)
|
|
26899
|
+
{
|
|
26900
|
+
rtText.Right=rect.Right;
|
|
26901
|
+
rtText.Left=rtText.Right-rtText.Width;
|
|
26902
|
+
}
|
|
26903
|
+
|
|
26904
|
+
this.Canvas.fillStyle=this.PriceGapStyple.Text.Color;
|
|
26905
|
+
this.Canvas.fillText(text,rtText.Left,rtText.Bottom);
|
|
26906
|
+
}
|
|
26907
|
+
|
|
26908
|
+
//this.Canvas.fillStyle="rgb(250,250,250)"
|
|
26909
|
+
//this.Canvas.fillRect(rtText.Left, rtText.Top, rtText.Width, rtText.Height);
|
|
26910
|
+
|
|
26911
|
+
|
|
26912
|
+
}
|
|
26913
|
+
}
|
|
26914
|
+
|
|
26915
|
+
}
|
|
26916
|
+
|
|
26917
|
+
//是否有缺口
|
|
26918
|
+
this.IsPriceGrap=function(item, preItem)
|
|
26919
|
+
{
|
|
26920
|
+
if (!preItem || !item) return 0;
|
|
26921
|
+
|
|
26922
|
+
if (preItem.Data.Low>item.Data.High) return 2; //下缺口
|
|
26923
|
+
|
|
26924
|
+
if (preItem.Data.High<item.Data.Low) return 1; //上缺口
|
|
26925
|
+
|
|
26926
|
+
return -1;
|
|
26927
|
+
}
|
|
26928
|
+
|
|
26929
|
+
this.CheckPriceGrap=function(kItem)
|
|
26930
|
+
{
|
|
26931
|
+
for(var i=0;i<this.AryPriceGapCache.length;++i)
|
|
26932
|
+
{
|
|
26933
|
+
var item=this.AryPriceGapCache[i];
|
|
26934
|
+
var start=item.Data[0];
|
|
26935
|
+
if (item.Type==1) //上缺口
|
|
26936
|
+
{
|
|
26937
|
+
if (kItem.Low<=start.Data.High)
|
|
26938
|
+
{
|
|
26939
|
+
this.AryPriceGapCache.splice(i,1);
|
|
26940
|
+
--i;
|
|
26941
|
+
continue;
|
|
26942
|
+
}
|
|
26943
|
+
}
|
|
26944
|
+
else if (item.Type==2) //下缺口
|
|
26945
|
+
{
|
|
26946
|
+
if (kItem.High>=start.Data.Low)
|
|
26947
|
+
{
|
|
26948
|
+
this.AryPriceGapCache.splice(i,1);
|
|
26949
|
+
--i;
|
|
26950
|
+
continue;
|
|
26951
|
+
}
|
|
26952
|
+
}
|
|
26953
|
+
}
|
|
26954
|
+
}
|
|
26696
26955
|
|
|
26697
26956
|
}
|
|
26698
26957
|
|
|
@@ -36157,7 +36416,7 @@ function ChartMultiText()
|
|
|
36157
36416
|
for(var k=0;k<textItem.Data.length;++k)
|
|
36158
36417
|
{
|
|
36159
36418
|
var item=textItem.Data[k];
|
|
36160
|
-
|
|
36419
|
+
var y=top;
|
|
36161
36420
|
if (item.Value=="TOP") y=top;
|
|
36162
36421
|
else if (item.Value=="BOTTOM") y=bottom;
|
|
36163
36422
|
else y=this.ChartFrame.GetYFromData(item.Value);
|
|
@@ -62157,6 +62416,12 @@ function JSChartResource()
|
|
|
62157
62416
|
LineDash:[2,2]
|
|
62158
62417
|
};
|
|
62159
62418
|
|
|
62419
|
+
this.PriceGapStyple=
|
|
62420
|
+
{
|
|
62421
|
+
Line:{ Color:"rgb(186,186,186)" },
|
|
62422
|
+
Text:{ Color:"rgb(105,105,105)", Font:`${12*GetDevicePixelRatio()}px 微软雅黑`}
|
|
62423
|
+
};
|
|
62424
|
+
|
|
62160
62425
|
//订单流配置
|
|
62161
62426
|
this.OrderFlow=
|
|
62162
62427
|
{
|
|
@@ -63115,6 +63380,17 @@ function JSChartResource()
|
|
|
63115
63380
|
if (item.LineDash) this.VirtualKLine.LineDash=item.LineDash;
|
|
63116
63381
|
}
|
|
63117
63382
|
|
|
63383
|
+
if (style.PriceGapStyple)
|
|
63384
|
+
{
|
|
63385
|
+
var item=style.PriceGapStyple;
|
|
63386
|
+
if (item.Line && item.Line.Color) this.PriceGapStyple.Line.Color=item.Line.Color;
|
|
63387
|
+
if (item.Text)
|
|
63388
|
+
{
|
|
63389
|
+
if (item.Text.Color) this.PriceGapStyple.Text.Color=item.Text.Color;
|
|
63390
|
+
if (item.Text.Font) this.PriceGapStyple.Text.Font=item.Text.Font;
|
|
63391
|
+
}
|
|
63392
|
+
}
|
|
63393
|
+
|
|
63118
63394
|
if (style.Index)
|
|
63119
63395
|
{
|
|
63120
63396
|
if (style.Index.LineColor) this.Index.LineColor = style.Index.LineColor;
|
|
@@ -71359,6 +71635,18 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
71359
71635
|
|
|
71360
71636
|
this.ScrollBar.Reset({Draw:true});
|
|
71361
71637
|
}
|
|
71638
|
+
|
|
71639
|
+
this.ChangePriceGap=function(obj)
|
|
71640
|
+
{
|
|
71641
|
+
if (!obj) return;
|
|
71642
|
+
var klineChart=this.ChartPaint[0];
|
|
71643
|
+
if (!klineChart) return;
|
|
71644
|
+
|
|
71645
|
+
if (IFrameSplitOperator.IsNumber(obj.Count)) klineChart.PriceGap.Count=obj.Count;
|
|
71646
|
+
if (IFrameSplitOperator.IsBool(obj.Enable)) klineChart.PriceGap.Enable=obj.Enable;
|
|
71647
|
+
|
|
71648
|
+
this.Draw();
|
|
71649
|
+
}
|
|
71362
71650
|
}
|
|
71363
71651
|
|
|
71364
71652
|
//API 返回数据 转化为array[]
|
|
@@ -83908,6 +84196,46 @@ function KLineRightMenu(divElement)
|
|
|
83908
84196
|
return data;
|
|
83909
84197
|
}
|
|
83910
84198
|
|
|
84199
|
+
//缺口提示
|
|
84200
|
+
this.GetPriceGap=function(chart)
|
|
84201
|
+
{
|
|
84202
|
+
var klineChart=chart.ChartPaint[0];
|
|
84203
|
+
var priceGap=klineChart.PriceGap;
|
|
84204
|
+
var data=
|
|
84205
|
+
[
|
|
84206
|
+
{
|
|
84207
|
+
text: "显示1个缺口",
|
|
84208
|
+
click: function () { chart.ChangePriceGap({ Enable:true, Count:1 }); }
|
|
84209
|
+
},
|
|
84210
|
+
{
|
|
84211
|
+
text: "显示2个缺口",
|
|
84212
|
+
click: function () { chart.ChangePriceGap({ Enable:true, Count:2 }); }
|
|
84213
|
+
},
|
|
84214
|
+
{
|
|
84215
|
+
text: "显示3个缺口",
|
|
84216
|
+
click: function () { chart.ChangePriceGap({ Enable:true, Count:3 }); }
|
|
84217
|
+
},
|
|
84218
|
+
{
|
|
84219
|
+
text: "隐藏缺口",
|
|
84220
|
+
click: function () { chart.ChangePriceGap({ Enable:false }); }
|
|
84221
|
+
}
|
|
84222
|
+
];
|
|
84223
|
+
|
|
84224
|
+
if (!priceGap.Enable || priceGap.Count<=0)
|
|
84225
|
+
{
|
|
84226
|
+
data[data.length-1].selected=true; //选中
|
|
84227
|
+
}
|
|
84228
|
+
else if (priceGap.Enable && priceGap.Count>0)
|
|
84229
|
+
{
|
|
84230
|
+
var index=priceGap.Count-1;
|
|
84231
|
+
if (index>data.length-2) index=data.length-2;
|
|
84232
|
+
data[index].selected=true; //选中
|
|
84233
|
+
}
|
|
84234
|
+
|
|
84235
|
+
return data;
|
|
84236
|
+
}
|
|
84237
|
+
|
|
84238
|
+
|
|
83911
84239
|
this.GetKLineInfo=function(chart)
|
|
83912
84240
|
{
|
|
83913
84241
|
var setInfo=new Set();
|
|
@@ -83986,6 +84314,10 @@ function KLineRightMenu(divElement)
|
|
|
83986
84314
|
text:'信息地雷',
|
|
83987
84315
|
children: this.GetKLineInfo(chart)
|
|
83988
84316
|
},
|
|
84317
|
+
{
|
|
84318
|
+
text:'缺口提示',
|
|
84319
|
+
children: this.GetPriceGap(chart)
|
|
84320
|
+
},
|
|
83989
84321
|
{
|
|
83990
84322
|
text: "叠加品种",
|
|
83991
84323
|
children: this.GetOverlay(chart)
|
|
@@ -235,6 +235,12 @@ function GetBlackStyle()
|
|
|
235
235
|
Color:'rgb(119,136,153)',
|
|
236
236
|
LineDash:[2,2]
|
|
237
237
|
},
|
|
238
|
+
|
|
239
|
+
PriceGapStyple:
|
|
240
|
+
{
|
|
241
|
+
Line:{ Color:"rgb(128,128,128)" },
|
|
242
|
+
Text:{ Color:"rgb(219,220,220)", Font:`${12*GetDevicePixelRatio()}px 微软雅黑` }
|
|
243
|
+
},
|
|
238
244
|
|
|
239
245
|
Index:
|
|
240
246
|
{
|