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
|
@@ -4545,6 +4545,8 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
4545
4545
|
if (IFrameSplitOperator.IsBool(item.PriceGap.Enable)) klineChart.PriceGap.Enable=item.PriceGap.Enable;
|
|
4546
4546
|
if (IFrameSplitOperator.IsNumber(item.PriceGap.Count)) klineChart.PriceGap.Count=item.PriceGap.Count;
|
|
4547
4547
|
}
|
|
4548
|
+
|
|
4549
|
+
if (IFrameSplitOperator.IsBool(item.EnablePrediction)) klineChart.PredictionConfig.Enable=item.EnablePrediction;
|
|
4548
4550
|
}
|
|
4549
4551
|
|
|
4550
4552
|
if(option.KLineTitle)
|
|
@@ -27829,7 +27831,7 @@ function ChartData()
|
|
|
27829
27831
|
return result;
|
|
27830
27832
|
}
|
|
27831
27833
|
|
|
27832
|
-
this.MergeMinuteData=function(data) //合并数据
|
|
27834
|
+
this.MergeMinuteData=function(data, period) //合并数据
|
|
27833
27835
|
{
|
|
27834
27836
|
if (!this.Data || this.Data.length<=0)
|
|
27835
27837
|
{
|
|
@@ -27837,6 +27839,7 @@ function ChartData()
|
|
|
27837
27839
|
return true;
|
|
27838
27840
|
}
|
|
27839
27841
|
|
|
27842
|
+
var bDayPeriod=ChartData.IsDayPeriod(period, true);
|
|
27840
27843
|
var sourceFirstItem=this.Data[0];
|
|
27841
27844
|
var firstItemID=0;
|
|
27842
27845
|
var firstItem=null;
|
|
@@ -27850,11 +27853,23 @@ function ChartData()
|
|
|
27850
27853
|
break;
|
|
27851
27854
|
}
|
|
27852
27855
|
|
|
27853
|
-
if (
|
|
27856
|
+
if (bDayPeriod)
|
|
27854
27857
|
{
|
|
27855
|
-
|
|
27856
|
-
|
|
27857
|
-
|
|
27858
|
+
if (item.Date==sourceFirstItem.Date)
|
|
27859
|
+
{
|
|
27860
|
+
firstItemID=i;
|
|
27861
|
+
firstItem=item;
|
|
27862
|
+
break;
|
|
27863
|
+
}
|
|
27864
|
+
}
|
|
27865
|
+
else
|
|
27866
|
+
{
|
|
27867
|
+
if (item.Date==sourceFirstItem.Date && item.Time>=sourceFirstItem.Time)
|
|
27868
|
+
{
|
|
27869
|
+
firstItemID=i;
|
|
27870
|
+
firstItem=item;
|
|
27871
|
+
break;
|
|
27872
|
+
}
|
|
27858
27873
|
}
|
|
27859
27874
|
}
|
|
27860
27875
|
|
|
@@ -27867,11 +27882,23 @@ function ChartData()
|
|
|
27867
27882
|
var date=this.Data[i].Date;
|
|
27868
27883
|
var time=this.Data[i].Time;
|
|
27869
27884
|
|
|
27870
|
-
if (
|
|
27885
|
+
if (bDayPeriod)
|
|
27871
27886
|
{
|
|
27872
|
-
|
|
27873
|
-
|
|
27874
|
-
|
|
27887
|
+
if (firstItem.Date>date || firstItem.Date==date)
|
|
27888
|
+
{
|
|
27889
|
+
index=i;
|
|
27890
|
+
if (firstItem.Date==date) bFind=true;
|
|
27891
|
+
break;
|
|
27892
|
+
}
|
|
27893
|
+
}
|
|
27894
|
+
else
|
|
27895
|
+
{
|
|
27896
|
+
if (firstItem.Date>date || (firstItem.Date==date && firstItem.Time>=time) )
|
|
27897
|
+
{
|
|
27898
|
+
index=i;
|
|
27899
|
+
if (firstItem.Date==date && firstItem.Time==time) bFind=true;
|
|
27900
|
+
break;
|
|
27901
|
+
}
|
|
27875
27902
|
}
|
|
27876
27903
|
}
|
|
27877
27904
|
|
|
@@ -29785,9 +29812,30 @@ function ChartKLine()
|
|
|
29785
29812
|
DownAreaColor:g_JSChartResource.HLCArea.DownAreaColor,
|
|
29786
29813
|
}
|
|
29787
29814
|
|
|
29788
|
-
//虚线柱子
|
|
29815
|
+
//虚线柱子 (非交易日)
|
|
29789
29816
|
this.VirtualBarConfig={ Color:g_JSChartResource.VirtualKLine.Color, LineDash:g_JSChartResource.VirtualKLine.LineDash };
|
|
29790
29817
|
|
|
29818
|
+
//预测线配置
|
|
29819
|
+
this.PredictionConfig=
|
|
29820
|
+
{
|
|
29821
|
+
Line:
|
|
29822
|
+
{
|
|
29823
|
+
Color:g_JSChartResource.PredictionKLine.Line.Color,
|
|
29824
|
+
LineDash:g_JSChartResource.PredictionKLine.Line.LineDash,
|
|
29825
|
+
LineWidth:g_JSChartResource.PredictionKLine.Line.LineWidth
|
|
29826
|
+
},
|
|
29827
|
+
|
|
29828
|
+
Bar:
|
|
29829
|
+
{
|
|
29830
|
+
UpColor:g_JSChartResource.PredictionKLine.Bar.UpColor,
|
|
29831
|
+
DownColor:g_JSChartResource.PredictionKLine.Bar.DownColor,
|
|
29832
|
+
UnchangeColor:g_JSChartResource.PredictionKLine.Bar.UnchangeColor ,
|
|
29833
|
+
DrawType:g_JSChartResource.PredictionKLine.Bar.DrawType
|
|
29834
|
+
},
|
|
29835
|
+
Enable:false, //是否启动
|
|
29836
|
+
};
|
|
29837
|
+
this.AryPredictionCache=[]; //预测数据
|
|
29838
|
+
|
|
29791
29839
|
//DrawType==14 自定义图形
|
|
29792
29840
|
this.FFKChart;
|
|
29793
29841
|
|
|
@@ -29925,6 +29973,22 @@ function ChartKLine()
|
|
|
29925
29973
|
this.OrderFlow.UnchagneColor= { BG:g_JSChartResource.OrderFlow.UnchagneColor.BG, Border:g_JSChartResource.OrderFlow.UnchagneColor.Border };
|
|
29926
29974
|
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 };
|
|
29927
29975
|
this.OrderFlow.Line={ UpDownColor: g_JSChartResource.OrderFlow.Line.UpDownColor, MiddleColor:g_JSChartResource.OrderFlow.Line.MiddleColor };
|
|
29976
|
+
|
|
29977
|
+
this.PredictionConfig.Line=
|
|
29978
|
+
{
|
|
29979
|
+
Color:g_JSChartResource.PredictionKLine.Line.Color,
|
|
29980
|
+
LineDash:g_JSChartResource.PredictionKLine.Line.LineDash,
|
|
29981
|
+
LineWidth:g_JSChartResource.PredictionKLine.Line.LineWidth
|
|
29982
|
+
};
|
|
29983
|
+
|
|
29984
|
+
this.PredictionConfig.Bar=
|
|
29985
|
+
{
|
|
29986
|
+
UpColor:g_JSChartResource.PredictionKLine.Bar.UpColor,
|
|
29987
|
+
DownColor:g_JSChartResource.PredictionKLine.Bar.DownColor,
|
|
29988
|
+
UnchangeColor:g_JSChartResource.PredictionKLine.Bar.UnchangeColor,
|
|
29989
|
+
DrawType:g_JSChartResource.PredictionKLine.Bar.DrawType
|
|
29990
|
+
};
|
|
29991
|
+
|
|
29928
29992
|
}
|
|
29929
29993
|
|
|
29930
29994
|
this.ClearCustomKLine=function()
|
|
@@ -30295,6 +30359,8 @@ function ChartKLine()
|
|
|
30295
30359
|
this.DrawKRange.Start=this.Data.DataOffset;
|
|
30296
30360
|
|
|
30297
30361
|
var preKItemInfo=null;
|
|
30362
|
+
var prePoint=null;
|
|
30363
|
+
var xEnd=null; //最后一个点
|
|
30298
30364
|
for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length && j<xPointCount;++i,++j,xOffset+=(dataWidth+distanceWidth),++this.ShowRange.DataCount)
|
|
30299
30365
|
{
|
|
30300
30366
|
var data=this.Data.Data[i];
|
|
@@ -30308,6 +30374,13 @@ function ChartKLine()
|
|
|
30308
30374
|
var yClose=this.GetYFromData(data.Close,false);
|
|
30309
30375
|
this.DrawKRange.End=i;
|
|
30310
30376
|
|
|
30377
|
+
if (data.IsVirtual && this.PredictionConfig.Enable) //预测数据|虚拟数据
|
|
30378
|
+
{
|
|
30379
|
+
this.AryPredictionCache.push({ PrePoint:prePoint, Point:{ X:x, Y:yClose }});
|
|
30380
|
+
prePoint={ X:x, Y:yClose};
|
|
30381
|
+
continue;
|
|
30382
|
+
}
|
|
30383
|
+
|
|
30311
30384
|
if (bFirstPoint)
|
|
30312
30385
|
{
|
|
30313
30386
|
if (isHScreen)
|
|
@@ -30328,6 +30401,9 @@ function ChartKLine()
|
|
|
30328
30401
|
else this.Canvas.lineTo(x,yClose);
|
|
30329
30402
|
}
|
|
30330
30403
|
|
|
30404
|
+
xEnd=x;
|
|
30405
|
+
prePoint={ X:x, Y:yClose};
|
|
30406
|
+
|
|
30331
30407
|
if (i==this.Data.Data.length-1)
|
|
30332
30408
|
{
|
|
30333
30409
|
ptLast={ X:x, Y:yClose, XLeft:left, XRight:right, KItem:data, ChartRight:chartright };
|
|
@@ -30359,12 +30435,12 @@ function ChartKLine()
|
|
|
30359
30435
|
this.Canvas.stroke();
|
|
30360
30436
|
if (isHScreen)
|
|
30361
30437
|
{
|
|
30362
|
-
this.Canvas.lineTo(border.Left,
|
|
30438
|
+
this.Canvas.lineTo(border.Left,xEnd);
|
|
30363
30439
|
this.Canvas.lineTo(border.Left,firstPoint.Y);
|
|
30364
30440
|
}
|
|
30365
30441
|
else
|
|
30366
30442
|
{
|
|
30367
|
-
this.Canvas.lineTo(
|
|
30443
|
+
this.Canvas.lineTo(xEnd,border.Bottom);
|
|
30368
30444
|
this.Canvas.lineTo(firstPoint.X,border.Bottom);
|
|
30369
30445
|
}
|
|
30370
30446
|
this.Canvas.closePath();
|
|
@@ -30427,11 +30503,12 @@ function ChartKLine()
|
|
|
30427
30503
|
var mapBreakPoint=this.BuildBreakPoint(); //断点
|
|
30428
30504
|
|
|
30429
30505
|
var preKItemInfo=null;
|
|
30506
|
+
var prePoint=null;
|
|
30430
30507
|
for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length && j<xPointCount;++i,++j,xOffset+=(dataWidth+distanceWidth),++this.ShowRange.DataCount)
|
|
30431
30508
|
{
|
|
30432
30509
|
var data=this.Data.Data[i];
|
|
30433
30510
|
this.ShowRange.End=i;
|
|
30434
|
-
if (data.Open==null || data.High==null || data.Low==null || data.Close==null) continue;
|
|
30511
|
+
if (!data || data.Open==null || data.High==null || data.Low==null || data.Close==null) continue;
|
|
30435
30512
|
|
|
30436
30513
|
var left=xOffset;
|
|
30437
30514
|
var right=xOffset+dataWidth;
|
|
@@ -30440,6 +30517,13 @@ function ChartKLine()
|
|
|
30440
30517
|
var yClose=this.GetYFromData(data.Close,false);
|
|
30441
30518
|
this.DrawKRange.End=i;
|
|
30442
30519
|
|
|
30520
|
+
if (data.IsVirtual && this.PredictionConfig.Enable) //预测数据|虚拟数据
|
|
30521
|
+
{
|
|
30522
|
+
this.AryPredictionCache.push({ PrePoint:prePoint, Point:{ X:x, Y:yClose }});
|
|
30523
|
+
prePoint={ X:x, Y:yClose};
|
|
30524
|
+
continue;
|
|
30525
|
+
}
|
|
30526
|
+
|
|
30443
30527
|
if (bFirstPoint)
|
|
30444
30528
|
{
|
|
30445
30529
|
if (isHScreen) this.Canvas.moveTo(yClose,x);
|
|
@@ -30453,6 +30537,8 @@ function ChartKLine()
|
|
|
30453
30537
|
}
|
|
30454
30538
|
++drawCount;
|
|
30455
30539
|
|
|
30540
|
+
prePoint={ X:x, Y:yClose};
|
|
30541
|
+
|
|
30456
30542
|
if (this.PriceGap.Enable)
|
|
30457
30543
|
{
|
|
30458
30544
|
var yLow=this.GetYFromData(data.Low, false);
|
|
@@ -30527,6 +30613,7 @@ function ChartKLine()
|
|
|
30527
30613
|
}
|
|
30528
30614
|
|
|
30529
30615
|
var preKItemInfo=null;
|
|
30616
|
+
var prePoint=null; //上一个点的位置
|
|
30530
30617
|
for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length && j<xPointCount;++i,++j,xOffset+=(dataWidth+distanceWidth),++this.ShowRange.DataCount)
|
|
30531
30618
|
{
|
|
30532
30619
|
var data=this.Data.Data[i];
|
|
@@ -30576,6 +30663,10 @@ function ChartKLine()
|
|
|
30576
30663
|
{
|
|
30577
30664
|
this.DrawVirtualBar(data, dataWidth, x, y, left, right, yLow, yHigh, yOpen, yClose, isHScreen);
|
|
30578
30665
|
}
|
|
30666
|
+
else if (data.IsVirtual && this.PredictionConfig.Enable)
|
|
30667
|
+
{
|
|
30668
|
+
this.DrawPredictionBar(data, dataWidth, x, y, left, right, yLow, yHigh, yOpen, yClose, isHScreen);
|
|
30669
|
+
}
|
|
30579
30670
|
else if (kLineOption)
|
|
30580
30671
|
{
|
|
30581
30672
|
var barColor=kLineOption.Color;
|
|
@@ -30657,6 +30748,8 @@ function ChartKLine()
|
|
|
30657
30748
|
if (value>0)
|
|
30658
30749
|
this.AryPriceGapCache.push({ Data:[preKItemInfo, kItemInfo], Type:value });
|
|
30659
30750
|
}
|
|
30751
|
+
|
|
30752
|
+
prePoint={ X:x, Y:yClose }; //上一个点
|
|
30660
30753
|
|
|
30661
30754
|
preKItemInfo=kItemInfo;
|
|
30662
30755
|
}
|
|
@@ -31528,6 +31621,82 @@ function ChartKLine()
|
|
|
31528
31621
|
this.Canvas.setLineDash([]);
|
|
31529
31622
|
}
|
|
31530
31623
|
|
|
31624
|
+
this.DrawPredictionBar=function(data, dataWidth, x, y, left, right, yLow, yHigh, yOpen, yClose, isHScreen)
|
|
31625
|
+
{
|
|
31626
|
+
var config=this.PredictionConfig.Bar;
|
|
31627
|
+
var drawType=this.DrawType;
|
|
31628
|
+
if (IFrameSplitOperator.IsNumber(config.DrawType)) drawType=config.DrawType;
|
|
31629
|
+
|
|
31630
|
+
if (data.Open<data.Close) //阳线
|
|
31631
|
+
{
|
|
31632
|
+
this.DrawKBar_Up(data, dataWidth, config.UpColor, drawType, x, y, left, right, yLow, yHigh, yOpen, yClose, isHScreen);
|
|
31633
|
+
}
|
|
31634
|
+
else if (data.Open>data.Close) //阴线
|
|
31635
|
+
{
|
|
31636
|
+
this.DrawKBar_Down(data, dataWidth, config.DownColor, drawType, x, y, left, right, yLow, yHigh, yOpen, yClose, isHScreen);
|
|
31637
|
+
}
|
|
31638
|
+
else
|
|
31639
|
+
{
|
|
31640
|
+
this.DrawKBar_Unchagne(data, dataWidth, config.UnchangeColor, drawType, x, y, left, right, yLow, yHigh, yOpen, yClose, isHScreen);
|
|
31641
|
+
}
|
|
31642
|
+
}
|
|
31643
|
+
|
|
31644
|
+
this.DrawPredictionLine=function()
|
|
31645
|
+
{
|
|
31646
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(this.AryPredictionCache)) return;
|
|
31647
|
+
|
|
31648
|
+
this.Canvas.save();
|
|
31649
|
+
|
|
31650
|
+
var bHScreen=(this.ChartFrame.IsHScreen===true);
|
|
31651
|
+
var bFirstPoint=true;
|
|
31652
|
+
var drawCount=0;
|
|
31653
|
+
for(var i=0;i<this.AryPredictionCache.length;++i)
|
|
31654
|
+
{
|
|
31655
|
+
var item=this.AryPredictionCache[i];
|
|
31656
|
+
if (bFirstPoint)
|
|
31657
|
+
{
|
|
31658
|
+
bFirstPoint=false;
|
|
31659
|
+
this.Canvas.beginPath();
|
|
31660
|
+
if (item.PrePoint)
|
|
31661
|
+
{
|
|
31662
|
+
var pt=item.PrePoint;
|
|
31663
|
+
if (bHScreen) this.Canvas.moveTo(pt.Y,pt.X); //横屏坐标轴对调
|
|
31664
|
+
else this.Canvas.moveTo(pt.X,pt.Y);
|
|
31665
|
+
|
|
31666
|
+
var pt=item.Point;
|
|
31667
|
+
if (bHScreen) this.Canvas.lineTo(pt.Y,pt.X);
|
|
31668
|
+
else this.Canvas.lineTo(pt.X,pt.Y);
|
|
31669
|
+
}
|
|
31670
|
+
else if (item.Point)
|
|
31671
|
+
{
|
|
31672
|
+
var pt=item.Point;
|
|
31673
|
+
if (bHScreen) this.Canvas.moveTo(pt.Y,pt.X); //横屏坐标轴对调
|
|
31674
|
+
else this.Canvas.moveTo(pt.X,pt.Y);
|
|
31675
|
+
}
|
|
31676
|
+
}
|
|
31677
|
+
else
|
|
31678
|
+
{
|
|
31679
|
+
var pt=item.Point;
|
|
31680
|
+
if (bHScreen) this.Canvas.lineTo(pt.Y,pt.X);
|
|
31681
|
+
else this.Canvas.lineTo(pt.X,pt.Y);
|
|
31682
|
+
}
|
|
31683
|
+
|
|
31684
|
+
++drawCount;
|
|
31685
|
+
}
|
|
31686
|
+
|
|
31687
|
+
if (drawCount>0)
|
|
31688
|
+
{
|
|
31689
|
+
var pixelRatio=GetDevicePixelRatio();
|
|
31690
|
+
var config=this.PredictionConfig.Line;
|
|
31691
|
+
this.Canvas.strokeStyle=config.Color;
|
|
31692
|
+
if (IFrameSplitOperator.IsNumber(config.LineWidth)) this.Canvas.lineWidth=config.LineWidth*pixelRatio;
|
|
31693
|
+
if (IFrameSplitOperator.IsNonEmptyArray(config.LineDash)) this.Canvas.setLineDash(config.LineDash)
|
|
31694
|
+
this.Canvas.stroke();
|
|
31695
|
+
}
|
|
31696
|
+
|
|
31697
|
+
this.Canvas.restore();
|
|
31698
|
+
}
|
|
31699
|
+
|
|
31531
31700
|
this.DrawRenkoCandle=function() //砖型K线
|
|
31532
31701
|
{
|
|
31533
31702
|
var isHScreen=(this.ChartFrame.IsHScreen===true);
|
|
@@ -32344,6 +32513,7 @@ function ChartKLine()
|
|
|
32344
32513
|
this.PtMin={X:null,Y:null,Value:null,Align:'left'}; //清空最小
|
|
32345
32514
|
this.DrawKRange={ Start:null, End:null };
|
|
32346
32515
|
this.AryPriceGapCache=[];
|
|
32516
|
+
this.AryPredictionCache=[];
|
|
32347
32517
|
|
|
32348
32518
|
this.ChartFrame.ChartKLine={Max:null, Min:null }; //保存K线上 显示最大最小值坐标
|
|
32349
32519
|
|
|
@@ -32384,6 +32554,7 @@ function ChartKLine()
|
|
|
32384
32554
|
{
|
|
32385
32555
|
this.DrawCloseLine();
|
|
32386
32556
|
this.Canvas.restore();
|
|
32557
|
+
this.DrawPredictionLine();
|
|
32387
32558
|
if (this.PriceGap.Enable) this.DrawPriceGap();
|
|
32388
32559
|
return;
|
|
32389
32560
|
}
|
|
@@ -32456,6 +32627,7 @@ function ChartKLine()
|
|
|
32456
32627
|
|
|
32457
32628
|
this.Canvas.restore();
|
|
32458
32629
|
|
|
32630
|
+
this.DrawPredictionLine();
|
|
32459
32631
|
if (this.PriceGap.Enable) this.DrawPriceGap();
|
|
32460
32632
|
|
|
32461
32633
|
if (this.IsShowMaxMinPrice) //标注最大值最小值
|
|
@@ -39235,6 +39407,7 @@ function ChartVolStick()
|
|
|
39235
39407
|
var value=this.Data.Data[i];
|
|
39236
39408
|
var kItem=this.HistoryData.Data[i];
|
|
39237
39409
|
if (value==null || kItem==null) continue;
|
|
39410
|
+
if (!IFrameSplitOperator.IsNumber(value)) continue;
|
|
39238
39411
|
if (value==0) continue;
|
|
39239
39412
|
|
|
39240
39413
|
var left=xOffset;
|
|
@@ -76172,6 +76345,24 @@ function JSChartResource()
|
|
|
76172
76345
|
LineDash:[2,2]
|
|
76173
76346
|
};
|
|
76174
76347
|
|
|
76348
|
+
this.PredictionKLine=
|
|
76349
|
+
{
|
|
76350
|
+
Line:
|
|
76351
|
+
{
|
|
76352
|
+
Color:"rgb(100,100,100)",
|
|
76353
|
+
LineDash:[3,5],
|
|
76354
|
+
LineWidth:2,
|
|
76355
|
+
},
|
|
76356
|
+
|
|
76357
|
+
Bar:
|
|
76358
|
+
{
|
|
76359
|
+
UpColor:"rgb(65,105,225)",
|
|
76360
|
+
DownColor:"rgb(65,105,225)",
|
|
76361
|
+
UnchangeColor:"rgb(65,105,225s)" ,
|
|
76362
|
+
DrawType:3
|
|
76363
|
+
}
|
|
76364
|
+
};
|
|
76365
|
+
|
|
76175
76366
|
this.PriceGapStyple=
|
|
76176
76367
|
{
|
|
76177
76368
|
Line:{ Color:"rgb(186,186,186)" },
|
|
@@ -77572,6 +77763,28 @@ function JSChartResource()
|
|
|
77572
77763
|
if (item.LineDash) this.VirtualKLine.LineDash=item.LineDash;
|
|
77573
77764
|
}
|
|
77574
77765
|
|
|
77766
|
+
if (style.PredictionKLine)
|
|
77767
|
+
{
|
|
77768
|
+
if (style.PredictionKLine.Line)
|
|
77769
|
+
{
|
|
77770
|
+
var item=style.PredictionKLine.Line;
|
|
77771
|
+
var dest=this.PredictionKLine.Line;
|
|
77772
|
+
if (item.Color) dest.Color=item.Color;
|
|
77773
|
+
if (item.LineDash) dest.LineDash=item.LineDash;
|
|
77774
|
+
if (IFrameSplitOperator.IsNumber(item.LineWidth)) dest.LineWidth=item.LineWidth;
|
|
77775
|
+
}
|
|
77776
|
+
|
|
77777
|
+
if (style.PredictionKLine.Bar)
|
|
77778
|
+
{
|
|
77779
|
+
var item=style.PredictionKLine.Bar;
|
|
77780
|
+
var dest=this.PredictionKLine.Bar;
|
|
77781
|
+
if (item.UpColor) dest.UpColor=item.UpColor;
|
|
77782
|
+
if (item.DownColor) dest.DownColor=item.DownColor;
|
|
77783
|
+
if (item.UnchangeColor) dest.UnchangeColor=item.UnchangeColor;
|
|
77784
|
+
if (IFrameSplitOperator.IsNumber(item.DrawType) || item.DrawType===null) dest.DrawType=item.DrawType;
|
|
77785
|
+
}
|
|
77786
|
+
}
|
|
77787
|
+
|
|
77575
77788
|
if (style.PriceGapStyple)
|
|
77576
77789
|
{
|
|
77577
77790
|
var item=style.PriceGapStyple;
|
|
@@ -82451,9 +82664,90 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
82451
82664
|
});
|
|
82452
82665
|
}
|
|
82453
82666
|
|
|
82667
|
+
|
|
82668
|
+
this.RecvRealtimeDataV2=function(data)
|
|
82669
|
+
{
|
|
82670
|
+
var aryRealtimeData=KLineChartContainer.JsonDataToRealtimeDataV2(data,this.Symbol);
|
|
82671
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(aryRealtimeData)) return;
|
|
82672
|
+
|
|
82673
|
+
var lastDataCount=this.GetHistoryDataCount(); //保存下上一次的数据个数
|
|
82674
|
+
var lastSourceDataCount=this.SourceData.Data.length;
|
|
82675
|
+
if (!this.SourceData.MergeMinuteData(aryRealtimeData, this.Period)) return;
|
|
82676
|
+
|
|
82677
|
+
var bindData=new ChartData();
|
|
82678
|
+
bindData.Data=this.SourceData.Data;
|
|
82679
|
+
bindData.Period=this.Period;
|
|
82680
|
+
bindData.Right=this.Right;
|
|
82681
|
+
bindData.DataType=this.SourceData.DataType;
|
|
82682
|
+
bindData.Symbol=this.Symbol;
|
|
82683
|
+
|
|
82684
|
+
//if (bindData.Right>0 && ChartData.IsDayPeriod(bindData.Period,true) && MARKET_SUFFIX_NAME.IsSHSZStockA(this.Symbol) && !this.IsApiPeriod) //复权(A股日线数据才复权)
|
|
82685
|
+
if (bindData.Right>0 && MARKET_SUFFIX_NAME.IsEnableRight(bindData.Period,this.Symbol,this.RightFormula) && !this.IsApiPeriod && ChartData.IsDayPeriod(bindData.Period,true)) //复权
|
|
82686
|
+
{
|
|
82687
|
+
var rightData=bindData.GetRightData(bindData.Right,{ AlgorithmType: this.RightFormula });
|
|
82688
|
+
bindData.Data=rightData;
|
|
82689
|
+
}
|
|
82690
|
+
|
|
82691
|
+
if (!this.IsApiPeriod)
|
|
82692
|
+
{
|
|
82693
|
+
if (ChartData.IsDayPeriod(bindData.Period,false) || ChartData.IsMinutePeriod(bindData.Period,false)) //周期数据 (0= 日线,4=1分钟线 不需要处理)
|
|
82694
|
+
{
|
|
82695
|
+
var periodData=bindData.GetPeriodData(bindData.Period);
|
|
82696
|
+
bindData.Data=periodData;
|
|
82697
|
+
}
|
|
82698
|
+
}
|
|
82699
|
+
|
|
82700
|
+
var kLineCalculate=this.GetKLineCalulate();
|
|
82701
|
+
if (kLineCalculate) //额外的K线图形计算
|
|
82702
|
+
{
|
|
82703
|
+
var newBindData=kLineCalculate.RecvHistoryData(bindData, { Symbol:this.Symbol, Function:"RecvRealtimeData" });
|
|
82704
|
+
bindData=newBindData;
|
|
82705
|
+
this.FlowCapitalReady=true;
|
|
82706
|
+
}
|
|
82707
|
+
|
|
82708
|
+
this.UpdateMainData(bindData,lastDataCount);//更新主图数据
|
|
82709
|
+
this.UpdateOverlayRealtimeDataV2(data); //更新叠加股票数据
|
|
82710
|
+
this.BindInstructionIndexData(bindData); //执行指示脚本
|
|
82711
|
+
|
|
82712
|
+
for(var i=0; i<this.Frame.SubFrame.length; ++i)
|
|
82713
|
+
{
|
|
82714
|
+
this.BindIndexData(i,bindData, { CheckRunCount:true });
|
|
82715
|
+
}
|
|
82716
|
+
|
|
82717
|
+
this.BindAllOverlayIndexData(bindData, { CheckRunCount:true, SyncExecute:true }); //同步模式叠加指标
|
|
82718
|
+
|
|
82719
|
+
//刷新画图
|
|
82720
|
+
this.UpdataDataoffset(); //更新数据偏移
|
|
82721
|
+
this.UpdatePointByCursorIndex(1); //更新十字光标位子
|
|
82722
|
+
this.UpdateFrameMaxMin(); //调整坐标最大 最小值
|
|
82723
|
+
this.Frame.SetSizeChage(true);
|
|
82724
|
+
this.Draw();
|
|
82725
|
+
|
|
82726
|
+
this.SendKLineUpdateEvent(bindData);
|
|
82727
|
+
this.UpdateDOMTooltip(0, bindData);
|
|
82728
|
+
this.UpdateHQFloatTooltip(bindData);
|
|
82729
|
+
|
|
82730
|
+
//叠加指标计算
|
|
82731
|
+
this.BindAllOverlayIndexData(bindData, { CheckRunCount:true,SyncExecute:false }); //异步模式叠加指标
|
|
82732
|
+
|
|
82733
|
+
if (this.mapEvent.has(JSCHART_EVENT_ID.ON_RECV_REALTIME_DATA))
|
|
82734
|
+
{
|
|
82735
|
+
var event=this.mapEvent.get(JSCHART_EVENT_ID.ON_RECV_REALTIME_DATA);
|
|
82736
|
+
var data={ HistoryData:bindData, Stock:{Symbol:this.Symbol, Name:this.Name } }
|
|
82737
|
+
event.Callback(event,data,this);
|
|
82738
|
+
}
|
|
82739
|
+
}
|
|
82740
|
+
|
|
82454
82741
|
this.RecvRealtimeData=function(data)
|
|
82455
82742
|
{
|
|
82456
82743
|
if (this.IsOnTouch==true) return; //正在操作中不更新数据
|
|
82744
|
+
|
|
82745
|
+
if (data.Ver==3.0)
|
|
82746
|
+
{
|
|
82747
|
+
this.RecvRealtimeDataV2(data);
|
|
82748
|
+
return;
|
|
82749
|
+
}
|
|
82750
|
+
|
|
82457
82751
|
var realtimeData=KLineChartContainer.JsonDataToRealtimeData(data,this.Symbol);
|
|
82458
82752
|
if (!realtimeData) return;
|
|
82459
82753
|
|
|
@@ -82634,6 +82928,47 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
82634
82928
|
}
|
|
82635
82929
|
}
|
|
82636
82930
|
|
|
82931
|
+
this.UpdateOverlayRealtimeDataV2=function(data)
|
|
82932
|
+
{
|
|
82933
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(this.OverlayChartPaint)) return;
|
|
82934
|
+
|
|
82935
|
+
for(var i=0; i<this.OverlayChartPaint.length; ++i)
|
|
82936
|
+
{
|
|
82937
|
+
var item=this.OverlayChartPaint[i];
|
|
82938
|
+
if (!item.Symbol) continue;
|
|
82939
|
+
if (!item.MainData) continue; //等待主图股票数据未下载完
|
|
82940
|
+
if (item.Status!=OVERLAY_STATUS_ID.STATUS_FINISHED_ID) continue;
|
|
82941
|
+
var aryRealtimeData=KLineChartContainer.JsonDataToRealtimeDataV2(data,item.Symbol); //获取叠加股票的最新数据
|
|
82942
|
+
if (!aryRealtimeData) continue;
|
|
82943
|
+
var sourceData=item.SourceData; //叠加股票的所有数据
|
|
82944
|
+
sourceData.MergeMinuteData(aryRealtimeData, this.Period);
|
|
82945
|
+
|
|
82946
|
+
var bindData=new ChartData();
|
|
82947
|
+
bindData.Data=sourceData.Data;
|
|
82948
|
+
bindData.Period=this.Period;
|
|
82949
|
+
bindData.Right=this.Right;
|
|
82950
|
+
bindData.DataType=0;
|
|
82951
|
+
|
|
82952
|
+
//if (bindData.Right>0 && MARKET_SUFFIX_NAME.IsSHSZStockA(data.symbol) && !this.IsApiPeriod) //复权数据 ,A股才有有复权
|
|
82953
|
+
if (bindData.Right>0 && MARKET_SUFFIX_NAME.IsEnableRight(bindData.Right, data.Symbol) && !this.IsApiPeriod)
|
|
82954
|
+
{
|
|
82955
|
+
var rightData=bindData.GetRightData(bindData.Right, { AlgorithmType: this.RightFormula });
|
|
82956
|
+
bindData.Data=rightData;
|
|
82957
|
+
}
|
|
82958
|
+
|
|
82959
|
+
var aryOverlayData=this.SourceData.GetOverlayData(bindData.Data, this.IsApiPeriod); //和主图数据拟合以后的数据
|
|
82960
|
+
bindData.Data=aryOverlayData;
|
|
82961
|
+
|
|
82962
|
+
if (ChartData.IsDayPeriod(bindData.Period,false) && !this.IsApiPeriod) //周期数据
|
|
82963
|
+
{
|
|
82964
|
+
var periodData=bindData.GetPeriodData(bindData.Period);
|
|
82965
|
+
bindData.Data=periodData;
|
|
82966
|
+
}
|
|
82967
|
+
|
|
82968
|
+
item.Data=bindData;
|
|
82969
|
+
}
|
|
82970
|
+
}
|
|
82971
|
+
|
|
82637
82972
|
this.RequestMinuteRealtimeData=function()
|
|
82638
82973
|
{
|
|
82639
82974
|
var self=this;
|
|
@@ -82755,7 +83090,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
82755
83090
|
if (this.IsApiPeriod) this.ReduceSourceData(); //减少数据
|
|
82756
83091
|
var lastDataCount=this.GetHistoryDataCount(); //保存下上一次的数据个数
|
|
82757
83092
|
if (!this.SourceData) return;
|
|
82758
|
-
if (!this.SourceData.MergeMinuteData(aryMinuteData)) return;
|
|
83093
|
+
if (!this.SourceData.MergeMinuteData(aryMinuteData, this.Period)) return;
|
|
82759
83094
|
|
|
82760
83095
|
JSConsole.Chart.Log(`[KLineChartContainer::RecvMinuteRealtimeDataV2] update kline by 1 minute data [${lastDataCount}->${this.SourceData.Data.length}], IsAutoSyncDataOffset=${this.IsAutoSyncDataOffset}`);
|
|
82761
83096
|
|
|
@@ -82838,7 +83173,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
82838
83173
|
if (this.IsApiPeriod) this.ReduceSourceData(); //减少数据
|
|
82839
83174
|
var lastDataCount=this.GetHistoryDataCount(); //保存下上一次的数据个数
|
|
82840
83175
|
var lastSourceDataCount=this.SourceData.Data.length;
|
|
82841
|
-
if (!this.SourceData.MergeMinuteData(realtimeData)) return;
|
|
83176
|
+
if (!this.SourceData.MergeMinuteData(realtimeData, this.Period)) return;
|
|
82842
83177
|
|
|
82843
83178
|
JSConsole.Chart.Log(`[KLineChartContainer::RecvMinuteRealtimeData] update kline by 1 minute data [${lastSourceDataCount}->${this.SourceData.Data.length}]`);
|
|
82844
83179
|
|
|
@@ -82909,7 +83244,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
82909
83244
|
var realtimeData=KLineChartContainer.JsonDataToMinuteRealtimeData(data,item.Symbol); //获取叠加股票的最新数据
|
|
82910
83245
|
if (!realtimeData) continue;
|
|
82911
83246
|
var sourceData=item.SourceData; //叠加股票的所有数据
|
|
82912
|
-
if (!sourceData.MergeMinuteData(realtimeData)) return;
|
|
83247
|
+
if (!sourceData.MergeMinuteData(realtimeData,this.Period)) return;
|
|
82913
83248
|
|
|
82914
83249
|
var bindData=new ChartData();
|
|
82915
83250
|
bindData.Data=sourceData.Data;
|
|
@@ -87740,6 +88075,27 @@ KLineChartContainer.JsonDataToHistoryData=function(data)
|
|
|
87740
88075
|
return aryDayData;
|
|
87741
88076
|
}
|
|
87742
88077
|
|
|
88078
|
+
|
|
88079
|
+
KLineChartContainer.JsonDataToRealtimeDataV2=function(data, symbol)
|
|
88080
|
+
{
|
|
88081
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(data.stock)) return null;
|
|
88082
|
+
|
|
88083
|
+
var finder=null;
|
|
88084
|
+
for(var i=0;i<data.stock.length;++i)
|
|
88085
|
+
{
|
|
88086
|
+
var item=data.stock[i];
|
|
88087
|
+
if (item.symbol==symbol)
|
|
88088
|
+
{
|
|
88089
|
+
finder=item;
|
|
88090
|
+
break;
|
|
88091
|
+
}
|
|
88092
|
+
}
|
|
88093
|
+
|
|
88094
|
+
if (!finder) return null;
|
|
88095
|
+
|
|
88096
|
+
return KLineChartContainer.JsonDataToHistoryData(finder);
|
|
88097
|
+
}
|
|
88098
|
+
|
|
87743
88099
|
KLineChartContainer.JsonDataToRealtimeData=function(data, symbol)
|
|
87744
88100
|
{
|
|
87745
88101
|
if (!data.stock) return null;
|
|
@@ -129420,6 +129776,23 @@ function GetBlackStyle()
|
|
|
129420
129776
|
LineDash:[2,2]
|
|
129421
129777
|
},
|
|
129422
129778
|
|
|
129779
|
+
PredictionKLine:
|
|
129780
|
+
{
|
|
129781
|
+
Line:
|
|
129782
|
+
{
|
|
129783
|
+
Color:"rgb(220,220,220)",
|
|
129784
|
+
LineDash:[3*GetDevicePixelRatio(),3*GetDevicePixelRatio()]
|
|
129785
|
+
},
|
|
129786
|
+
|
|
129787
|
+
Bar:
|
|
129788
|
+
{
|
|
129789
|
+
UpColor:"rgb(30,144,255)",
|
|
129790
|
+
DownColor:"rgb(30,144,255)",
|
|
129791
|
+
UnchangeColor:"rgb(30,144,255)" ,
|
|
129792
|
+
DrawType:3
|
|
129793
|
+
}
|
|
129794
|
+
},
|
|
129795
|
+
|
|
129423
129796
|
PriceGapStyple:
|
|
129424
129797
|
{
|
|
129425
129798
|
Line:{ Color:"rgb(128,128,128)" },
|
|
@@ -149193,6 +149566,10 @@ function JSDialogModifyDraw()
|
|
|
149193
149566
|
bShowLineColor=false;
|
|
149194
149567
|
bAdvanced=true;
|
|
149195
149568
|
}
|
|
149569
|
+
else if (chart.ClassName=="ChartDrawPictureIconFont")
|
|
149570
|
+
{
|
|
149571
|
+
bShowFontZoom=true;
|
|
149572
|
+
}
|
|
149196
149573
|
|
|
149197
149574
|
if (this.ColorButton)
|
|
149198
149575
|
{
|
|
@@ -154786,7 +155163,7 @@ function HQChartScriptWorker()
|
|
|
154786
155163
|
|
|
154787
155164
|
|
|
154788
155165
|
|
|
154789
|
-
var HQCHART_VERSION="1.1.
|
|
155166
|
+
var HQCHART_VERSION="1.1.14541";
|
|
154790
155167
|
|
|
154791
155168
|
function PrintHQChartVersion()
|
|
154792
155169
|
{
|