hqchart 1.1.12973 → 1.1.12986
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 +47 -26
- package/package.json +1 -1
- package/src/jscommon/umychart.complier.js +8 -1
- package/src/jscommon/umychart.index.data.js +2 -1
- package/src/jscommon/umychart.js +340 -5
- package/src/jscommon/umychart.style.js +6 -0
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +357 -8
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.vue.js +357 -8
|
@@ -18121,7 +18121,7 @@ function JSExplainer(ast,option)
|
|
|
18121
18121
|
['VOLR',"量比"], ['VOLINSTK',"持仓量"], ["OPI","持仓量"], ["ZSTJJ","均价"], ["QHJSJ","结算价"], ["SETTLE", "结算价"],
|
|
18122
18122
|
|
|
18123
18123
|
//日期类
|
|
18124
|
-
['DATE',"日期"],['YEAR',"年份"],['MONTH',"月份"],['PERIOD', "周期"],['WEEK',"星期"],["TIME","时间"],
|
|
18124
|
+
['DATE',"日期"],['YEAR',"年份"],['MONTH',"月份"],["DAY","日"],['PERIOD', "周期"],['WEEK',"星期"],["TIME","时间"],
|
|
18125
18125
|
|
|
18126
18126
|
//大盘数据
|
|
18127
18127
|
['INDEXA',"大盘成交额"],['INDEXC',"大盘收盘价"],['INDEXH',"大盘最高价"],['INDEXL',"大盘最低价"],['INDEXO',"大盘开盘价"],['INDEXV',"大盘成交量"],
|
|
@@ -19619,6 +19619,7 @@ function ScriptIndex(name,script,args,option)
|
|
|
19619
19619
|
if (IFrameSplitOperator.IsNumber(option.YAxis.FloatPrecision)) this.YAxis.FloatPrecision=option.YAxis.FloatPrecision;
|
|
19620
19620
|
if (IFrameSplitOperator.IsNumber(option.YAxis.StringFormat)) this.YAxis.StringFormat=option.YAxis.StringFormat;
|
|
19621
19621
|
if (IFrameSplitOperator.IsBool(option.YAxis.EnableRemoveZero)) this.YAxis.EnableRemoveZero=option.YAxis.EnableRemoveZero;
|
|
19622
|
+
if (IFrameSplitOperator.IsBool(option.YAxis.ExcludeValue)) this.YAxis.ExcludeValue=option.YAxis.ExcludeValue; //不参数Y轴的计算
|
|
19622
19623
|
|
|
19623
19624
|
}
|
|
19624
19625
|
|
|
@@ -19883,6 +19884,11 @@ function ScriptIndex(name,script,args,option)
|
|
|
19883
19884
|
|
|
19884
19885
|
if (this.ID) chart.IndexID=this.ID;
|
|
19885
19886
|
|
|
19887
|
+
if (this.YAxis)
|
|
19888
|
+
{
|
|
19889
|
+
if (IFrameSplitOperator.IsBool(this.YAxis.ExcludeValue)) chart.IsExcludeYValue=this.YAxis.ExcludeValue;
|
|
19890
|
+
}
|
|
19891
|
+
|
|
19886
19892
|
chart.Script=this; //指标内容绑定上去
|
|
19887
19893
|
}
|
|
19888
19894
|
|
|
@@ -20273,6 +20279,7 @@ function ScriptIndex(name,script,args,option)
|
|
|
20273
20279
|
pointDot.Data.Data=varItem.Data;
|
|
20274
20280
|
hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(pointDot.Data,varItem.Name,pointDot.Color);
|
|
20275
20281
|
|
|
20282
|
+
this.SetChartIndexName(pointDot);
|
|
20276
20283
|
hqChart.ChartPaint.push(pointDot);
|
|
20277
20284
|
}
|
|
20278
20285
|
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
Condition: 限制条件 { Symbol:'Index'/'Stock'(只支持指数/股票),Period:[](支持的周期), Include:[](指定支持的股票,代码全部大写包括后缀, Message:"提示信息")}
|
|
27
27
|
OutName:动态输出变量名字 [{Name:原始变量名, DynamicName:动态名字格式}] 如 {Name:"MA1", DynamicName:"MA{M1}"};
|
|
28
28
|
SplitType: Y轴分割类型,
|
|
29
|
-
YAxis:{ FloatPrecision:小数位数, StringFormat:, EnableRemoveZero } //Y轴刻度输出格式
|
|
29
|
+
YAxis:{ FloatPrecision:小数位数, StringFormat:, EnableRemoveZero, ExcludeValue:不参数Y轴的计算 } //Y轴刻度输出格式
|
|
30
30
|
*/
|
|
31
31
|
|
|
32
32
|
//周期条件枚举
|
|
@@ -189,6 +189,7 @@ JSIndexScript.ModifyAttribute=function(indexInfo, attribute)
|
|
|
189
189
|
if (IFrameSplitOperator.IsNumber(item.FloatPrecision)) indexInfo.YAxis.FloatPrecision=item.FloatPrecision;
|
|
190
190
|
if (IFrameSplitOperator.IsNumber(item.StringFormat)) indexInfo.YAxis.StringFormat=item.StringFormat;
|
|
191
191
|
if (IFrameSplitOperator.IsBool(item.EnableRemoveZero)) indexInfo.YAxis.EnableRemoveZero=item.EnableRemoveZero;
|
|
192
|
+
if (IFrameSplitOperator.IsBool(item.ExcludeValue)) indexInfo.YAxis.ExcludeValue=attribute.ExcludeValue; //不参数Y轴的计算
|
|
192
193
|
}
|
|
193
194
|
}
|
|
194
195
|
|
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; //最新的版本号
|
|
@@ -6861,6 +6877,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
6861
6877
|
if (chart.IsShow==false) continue; //隐藏的图形不计算
|
|
6862
6878
|
if (chart.NotSupportMessage) continue;
|
|
6863
6879
|
if (!chart.ChartFrame) continue;
|
|
6880
|
+
if (chart.IsExcludeYValue===true) continue;
|
|
6864
6881
|
|
|
6865
6882
|
var range=chart.GetMaxMin();
|
|
6866
6883
|
if (range==null || range.Max==null || range.Min==null) continue;
|
|
@@ -21635,6 +21652,7 @@ function IChartPainting()
|
|
|
21635
21652
|
this.PtInChart; //function(x,y) { }
|
|
21636
21653
|
|
|
21637
21654
|
this.IsFullRangeMaxMin=false; //this.GetMaxMin() true=计算全部的最大最小值 false=计算可视范围的最大最小值
|
|
21655
|
+
this.IsExcludeYValue=false; //不参与Y轴计算
|
|
21638
21656
|
|
|
21639
21657
|
this.Draw=function()
|
|
21640
21658
|
{
|
|
@@ -22531,6 +22549,15 @@ function ChartKLine()
|
|
|
22531
22549
|
this.AryOrderFlowBorder=[]; //订单流边框 临时变量
|
|
22532
22550
|
|
|
22533
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=[]; //缺口数据 { }
|
|
22534
22561
|
|
|
22535
22562
|
this.ReloadResource=function(resource)
|
|
22536
22563
|
{
|
|
@@ -22631,6 +22658,7 @@ function ChartKLine()
|
|
|
22631
22658
|
eventUnchangeKLine=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_UNCHANGE_KLINE_COLOR);
|
|
22632
22659
|
}
|
|
22633
22660
|
|
|
22661
|
+
var preKItemInfo=null;
|
|
22634
22662
|
for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length && j<xPointCount;++i,++j,xOffset+=(dataWidth+distanceWidth),++this.ShowRange.DataCount)
|
|
22635
22663
|
{
|
|
22636
22664
|
var data=this.Data.Data[i];
|
|
@@ -22647,6 +22675,8 @@ function ChartKLine()
|
|
|
22647
22675
|
var yClose=this.GetYFromData(data.Close,false);
|
|
22648
22676
|
this.DrawKRange.End=i;
|
|
22649
22677
|
|
|
22678
|
+
var kItemInfo={ Data:data, Coordinate:{ X:x, Low:yLow, High:yHigh, Close:yClose, Open:yClose, Left:left, Right:right }};
|
|
22679
|
+
|
|
22650
22680
|
if (ptMax.Value==null || ptMax.Value<data.High) //求最大值
|
|
22651
22681
|
{
|
|
22652
22682
|
ptMax.X=x;
|
|
@@ -22765,6 +22795,17 @@ function ChartKLine()
|
|
|
22765
22795
|
var infoItem={Xleft:left,XRight:right, YMax:yHigh, XCenter:x, YMin:yLow, DayData:data, Index:j};
|
|
22766
22796
|
this.DrawInfo(infoItem);
|
|
22767
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;
|
|
22768
22809
|
}
|
|
22769
22810
|
|
|
22770
22811
|
this.PtMax=ptMax;
|
|
@@ -22901,6 +22942,7 @@ function ChartKLine()
|
|
|
22901
22942
|
this.ShowRange.ShowCount=xPointCount;
|
|
22902
22943
|
this.DrawKRange.Start=this.Data.DataOffset;
|
|
22903
22944
|
|
|
22945
|
+
var preKItemInfo=null;
|
|
22904
22946
|
for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length && j<xPointCount;++i,++j,xOffset+=(dataWidth+distanceWidth),++this.ShowRange.DataCount)
|
|
22905
22947
|
{
|
|
22906
22948
|
var data=this.Data.Data[i];
|
|
@@ -22938,6 +22980,24 @@ function ChartKLine()
|
|
|
22938
22980
|
{
|
|
22939
22981
|
ptLast={ X:x, Y:yClose, XLeft:left, XRight:right, KItem:data, ChartRight:chartright };
|
|
22940
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
|
+
}
|
|
22941
23001
|
}
|
|
22942
23002
|
|
|
22943
23003
|
this.DrawLastPointEvent(ptLast); //通知外部绘制最后一个点
|
|
@@ -23011,6 +23071,7 @@ function ChartKLine()
|
|
|
23011
23071
|
this.ShowRange.ShowCount=xPointCount;
|
|
23012
23072
|
this.DrawKRange.Start=this.Data.DataOffset;
|
|
23013
23073
|
|
|
23074
|
+
var preKItemInfo=null;
|
|
23014
23075
|
for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length && j<xPointCount;++i,++j,xOffset+=(dataWidth+distanceWidth),++this.ShowRange.DataCount)
|
|
23015
23076
|
{
|
|
23016
23077
|
var data=this.Data.Data[i];
|
|
@@ -23035,6 +23096,24 @@ function ChartKLine()
|
|
|
23035
23096
|
if (isHScreen) this.Canvas.lineTo(yClose,x);
|
|
23036
23097
|
else this.Canvas.lineTo(x,yClose);
|
|
23037
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
|
+
}
|
|
23038
23117
|
}
|
|
23039
23118
|
|
|
23040
23119
|
if (bFirstPoint==false) this.Canvas.stroke();
|
|
@@ -23077,6 +23156,7 @@ function ChartKLine()
|
|
|
23077
23156
|
eventUnchangeKLine=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_UNCHANGE_KLINE_COLOR);
|
|
23078
23157
|
}
|
|
23079
23158
|
|
|
23159
|
+
var preKItemInfo=null;
|
|
23080
23160
|
for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length && j<xPointCount;++i,++j,xOffset+=(dataWidth+distanceWidth),++this.ShowRange.DataCount)
|
|
23081
23161
|
{
|
|
23082
23162
|
var data=this.Data.Data[i];
|
|
@@ -23093,6 +23173,8 @@ function ChartKLine()
|
|
|
23093
23173
|
var yClose=this.GetYFromData(data.Close, false);
|
|
23094
23174
|
var y=yHigh;
|
|
23095
23175
|
|
|
23176
|
+
var kItemInfo={ Data:data, Coordinate:{ X:x, Low:yLow, High:yHigh, Close:yClose, Open:yClose, Left:left, Right:right }};
|
|
23177
|
+
|
|
23096
23178
|
this.DrawKRange.End=i;
|
|
23097
23179
|
if (ptMax.Value==null || ptMax.Value<data.High) //求最大值
|
|
23098
23180
|
{
|
|
@@ -23196,6 +23278,17 @@ function ChartKLine()
|
|
|
23196
23278
|
{
|
|
23197
23279
|
ptLast={ X:x, Y:yClose, XLeft:left, XRight:right, KItem:data, ChartRight:chartright };
|
|
23198
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;
|
|
23199
23292
|
}
|
|
23200
23293
|
|
|
23201
23294
|
this.DrawLastPointEvent(ptLast); //通知外部绘制最后一个点
|
|
@@ -24834,6 +24927,7 @@ function ChartKLine()
|
|
|
24834
24927
|
this.PtMax={X:null,Y:null,Value:null,Align:'left'}; //清空最大
|
|
24835
24928
|
this.PtMin={X:null,Y:null,Value:null,Align:'left'}; //清空最小
|
|
24836
24929
|
this.DrawKRange={ Start:null, End:null };
|
|
24930
|
+
this.AryPriceGapCache=[];
|
|
24837
24931
|
|
|
24838
24932
|
this.ChartFrame.ChartKLine={Max:null, Min:null }; //保存K线上 显示最大最小值坐标
|
|
24839
24933
|
|
|
@@ -24874,6 +24968,7 @@ function ChartKLine()
|
|
|
24874
24968
|
{
|
|
24875
24969
|
this.DrawCloseLine();
|
|
24876
24970
|
this.Canvas.restore();
|
|
24971
|
+
if (this.PriceGap.Enable) this.DrawPriceGap();
|
|
24877
24972
|
return;
|
|
24878
24973
|
}
|
|
24879
24974
|
else if (this.DrawType==2)
|
|
@@ -24934,8 +25029,11 @@ function ChartKLine()
|
|
|
24934
25029
|
|
|
24935
25030
|
if (this.TradeIcon) this.DrawTradeIcon()
|
|
24936
25031
|
else this.DrawTrade();
|
|
25032
|
+
|
|
24937
25033
|
this.Canvas.restore();
|
|
24938
25034
|
|
|
25035
|
+
if (this.PriceGap.Enable) this.DrawPriceGap();
|
|
25036
|
+
|
|
24939
25037
|
if (this.IsShowMaxMinPrice) //标注最大值最小值
|
|
24940
25038
|
{
|
|
24941
25039
|
if (this.ChartFrame.IsHScreen===true) this.HScreenDrawMaxMinPrice(this.PtMax,this.PtMin);
|
|
@@ -26691,6 +26789,169 @@ function ChartKLine()
|
|
|
26691
26789
|
|
|
26692
26790
|
}
|
|
26693
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
|
+
}
|
|
26694
26955
|
|
|
26695
26956
|
}
|
|
26696
26957
|
|
|
@@ -30000,6 +30261,7 @@ function ChartPointDot()
|
|
|
30000
30261
|
var xPointCount=this.ChartFrame.XPointCount;
|
|
30001
30262
|
|
|
30002
30263
|
this.Canvas.save();
|
|
30264
|
+
this.ClipClient(bHScreen);
|
|
30003
30265
|
this.Canvas.fillStyle=this.Color;
|
|
30004
30266
|
var colorDot;
|
|
30005
30267
|
for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length && j<xPointCount;++i,++j)
|
|
@@ -30008,7 +30270,7 @@ function ChartPointDot()
|
|
|
30008
30270
|
if (value==null) continue;
|
|
30009
30271
|
|
|
30010
30272
|
var x=this.ChartFrame.GetXFromIndex(j);
|
|
30011
|
-
var y=this.ChartFrame.GetYFromData(value);
|
|
30273
|
+
var y=this.ChartFrame.GetYFromData(value, false);
|
|
30012
30274
|
|
|
30013
30275
|
if (x>chartright) break;
|
|
30014
30276
|
|
|
@@ -36154,7 +36416,7 @@ function ChartMultiText()
|
|
|
36154
36416
|
for(var k=0;k<textItem.Data.length;++k)
|
|
36155
36417
|
{
|
|
36156
36418
|
var item=textItem.Data[k];
|
|
36157
|
-
|
|
36419
|
+
var y=top;
|
|
36158
36420
|
if (item.Value=="TOP") y=top;
|
|
36159
36421
|
else if (item.Value=="BOTTOM") y=bottom;
|
|
36160
36422
|
else y=this.ChartFrame.GetYFromData(item.Value);
|
|
@@ -62154,6 +62416,12 @@ function JSChartResource()
|
|
|
62154
62416
|
LineDash:[2,2]
|
|
62155
62417
|
};
|
|
62156
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
|
+
|
|
62157
62425
|
//订单流配置
|
|
62158
62426
|
this.OrderFlow=
|
|
62159
62427
|
{
|
|
@@ -63112,6 +63380,17 @@ function JSChartResource()
|
|
|
63112
63380
|
if (item.LineDash) this.VirtualKLine.LineDash=item.LineDash;
|
|
63113
63381
|
}
|
|
63114
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
|
+
|
|
63115
63394
|
if (style.Index)
|
|
63116
63395
|
{
|
|
63117
63396
|
if (style.Index.LineColor) this.Index.LineColor = style.Index.LineColor;
|
|
@@ -71356,6 +71635,18 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
71356
71635
|
|
|
71357
71636
|
this.ScrollBar.Reset({Draw:true});
|
|
71358
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
|
+
}
|
|
71359
71650
|
}
|
|
71360
71651
|
|
|
71361
71652
|
//API 返回数据 转化为array[]
|
|
@@ -83905,6 +84196,46 @@ function KLineRightMenu(divElement)
|
|
|
83905
84196
|
return data;
|
|
83906
84197
|
}
|
|
83907
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;
|
|
84231
|
+
if (index>data.length-2) index=data.length-2;
|
|
84232
|
+
data[index].selected=true; //选中
|
|
84233
|
+
}
|
|
84234
|
+
|
|
84235
|
+
return data;
|
|
84236
|
+
}
|
|
84237
|
+
|
|
84238
|
+
|
|
83908
84239
|
this.GetKLineInfo=function(chart)
|
|
83909
84240
|
{
|
|
83910
84241
|
var setInfo=new Set();
|
|
@@ -83983,6 +84314,10 @@ function KLineRightMenu(divElement)
|
|
|
83983
84314
|
text:'信息地雷',
|
|
83984
84315
|
children: this.GetKLineInfo(chart)
|
|
83985
84316
|
},
|
|
84317
|
+
{
|
|
84318
|
+
text:'缺口提示',
|
|
84319
|
+
children: this.GetPriceGap(chart)
|
|
84320
|
+
},
|
|
83986
84321
|
{
|
|
83987
84322
|
text: "叠加品种",
|
|
83988
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
|
{
|