hqchart 1.1.14538 → 1.1.14542
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 +62 -29
- package/package.json +1 -1
- package/src/jscommon/umychart.DialogDrawTool.js +4 -0
- package/src/jscommon/umychart.js +372 -16
- package/src/jscommon/umychart.style.js +17 -0
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +390 -17
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.vue.js +394 -17
|
@@ -4501,6 +4501,8 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
4501
4501
|
if (IFrameSplitOperator.IsBool(item.PriceGap.Enable)) klineChart.PriceGap.Enable=item.PriceGap.Enable;
|
|
4502
4502
|
if (IFrameSplitOperator.IsNumber(item.PriceGap.Count)) klineChart.PriceGap.Count=item.PriceGap.Count;
|
|
4503
4503
|
}
|
|
4504
|
+
|
|
4505
|
+
if (IFrameSplitOperator.IsBool(item.EnablePrediction)) klineChart.PredictionConfig.Enable=item.EnablePrediction;
|
|
4504
4506
|
}
|
|
4505
4507
|
|
|
4506
4508
|
if(option.KLineTitle)
|
|
@@ -27785,7 +27787,7 @@ function ChartData()
|
|
|
27785
27787
|
return result;
|
|
27786
27788
|
}
|
|
27787
27789
|
|
|
27788
|
-
this.MergeMinuteData=function(data) //合并数据
|
|
27790
|
+
this.MergeMinuteData=function(data, period) //合并数据
|
|
27789
27791
|
{
|
|
27790
27792
|
if (!this.Data || this.Data.length<=0)
|
|
27791
27793
|
{
|
|
@@ -27793,6 +27795,7 @@ function ChartData()
|
|
|
27793
27795
|
return true;
|
|
27794
27796
|
}
|
|
27795
27797
|
|
|
27798
|
+
var bDayPeriod=ChartData.IsDayPeriod(period, true);
|
|
27796
27799
|
var sourceFirstItem=this.Data[0];
|
|
27797
27800
|
var firstItemID=0;
|
|
27798
27801
|
var firstItem=null;
|
|
@@ -27806,11 +27809,23 @@ function ChartData()
|
|
|
27806
27809
|
break;
|
|
27807
27810
|
}
|
|
27808
27811
|
|
|
27809
|
-
if (
|
|
27812
|
+
if (bDayPeriod)
|
|
27810
27813
|
{
|
|
27811
|
-
|
|
27812
|
-
|
|
27813
|
-
|
|
27814
|
+
if (item.Date==sourceFirstItem.Date)
|
|
27815
|
+
{
|
|
27816
|
+
firstItemID=i;
|
|
27817
|
+
firstItem=item;
|
|
27818
|
+
break;
|
|
27819
|
+
}
|
|
27820
|
+
}
|
|
27821
|
+
else
|
|
27822
|
+
{
|
|
27823
|
+
if (item.Date==sourceFirstItem.Date && item.Time>=sourceFirstItem.Time)
|
|
27824
|
+
{
|
|
27825
|
+
firstItemID=i;
|
|
27826
|
+
firstItem=item;
|
|
27827
|
+
break;
|
|
27828
|
+
}
|
|
27814
27829
|
}
|
|
27815
27830
|
}
|
|
27816
27831
|
|
|
@@ -27823,11 +27838,23 @@ function ChartData()
|
|
|
27823
27838
|
var date=this.Data[i].Date;
|
|
27824
27839
|
var time=this.Data[i].Time;
|
|
27825
27840
|
|
|
27826
|
-
if (
|
|
27841
|
+
if (bDayPeriod)
|
|
27827
27842
|
{
|
|
27828
|
-
|
|
27829
|
-
|
|
27830
|
-
|
|
27843
|
+
if (firstItem.Date>date || firstItem.Date==date)
|
|
27844
|
+
{
|
|
27845
|
+
index=i;
|
|
27846
|
+
if (firstItem.Date==date) bFind=true;
|
|
27847
|
+
break;
|
|
27848
|
+
}
|
|
27849
|
+
}
|
|
27850
|
+
else
|
|
27851
|
+
{
|
|
27852
|
+
if (firstItem.Date>date || (firstItem.Date==date && firstItem.Time>=time) )
|
|
27853
|
+
{
|
|
27854
|
+
index=i;
|
|
27855
|
+
if (firstItem.Date==date && firstItem.Time==time) bFind=true;
|
|
27856
|
+
break;
|
|
27857
|
+
}
|
|
27831
27858
|
}
|
|
27832
27859
|
}
|
|
27833
27860
|
|
|
@@ -29741,9 +29768,30 @@ function ChartKLine()
|
|
|
29741
29768
|
DownAreaColor:g_JSChartResource.HLCArea.DownAreaColor,
|
|
29742
29769
|
}
|
|
29743
29770
|
|
|
29744
|
-
//虚线柱子
|
|
29771
|
+
//虚线柱子 (非交易日)
|
|
29745
29772
|
this.VirtualBarConfig={ Color:g_JSChartResource.VirtualKLine.Color, LineDash:g_JSChartResource.VirtualKLine.LineDash };
|
|
29746
29773
|
|
|
29774
|
+
//预测线配置
|
|
29775
|
+
this.PredictionConfig=
|
|
29776
|
+
{
|
|
29777
|
+
Line:
|
|
29778
|
+
{
|
|
29779
|
+
Color:g_JSChartResource.PredictionKLine.Line.Color,
|
|
29780
|
+
LineDash:g_JSChartResource.PredictionKLine.Line.LineDash,
|
|
29781
|
+
LineWidth:g_JSChartResource.PredictionKLine.Line.LineWidth
|
|
29782
|
+
},
|
|
29783
|
+
|
|
29784
|
+
Bar:
|
|
29785
|
+
{
|
|
29786
|
+
UpColor:g_JSChartResource.PredictionKLine.Bar.UpColor,
|
|
29787
|
+
DownColor:g_JSChartResource.PredictionKLine.Bar.DownColor,
|
|
29788
|
+
UnchangeColor:g_JSChartResource.PredictionKLine.Bar.UnchangeColor ,
|
|
29789
|
+
DrawType:g_JSChartResource.PredictionKLine.Bar.DrawType
|
|
29790
|
+
},
|
|
29791
|
+
Enable:false, //是否启动
|
|
29792
|
+
};
|
|
29793
|
+
this.AryPredictionCache=[]; //预测数据
|
|
29794
|
+
|
|
29747
29795
|
//DrawType==14 自定义图形
|
|
29748
29796
|
this.FFKChart;
|
|
29749
29797
|
|
|
@@ -29881,6 +29929,22 @@ function ChartKLine()
|
|
|
29881
29929
|
this.OrderFlow.UnchagneColor= { BG:g_JSChartResource.OrderFlow.UnchagneColor.BG, Border:g_JSChartResource.OrderFlow.UnchagneColor.Border };
|
|
29882
29930
|
this.OrderFlow.Text={ Color: g_JSChartResource.OrderFlow.Text.Color , Family:g_JSChartResource.OrderFlow.Text.Family, FontMaxSize:g_JSChartResource.OrderFlow.Text.FontMaxSize, MaxValue:g_JSChartResource.OrderFlow.Text.MaxValue };
|
|
29883
29931
|
this.OrderFlow.Line={ UpDownColor: g_JSChartResource.OrderFlow.Line.UpDownColor, MiddleColor:g_JSChartResource.OrderFlow.Line.MiddleColor };
|
|
29932
|
+
|
|
29933
|
+
this.PredictionConfig.Line=
|
|
29934
|
+
{
|
|
29935
|
+
Color:g_JSChartResource.PredictionKLine.Line.Color,
|
|
29936
|
+
LineDash:g_JSChartResource.PredictionKLine.Line.LineDash,
|
|
29937
|
+
LineWidth:g_JSChartResource.PredictionKLine.Line.LineWidth
|
|
29938
|
+
};
|
|
29939
|
+
|
|
29940
|
+
this.PredictionConfig.Bar=
|
|
29941
|
+
{
|
|
29942
|
+
UpColor:g_JSChartResource.PredictionKLine.Bar.UpColor,
|
|
29943
|
+
DownColor:g_JSChartResource.PredictionKLine.Bar.DownColor,
|
|
29944
|
+
UnchangeColor:g_JSChartResource.PredictionKLine.Bar.UnchangeColor,
|
|
29945
|
+
DrawType:g_JSChartResource.PredictionKLine.Bar.DrawType
|
|
29946
|
+
};
|
|
29947
|
+
|
|
29884
29948
|
}
|
|
29885
29949
|
|
|
29886
29950
|
this.ClearCustomKLine=function()
|
|
@@ -30251,6 +30315,8 @@ function ChartKLine()
|
|
|
30251
30315
|
this.DrawKRange.Start=this.Data.DataOffset;
|
|
30252
30316
|
|
|
30253
30317
|
var preKItemInfo=null;
|
|
30318
|
+
var prePoint=null;
|
|
30319
|
+
var xEnd=null; //最后一个点
|
|
30254
30320
|
for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length && j<xPointCount;++i,++j,xOffset+=(dataWidth+distanceWidth),++this.ShowRange.DataCount)
|
|
30255
30321
|
{
|
|
30256
30322
|
var data=this.Data.Data[i];
|
|
@@ -30264,6 +30330,13 @@ function ChartKLine()
|
|
|
30264
30330
|
var yClose=this.GetYFromData(data.Close,false);
|
|
30265
30331
|
this.DrawKRange.End=i;
|
|
30266
30332
|
|
|
30333
|
+
if (data.IsVirtual && this.PredictionConfig.Enable) //预测数据|虚拟数据
|
|
30334
|
+
{
|
|
30335
|
+
this.AryPredictionCache.push({ PrePoint:prePoint, Point:{ X:x, Y:yClose }});
|
|
30336
|
+
prePoint={ X:x, Y:yClose};
|
|
30337
|
+
continue;
|
|
30338
|
+
}
|
|
30339
|
+
|
|
30267
30340
|
if (bFirstPoint)
|
|
30268
30341
|
{
|
|
30269
30342
|
if (isHScreen)
|
|
@@ -30284,6 +30357,9 @@ function ChartKLine()
|
|
|
30284
30357
|
else this.Canvas.lineTo(x,yClose);
|
|
30285
30358
|
}
|
|
30286
30359
|
|
|
30360
|
+
xEnd=x;
|
|
30361
|
+
prePoint={ X:x, Y:yClose};
|
|
30362
|
+
|
|
30287
30363
|
if (i==this.Data.Data.length-1)
|
|
30288
30364
|
{
|
|
30289
30365
|
ptLast={ X:x, Y:yClose, XLeft:left, XRight:right, KItem:data, ChartRight:chartright };
|
|
@@ -30315,12 +30391,12 @@ function ChartKLine()
|
|
|
30315
30391
|
this.Canvas.stroke();
|
|
30316
30392
|
if (isHScreen)
|
|
30317
30393
|
{
|
|
30318
|
-
this.Canvas.lineTo(border.Left,
|
|
30394
|
+
this.Canvas.lineTo(border.Left,xEnd);
|
|
30319
30395
|
this.Canvas.lineTo(border.Left,firstPoint.Y);
|
|
30320
30396
|
}
|
|
30321
30397
|
else
|
|
30322
30398
|
{
|
|
30323
|
-
this.Canvas.lineTo(
|
|
30399
|
+
this.Canvas.lineTo(xEnd,border.Bottom);
|
|
30324
30400
|
this.Canvas.lineTo(firstPoint.X,border.Bottom);
|
|
30325
30401
|
}
|
|
30326
30402
|
this.Canvas.closePath();
|
|
@@ -30383,11 +30459,12 @@ function ChartKLine()
|
|
|
30383
30459
|
var mapBreakPoint=this.BuildBreakPoint(); //断点
|
|
30384
30460
|
|
|
30385
30461
|
var preKItemInfo=null;
|
|
30462
|
+
var prePoint=null;
|
|
30386
30463
|
for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length && j<xPointCount;++i,++j,xOffset+=(dataWidth+distanceWidth),++this.ShowRange.DataCount)
|
|
30387
30464
|
{
|
|
30388
30465
|
var data=this.Data.Data[i];
|
|
30389
30466
|
this.ShowRange.End=i;
|
|
30390
|
-
if (data.Open==null || data.High==null || data.Low==null || data.Close==null) continue;
|
|
30467
|
+
if (!data || data.Open==null || data.High==null || data.Low==null || data.Close==null) continue;
|
|
30391
30468
|
|
|
30392
30469
|
var left=xOffset;
|
|
30393
30470
|
var right=xOffset+dataWidth;
|
|
@@ -30396,6 +30473,13 @@ function ChartKLine()
|
|
|
30396
30473
|
var yClose=this.GetYFromData(data.Close,false);
|
|
30397
30474
|
this.DrawKRange.End=i;
|
|
30398
30475
|
|
|
30476
|
+
if (data.IsVirtual && this.PredictionConfig.Enable) //预测数据|虚拟数据
|
|
30477
|
+
{
|
|
30478
|
+
this.AryPredictionCache.push({ PrePoint:prePoint, Point:{ X:x, Y:yClose }});
|
|
30479
|
+
prePoint={ X:x, Y:yClose};
|
|
30480
|
+
continue;
|
|
30481
|
+
}
|
|
30482
|
+
|
|
30399
30483
|
if (bFirstPoint)
|
|
30400
30484
|
{
|
|
30401
30485
|
if (isHScreen) this.Canvas.moveTo(yClose,x);
|
|
@@ -30409,6 +30493,8 @@ function ChartKLine()
|
|
|
30409
30493
|
}
|
|
30410
30494
|
++drawCount;
|
|
30411
30495
|
|
|
30496
|
+
prePoint={ X:x, Y:yClose};
|
|
30497
|
+
|
|
30412
30498
|
if (this.PriceGap.Enable)
|
|
30413
30499
|
{
|
|
30414
30500
|
var yLow=this.GetYFromData(data.Low, false);
|
|
@@ -30483,6 +30569,7 @@ function ChartKLine()
|
|
|
30483
30569
|
}
|
|
30484
30570
|
|
|
30485
30571
|
var preKItemInfo=null;
|
|
30572
|
+
var prePoint=null; //上一个点的位置
|
|
30486
30573
|
for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length && j<xPointCount;++i,++j,xOffset+=(dataWidth+distanceWidth),++this.ShowRange.DataCount)
|
|
30487
30574
|
{
|
|
30488
30575
|
var data=this.Data.Data[i];
|
|
@@ -30532,6 +30619,10 @@ function ChartKLine()
|
|
|
30532
30619
|
{
|
|
30533
30620
|
this.DrawVirtualBar(data, dataWidth, x, y, left, right, yLow, yHigh, yOpen, yClose, isHScreen);
|
|
30534
30621
|
}
|
|
30622
|
+
else if (data.IsVirtual && this.PredictionConfig.Enable)
|
|
30623
|
+
{
|
|
30624
|
+
this.DrawPredictionBar(data, dataWidth, x, y, left, right, yLow, yHigh, yOpen, yClose, isHScreen);
|
|
30625
|
+
}
|
|
30535
30626
|
else if (kLineOption)
|
|
30536
30627
|
{
|
|
30537
30628
|
var barColor=kLineOption.Color;
|
|
@@ -30613,6 +30704,8 @@ function ChartKLine()
|
|
|
30613
30704
|
if (value>0)
|
|
30614
30705
|
this.AryPriceGapCache.push({ Data:[preKItemInfo, kItemInfo], Type:value });
|
|
30615
30706
|
}
|
|
30707
|
+
|
|
30708
|
+
prePoint={ X:x, Y:yClose }; //上一个点
|
|
30616
30709
|
|
|
30617
30710
|
preKItemInfo=kItemInfo;
|
|
30618
30711
|
}
|
|
@@ -31484,6 +31577,82 @@ function ChartKLine()
|
|
|
31484
31577
|
this.Canvas.setLineDash([]);
|
|
31485
31578
|
}
|
|
31486
31579
|
|
|
31580
|
+
this.DrawPredictionBar=function(data, dataWidth, x, y, left, right, yLow, yHigh, yOpen, yClose, isHScreen)
|
|
31581
|
+
{
|
|
31582
|
+
var config=this.PredictionConfig.Bar;
|
|
31583
|
+
var drawType=this.DrawType;
|
|
31584
|
+
if (IFrameSplitOperator.IsNumber(config.DrawType)) drawType=config.DrawType;
|
|
31585
|
+
|
|
31586
|
+
if (data.Open<data.Close) //阳线
|
|
31587
|
+
{
|
|
31588
|
+
this.DrawKBar_Up(data, dataWidth, config.UpColor, drawType, x, y, left, right, yLow, yHigh, yOpen, yClose, isHScreen);
|
|
31589
|
+
}
|
|
31590
|
+
else if (data.Open>data.Close) //阴线
|
|
31591
|
+
{
|
|
31592
|
+
this.DrawKBar_Down(data, dataWidth, config.DownColor, drawType, x, y, left, right, yLow, yHigh, yOpen, yClose, isHScreen);
|
|
31593
|
+
}
|
|
31594
|
+
else
|
|
31595
|
+
{
|
|
31596
|
+
this.DrawKBar_Unchagne(data, dataWidth, config.UnchangeColor, drawType, x, y, left, right, yLow, yHigh, yOpen, yClose, isHScreen);
|
|
31597
|
+
}
|
|
31598
|
+
}
|
|
31599
|
+
|
|
31600
|
+
this.DrawPredictionLine=function()
|
|
31601
|
+
{
|
|
31602
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(this.AryPredictionCache)) return;
|
|
31603
|
+
|
|
31604
|
+
this.Canvas.save();
|
|
31605
|
+
|
|
31606
|
+
var bHScreen=(this.ChartFrame.IsHScreen===true);
|
|
31607
|
+
var bFirstPoint=true;
|
|
31608
|
+
var drawCount=0;
|
|
31609
|
+
for(var i=0;i<this.AryPredictionCache.length;++i)
|
|
31610
|
+
{
|
|
31611
|
+
var item=this.AryPredictionCache[i];
|
|
31612
|
+
if (bFirstPoint)
|
|
31613
|
+
{
|
|
31614
|
+
bFirstPoint=false;
|
|
31615
|
+
this.Canvas.beginPath();
|
|
31616
|
+
if (item.PrePoint)
|
|
31617
|
+
{
|
|
31618
|
+
var pt=item.PrePoint;
|
|
31619
|
+
if (bHScreen) this.Canvas.moveTo(pt.Y,pt.X); //横屏坐标轴对调
|
|
31620
|
+
else this.Canvas.moveTo(pt.X,pt.Y);
|
|
31621
|
+
|
|
31622
|
+
var pt=item.Point;
|
|
31623
|
+
if (bHScreen) this.Canvas.lineTo(pt.Y,pt.X);
|
|
31624
|
+
else this.Canvas.lineTo(pt.X,pt.Y);
|
|
31625
|
+
}
|
|
31626
|
+
else if (item.Point)
|
|
31627
|
+
{
|
|
31628
|
+
var pt=item.Point;
|
|
31629
|
+
if (bHScreen) this.Canvas.moveTo(pt.Y,pt.X); //横屏坐标轴对调
|
|
31630
|
+
else this.Canvas.moveTo(pt.X,pt.Y);
|
|
31631
|
+
}
|
|
31632
|
+
}
|
|
31633
|
+
else
|
|
31634
|
+
{
|
|
31635
|
+
var pt=item.Point;
|
|
31636
|
+
if (bHScreen) this.Canvas.lineTo(pt.Y,pt.X);
|
|
31637
|
+
else this.Canvas.lineTo(pt.X,pt.Y);
|
|
31638
|
+
}
|
|
31639
|
+
|
|
31640
|
+
++drawCount;
|
|
31641
|
+
}
|
|
31642
|
+
|
|
31643
|
+
if (drawCount>0)
|
|
31644
|
+
{
|
|
31645
|
+
var pixelRatio=GetDevicePixelRatio();
|
|
31646
|
+
var config=this.PredictionConfig.Line;
|
|
31647
|
+
this.Canvas.strokeStyle=config.Color;
|
|
31648
|
+
if (IFrameSplitOperator.IsNumber(config.LineWidth)) this.Canvas.lineWidth=config.LineWidth*pixelRatio;
|
|
31649
|
+
if (IFrameSplitOperator.IsNonEmptyArray(config.LineDash)) this.Canvas.setLineDash(config.LineDash)
|
|
31650
|
+
this.Canvas.stroke();
|
|
31651
|
+
}
|
|
31652
|
+
|
|
31653
|
+
this.Canvas.restore();
|
|
31654
|
+
}
|
|
31655
|
+
|
|
31487
31656
|
this.DrawRenkoCandle=function() //砖型K线
|
|
31488
31657
|
{
|
|
31489
31658
|
var isHScreen=(this.ChartFrame.IsHScreen===true);
|
|
@@ -32300,6 +32469,7 @@ function ChartKLine()
|
|
|
32300
32469
|
this.PtMin={X:null,Y:null,Value:null,Align:'left'}; //清空最小
|
|
32301
32470
|
this.DrawKRange={ Start:null, End:null };
|
|
32302
32471
|
this.AryPriceGapCache=[];
|
|
32472
|
+
this.AryPredictionCache=[];
|
|
32303
32473
|
|
|
32304
32474
|
this.ChartFrame.ChartKLine={Max:null, Min:null }; //保存K线上 显示最大最小值坐标
|
|
32305
32475
|
|
|
@@ -32340,6 +32510,7 @@ function ChartKLine()
|
|
|
32340
32510
|
{
|
|
32341
32511
|
this.DrawCloseLine();
|
|
32342
32512
|
this.Canvas.restore();
|
|
32513
|
+
this.DrawPredictionLine();
|
|
32343
32514
|
if (this.PriceGap.Enable) this.DrawPriceGap();
|
|
32344
32515
|
return;
|
|
32345
32516
|
}
|
|
@@ -32412,6 +32583,7 @@ function ChartKLine()
|
|
|
32412
32583
|
|
|
32413
32584
|
this.Canvas.restore();
|
|
32414
32585
|
|
|
32586
|
+
this.DrawPredictionLine();
|
|
32415
32587
|
if (this.PriceGap.Enable) this.DrawPriceGap();
|
|
32416
32588
|
|
|
32417
32589
|
if (this.IsShowMaxMinPrice) //标注最大值最小值
|
|
@@ -39191,6 +39363,7 @@ function ChartVolStick()
|
|
|
39191
39363
|
var value=this.Data.Data[i];
|
|
39192
39364
|
var kItem=this.HistoryData.Data[i];
|
|
39193
39365
|
if (value==null || kItem==null) continue;
|
|
39366
|
+
if (!IFrameSplitOperator.IsNumber(value)) continue;
|
|
39194
39367
|
if (value==0) continue;
|
|
39195
39368
|
|
|
39196
39369
|
var left=xOffset;
|
|
@@ -76128,6 +76301,24 @@ function JSChartResource()
|
|
|
76128
76301
|
LineDash:[2,2]
|
|
76129
76302
|
};
|
|
76130
76303
|
|
|
76304
|
+
this.PredictionKLine=
|
|
76305
|
+
{
|
|
76306
|
+
Line:
|
|
76307
|
+
{
|
|
76308
|
+
Color:"rgb(100,100,100)",
|
|
76309
|
+
LineDash:[3,5],
|
|
76310
|
+
LineWidth:2,
|
|
76311
|
+
},
|
|
76312
|
+
|
|
76313
|
+
Bar:
|
|
76314
|
+
{
|
|
76315
|
+
UpColor:"rgb(65,105,225)",
|
|
76316
|
+
DownColor:"rgb(65,105,225)",
|
|
76317
|
+
UnchangeColor:"rgb(65,105,225s)" ,
|
|
76318
|
+
DrawType:3
|
|
76319
|
+
}
|
|
76320
|
+
};
|
|
76321
|
+
|
|
76131
76322
|
this.PriceGapStyple=
|
|
76132
76323
|
{
|
|
76133
76324
|
Line:{ Color:"rgb(186,186,186)" },
|
|
@@ -77528,6 +77719,28 @@ function JSChartResource()
|
|
|
77528
77719
|
if (item.LineDash) this.VirtualKLine.LineDash=item.LineDash;
|
|
77529
77720
|
}
|
|
77530
77721
|
|
|
77722
|
+
if (style.PredictionKLine)
|
|
77723
|
+
{
|
|
77724
|
+
if (style.PredictionKLine.Line)
|
|
77725
|
+
{
|
|
77726
|
+
var item=style.PredictionKLine.Line;
|
|
77727
|
+
var dest=this.PredictionKLine.Line;
|
|
77728
|
+
if (item.Color) dest.Color=item.Color;
|
|
77729
|
+
if (item.LineDash) dest.LineDash=item.LineDash;
|
|
77730
|
+
if (IFrameSplitOperator.IsNumber(item.LineWidth)) dest.LineWidth=item.LineWidth;
|
|
77731
|
+
}
|
|
77732
|
+
|
|
77733
|
+
if (style.PredictionKLine.Bar)
|
|
77734
|
+
{
|
|
77735
|
+
var item=style.PredictionKLine.Bar;
|
|
77736
|
+
var dest=this.PredictionKLine.Bar;
|
|
77737
|
+
if (item.UpColor) dest.UpColor=item.UpColor;
|
|
77738
|
+
if (item.DownColor) dest.DownColor=item.DownColor;
|
|
77739
|
+
if (item.UnchangeColor) dest.UnchangeColor=item.UnchangeColor;
|
|
77740
|
+
if (IFrameSplitOperator.IsNumber(item.DrawType) || item.DrawType===null) dest.DrawType=item.DrawType;
|
|
77741
|
+
}
|
|
77742
|
+
}
|
|
77743
|
+
|
|
77531
77744
|
if (style.PriceGapStyple)
|
|
77532
77745
|
{
|
|
77533
77746
|
var item=style.PriceGapStyple;
|
|
@@ -82407,9 +82620,90 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
82407
82620
|
});
|
|
82408
82621
|
}
|
|
82409
82622
|
|
|
82623
|
+
|
|
82624
|
+
this.RecvRealtimeDataV2=function(data)
|
|
82625
|
+
{
|
|
82626
|
+
var aryRealtimeData=KLineChartContainer.JsonDataToRealtimeDataV2(data,this.Symbol);
|
|
82627
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(aryRealtimeData)) return;
|
|
82628
|
+
|
|
82629
|
+
var lastDataCount=this.GetHistoryDataCount(); //保存下上一次的数据个数
|
|
82630
|
+
var lastSourceDataCount=this.SourceData.Data.length;
|
|
82631
|
+
if (!this.SourceData.MergeMinuteData(aryRealtimeData, this.Period)) return;
|
|
82632
|
+
|
|
82633
|
+
var bindData=new ChartData();
|
|
82634
|
+
bindData.Data=this.SourceData.Data;
|
|
82635
|
+
bindData.Period=this.Period;
|
|
82636
|
+
bindData.Right=this.Right;
|
|
82637
|
+
bindData.DataType=this.SourceData.DataType;
|
|
82638
|
+
bindData.Symbol=this.Symbol;
|
|
82639
|
+
|
|
82640
|
+
//if (bindData.Right>0 && ChartData.IsDayPeriod(bindData.Period,true) && MARKET_SUFFIX_NAME.IsSHSZStockA(this.Symbol) && !this.IsApiPeriod) //复权(A股日线数据才复权)
|
|
82641
|
+
if (bindData.Right>0 && MARKET_SUFFIX_NAME.IsEnableRight(bindData.Period,this.Symbol,this.RightFormula) && !this.IsApiPeriod && ChartData.IsDayPeriod(bindData.Period,true)) //复权
|
|
82642
|
+
{
|
|
82643
|
+
var rightData=bindData.GetRightData(bindData.Right,{ AlgorithmType: this.RightFormula });
|
|
82644
|
+
bindData.Data=rightData;
|
|
82645
|
+
}
|
|
82646
|
+
|
|
82647
|
+
if (!this.IsApiPeriod)
|
|
82648
|
+
{
|
|
82649
|
+
if (ChartData.IsDayPeriod(bindData.Period,false) || ChartData.IsMinutePeriod(bindData.Period,false)) //周期数据 (0= 日线,4=1分钟线 不需要处理)
|
|
82650
|
+
{
|
|
82651
|
+
var periodData=bindData.GetPeriodData(bindData.Period);
|
|
82652
|
+
bindData.Data=periodData;
|
|
82653
|
+
}
|
|
82654
|
+
}
|
|
82655
|
+
|
|
82656
|
+
var kLineCalculate=this.GetKLineCalulate();
|
|
82657
|
+
if (kLineCalculate) //额外的K线图形计算
|
|
82658
|
+
{
|
|
82659
|
+
var newBindData=kLineCalculate.RecvHistoryData(bindData, { Symbol:this.Symbol, Function:"RecvRealtimeData" });
|
|
82660
|
+
bindData=newBindData;
|
|
82661
|
+
this.FlowCapitalReady=true;
|
|
82662
|
+
}
|
|
82663
|
+
|
|
82664
|
+
this.UpdateMainData(bindData,lastDataCount);//更新主图数据
|
|
82665
|
+
this.UpdateOverlayRealtimeDataV2(data); //更新叠加股票数据
|
|
82666
|
+
this.BindInstructionIndexData(bindData); //执行指示脚本
|
|
82667
|
+
|
|
82668
|
+
for(var i=0; i<this.Frame.SubFrame.length; ++i)
|
|
82669
|
+
{
|
|
82670
|
+
this.BindIndexData(i,bindData, { CheckRunCount:true });
|
|
82671
|
+
}
|
|
82672
|
+
|
|
82673
|
+
this.BindAllOverlayIndexData(bindData, { CheckRunCount:true, SyncExecute:true }); //同步模式叠加指标
|
|
82674
|
+
|
|
82675
|
+
//刷新画图
|
|
82676
|
+
this.UpdataDataoffset(); //更新数据偏移
|
|
82677
|
+
this.UpdatePointByCursorIndex(1); //更新十字光标位子
|
|
82678
|
+
this.UpdateFrameMaxMin(); //调整坐标最大 最小值
|
|
82679
|
+
this.Frame.SetSizeChage(true);
|
|
82680
|
+
this.Draw();
|
|
82681
|
+
|
|
82682
|
+
this.SendKLineUpdateEvent(bindData);
|
|
82683
|
+
this.UpdateDOMTooltip(0, bindData);
|
|
82684
|
+
this.UpdateHQFloatTooltip(bindData);
|
|
82685
|
+
|
|
82686
|
+
//叠加指标计算
|
|
82687
|
+
this.BindAllOverlayIndexData(bindData, { CheckRunCount:true,SyncExecute:false }); //异步模式叠加指标
|
|
82688
|
+
|
|
82689
|
+
if (this.mapEvent.has(JSCHART_EVENT_ID.ON_RECV_REALTIME_DATA))
|
|
82690
|
+
{
|
|
82691
|
+
var event=this.mapEvent.get(JSCHART_EVENT_ID.ON_RECV_REALTIME_DATA);
|
|
82692
|
+
var data={ HistoryData:bindData, Stock:{Symbol:this.Symbol, Name:this.Name } }
|
|
82693
|
+
event.Callback(event,data,this);
|
|
82694
|
+
}
|
|
82695
|
+
}
|
|
82696
|
+
|
|
82410
82697
|
this.RecvRealtimeData=function(data)
|
|
82411
82698
|
{
|
|
82412
82699
|
if (this.IsOnTouch==true) return; //正在操作中不更新数据
|
|
82700
|
+
|
|
82701
|
+
if (data.Ver==3.0)
|
|
82702
|
+
{
|
|
82703
|
+
this.RecvRealtimeDataV2(data);
|
|
82704
|
+
return;
|
|
82705
|
+
}
|
|
82706
|
+
|
|
82413
82707
|
var realtimeData=KLineChartContainer.JsonDataToRealtimeData(data,this.Symbol);
|
|
82414
82708
|
if (!realtimeData) return;
|
|
82415
82709
|
|
|
@@ -82590,6 +82884,47 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
82590
82884
|
}
|
|
82591
82885
|
}
|
|
82592
82886
|
|
|
82887
|
+
this.UpdateOverlayRealtimeDataV2=function(data)
|
|
82888
|
+
{
|
|
82889
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(this.OverlayChartPaint)) return;
|
|
82890
|
+
|
|
82891
|
+
for(var i=0; i<this.OverlayChartPaint.length; ++i)
|
|
82892
|
+
{
|
|
82893
|
+
var item=this.OverlayChartPaint[i];
|
|
82894
|
+
if (!item.Symbol) continue;
|
|
82895
|
+
if (!item.MainData) continue; //等待主图股票数据未下载完
|
|
82896
|
+
if (item.Status!=OVERLAY_STATUS_ID.STATUS_FINISHED_ID) continue;
|
|
82897
|
+
var aryRealtimeData=KLineChartContainer.JsonDataToRealtimeDataV2(data,item.Symbol); //获取叠加股票的最新数据
|
|
82898
|
+
if (!aryRealtimeData) continue;
|
|
82899
|
+
var sourceData=item.SourceData; //叠加股票的所有数据
|
|
82900
|
+
sourceData.MergeMinuteData(aryRealtimeData, this.Period);
|
|
82901
|
+
|
|
82902
|
+
var bindData=new ChartData();
|
|
82903
|
+
bindData.Data=sourceData.Data;
|
|
82904
|
+
bindData.Period=this.Period;
|
|
82905
|
+
bindData.Right=this.Right;
|
|
82906
|
+
bindData.DataType=0;
|
|
82907
|
+
|
|
82908
|
+
//if (bindData.Right>0 && MARKET_SUFFIX_NAME.IsSHSZStockA(data.symbol) && !this.IsApiPeriod) //复权数据 ,A股才有有复权
|
|
82909
|
+
if (bindData.Right>0 && MARKET_SUFFIX_NAME.IsEnableRight(bindData.Right, data.Symbol) && !this.IsApiPeriod)
|
|
82910
|
+
{
|
|
82911
|
+
var rightData=bindData.GetRightData(bindData.Right, { AlgorithmType: this.RightFormula });
|
|
82912
|
+
bindData.Data=rightData;
|
|
82913
|
+
}
|
|
82914
|
+
|
|
82915
|
+
var aryOverlayData=this.SourceData.GetOverlayData(bindData.Data, this.IsApiPeriod); //和主图数据拟合以后的数据
|
|
82916
|
+
bindData.Data=aryOverlayData;
|
|
82917
|
+
|
|
82918
|
+
if (ChartData.IsDayPeriod(bindData.Period,false) && !this.IsApiPeriod) //周期数据
|
|
82919
|
+
{
|
|
82920
|
+
var periodData=bindData.GetPeriodData(bindData.Period);
|
|
82921
|
+
bindData.Data=periodData;
|
|
82922
|
+
}
|
|
82923
|
+
|
|
82924
|
+
item.Data=bindData;
|
|
82925
|
+
}
|
|
82926
|
+
}
|
|
82927
|
+
|
|
82593
82928
|
this.RequestMinuteRealtimeData=function()
|
|
82594
82929
|
{
|
|
82595
82930
|
var self=this;
|
|
@@ -82711,7 +83046,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
82711
83046
|
if (this.IsApiPeriod) this.ReduceSourceData(); //减少数据
|
|
82712
83047
|
var lastDataCount=this.GetHistoryDataCount(); //保存下上一次的数据个数
|
|
82713
83048
|
if (!this.SourceData) return;
|
|
82714
|
-
if (!this.SourceData.MergeMinuteData(aryMinuteData)) return;
|
|
83049
|
+
if (!this.SourceData.MergeMinuteData(aryMinuteData, this.Period)) return;
|
|
82715
83050
|
|
|
82716
83051
|
JSConsole.Chart.Log(`[KLineChartContainer::RecvMinuteRealtimeDataV2] update kline by 1 minute data [${lastDataCount}->${this.SourceData.Data.length}], IsAutoSyncDataOffset=${this.IsAutoSyncDataOffset}`);
|
|
82717
83052
|
|
|
@@ -82794,7 +83129,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
82794
83129
|
if (this.IsApiPeriod) this.ReduceSourceData(); //减少数据
|
|
82795
83130
|
var lastDataCount=this.GetHistoryDataCount(); //保存下上一次的数据个数
|
|
82796
83131
|
var lastSourceDataCount=this.SourceData.Data.length;
|
|
82797
|
-
if (!this.SourceData.MergeMinuteData(realtimeData)) return;
|
|
83132
|
+
if (!this.SourceData.MergeMinuteData(realtimeData, this.Period)) return;
|
|
82798
83133
|
|
|
82799
83134
|
JSConsole.Chart.Log(`[KLineChartContainer::RecvMinuteRealtimeData] update kline by 1 minute data [${lastSourceDataCount}->${this.SourceData.Data.length}]`);
|
|
82800
83135
|
|
|
@@ -82865,7 +83200,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
82865
83200
|
var realtimeData=KLineChartContainer.JsonDataToMinuteRealtimeData(data,item.Symbol); //获取叠加股票的最新数据
|
|
82866
83201
|
if (!realtimeData) continue;
|
|
82867
83202
|
var sourceData=item.SourceData; //叠加股票的所有数据
|
|
82868
|
-
if (!sourceData.MergeMinuteData(realtimeData)) return;
|
|
83203
|
+
if (!sourceData.MergeMinuteData(realtimeData,this.Period)) return;
|
|
82869
83204
|
|
|
82870
83205
|
var bindData=new ChartData();
|
|
82871
83206
|
bindData.Data=sourceData.Data;
|
|
@@ -87696,6 +88031,27 @@ KLineChartContainer.JsonDataToHistoryData=function(data)
|
|
|
87696
88031
|
return aryDayData;
|
|
87697
88032
|
}
|
|
87698
88033
|
|
|
88034
|
+
|
|
88035
|
+
KLineChartContainer.JsonDataToRealtimeDataV2=function(data, symbol)
|
|
88036
|
+
{
|
|
88037
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(data.stock)) return null;
|
|
88038
|
+
|
|
88039
|
+
var finder=null;
|
|
88040
|
+
for(var i=0;i<data.stock.length;++i)
|
|
88041
|
+
{
|
|
88042
|
+
var item=data.stock[i];
|
|
88043
|
+
if (item.symbol==symbol)
|
|
88044
|
+
{
|
|
88045
|
+
finder=item;
|
|
88046
|
+
break;
|
|
88047
|
+
}
|
|
88048
|
+
}
|
|
88049
|
+
|
|
88050
|
+
if (!finder) return null;
|
|
88051
|
+
|
|
88052
|
+
return KLineChartContainer.JsonDataToHistoryData(finder);
|
|
88053
|
+
}
|
|
88054
|
+
|
|
87699
88055
|
KLineChartContainer.JsonDataToRealtimeData=function(data, symbol)
|
|
87700
88056
|
{
|
|
87701
88057
|
if (!data.stock) return null;
|
|
@@ -129376,6 +129732,23 @@ function GetBlackStyle()
|
|
|
129376
129732
|
LineDash:[2,2]
|
|
129377
129733
|
},
|
|
129378
129734
|
|
|
129735
|
+
PredictionKLine:
|
|
129736
|
+
{
|
|
129737
|
+
Line:
|
|
129738
|
+
{
|
|
129739
|
+
Color:"rgb(220,220,220)",
|
|
129740
|
+
LineDash:[3*GetDevicePixelRatio(),3*GetDevicePixelRatio()]
|
|
129741
|
+
},
|
|
129742
|
+
|
|
129743
|
+
Bar:
|
|
129744
|
+
{
|
|
129745
|
+
UpColor:"rgb(30,144,255)",
|
|
129746
|
+
DownColor:"rgb(30,144,255)",
|
|
129747
|
+
UnchangeColor:"rgb(30,144,255)" ,
|
|
129748
|
+
DrawType:3
|
|
129749
|
+
}
|
|
129750
|
+
},
|
|
129751
|
+
|
|
129379
129752
|
PriceGapStyple:
|
|
129380
129753
|
{
|
|
129381
129754
|
Line:{ Color:"rgb(128,128,128)" },
|
|
@@ -144520,7 +144893,7 @@ function ScrollBarBGChart()
|
|
|
144520
144893
|
|
|
144521
144894
|
|
|
144522
144895
|
|
|
144523
|
-
var HQCHART_VERSION="1.1.
|
|
144896
|
+
var HQCHART_VERSION="1.1.14541";
|
|
144524
144897
|
|
|
144525
144898
|
function PrintHQChartVersion()
|
|
144526
144899
|
{
|