hqchart 1.1.12505 → 1.1.12513
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.stock.vue.js +2 -2
- package/lib/umychart.vue.js +25 -23
- package/package.json +1 -1
- package/src/jscommon/umychart.complier.js +60 -1
- package/src/jscommon/umychart.js +96 -50
- package/src/jscommon/umychart.stock.js +2 -2
- package/src/jscommon/umychart.testdata/300439.sz.5day.minute.js +12172 -0
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +157 -52
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.stock.vue.js +2 -2
- package/src/jscommon/umychart.vue/umychart.vue.js +157 -52
- package/src/jscommon/umychart.wechat/umychart.complier.wechat.js +3 -2
- package/src/jscommon/umychart.wechat/umychart.data.wechat.js +1 -0
- package/src/jscommon/umychart.wechat/umychart.index.wechat.js +6 -0
- package/src/jscommon/umychart.wechat/umychart.version.wechat.js +1 -1
package/src/jscommon/umychart.js
CHANGED
|
@@ -6290,6 +6290,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
6290
6290
|
return false;
|
|
6291
6291
|
}
|
|
6292
6292
|
|
|
6293
|
+
this.IsMinuteContainer=function()
|
|
6294
|
+
{
|
|
6295
|
+
if (this.ClassName=="MinuteChartContainer" || this.ClassName=="MinuteChartHScreenContainer") return true;
|
|
6296
|
+
|
|
6297
|
+
return false;
|
|
6298
|
+
}
|
|
6299
|
+
|
|
6293
6300
|
this.UpdatePointByCursorIndex=function(type) //type 1=根据十字光标更新 2=强制取消十字光标
|
|
6294
6301
|
{
|
|
6295
6302
|
var pt={X:null, Y:null};
|
|
@@ -20865,9 +20872,12 @@ function IChartPainting()
|
|
|
20865
20872
|
}
|
|
20866
20873
|
else if (valueType==3)
|
|
20867
20874
|
{
|
|
20868
|
-
var
|
|
20869
|
-
|
|
20870
|
-
|
|
20875
|
+
var minItem=this.Data.Data[i];
|
|
20876
|
+
var mainItem=this.MainData.Data[i];
|
|
20877
|
+
if (!minItem || !IFrameSplitOperator.IsNumber(minItem.Close) || !IFrameSplitOperator.IsNumber(minItem.YClose)) continue;
|
|
20878
|
+
if (!mainItem || !IFrameSplitOperator.IsNumber(mainItem.Close) || !IFrameSplitOperator.IsNumber(mainItem.YClose)) continue;
|
|
20879
|
+
var price=minItem.Close;
|
|
20880
|
+
var value=price/minItem.YClose*mainItem.YClose;
|
|
20871
20881
|
}
|
|
20872
20882
|
else if (valueType==4)
|
|
20873
20883
|
{
|
|
@@ -20987,9 +20997,12 @@ function IChartPainting()
|
|
|
20987
20997
|
}
|
|
20988
20998
|
else if (valueType==3)
|
|
20989
20999
|
{
|
|
20990
|
-
var
|
|
20991
|
-
|
|
20992
|
-
|
|
21000
|
+
var minItem=this.Data.Data[i];
|
|
21001
|
+
var mainItem=this.MainData.Data[i];
|
|
21002
|
+
if (!minItem || !IFrameSplitOperator.IsNumber(minItem.Close) || !IFrameSplitOperator.IsNumber(minItem.YClose)) continue;
|
|
21003
|
+
if (!mainItem || !IFrameSplitOperator.IsNumber(mainItem.Close) || !IFrameSplitOperator.IsNumber(mainItem.YClose)) continue;
|
|
21004
|
+
var price=minItem.Close;
|
|
21005
|
+
var value=price/minItem.YClose*mainItem.YClose;
|
|
20993
21006
|
}
|
|
20994
21007
|
else
|
|
20995
21008
|
{
|
|
@@ -31639,19 +31652,16 @@ function ChartOverlayMinutePriceLine()
|
|
|
31639
31652
|
|
|
31640
31653
|
this.Color="rgb(65,105,225)";
|
|
31641
31654
|
this.MainData; //主图数据
|
|
31642
|
-
this.MainYClose; //主图股票的前收盘价
|
|
31643
31655
|
this.SourceData; //原始数据
|
|
31644
31656
|
|
|
31645
31657
|
this.ClassName="ChartOverlayMinutePriceLine";
|
|
31646
31658
|
this.Title;
|
|
31647
31659
|
this.Symbol; //叠加的股票代码
|
|
31648
|
-
this.YClose; //叠加的股票前收盘
|
|
31649
31660
|
this.Status=OVERLAY_STATUS_ID.STATUS_NONE_ID;
|
|
31650
31661
|
|
|
31651
31662
|
this.OverlayType=0; //叠加方式 0=百分比叠加 1=绝对叠加
|
|
31652
31663
|
this.IsCalcuateMaxMin=true; //是否参与计算Y轴的最大最小值
|
|
31653
31664
|
|
|
31654
|
-
|
|
31655
31665
|
this.SetOption=function(option)
|
|
31656
31666
|
{
|
|
31657
31667
|
if (option)
|
|
@@ -31663,19 +31673,21 @@ function ChartOverlayMinutePriceLine()
|
|
|
31663
31673
|
|
|
31664
31674
|
this.PtInChart=function(x,y)
|
|
31665
31675
|
{
|
|
31666
|
-
var option={ MinuteOverlayPrice:true,
|
|
31676
|
+
var option={ MinuteOverlayPrice:true, OverlayType:this.OverlayType };
|
|
31667
31677
|
return this.PtInLine(x, y, option);
|
|
31668
31678
|
}
|
|
31669
31679
|
|
|
31670
31680
|
this.DrawSelectedStatus=function()
|
|
31671
31681
|
{
|
|
31672
|
-
var option={ MinuteOverlayPrice:true,
|
|
31682
|
+
var option={ MinuteOverlayPrice:true, OverlayType:this.OverlayType };
|
|
31673
31683
|
this.DrawLinePoint(option);
|
|
31674
31684
|
}
|
|
31675
31685
|
|
|
31676
31686
|
this.Draw=function()
|
|
31677
31687
|
{
|
|
31678
31688
|
if (!this.Data) return;
|
|
31689
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data)) return;
|
|
31690
|
+
|
|
31679
31691
|
if (this.NotSupportMessage)
|
|
31680
31692
|
{
|
|
31681
31693
|
this.DrawNotSupportmessage();
|
|
@@ -31696,37 +31708,53 @@ function ChartOverlayMinutePriceLine()
|
|
|
31696
31708
|
var bFirstPoint=true;
|
|
31697
31709
|
var drawCount=0;
|
|
31698
31710
|
var xOffset=0, showValue=0;
|
|
31711
|
+
var yClose=null, mainYClose=null;
|
|
31712
|
+
var pointCount=0;
|
|
31699
31713
|
for(var i=this.Data.DataOffset+xOffset,j=0;i<this.Data.Data.length && j<xPointCount;++i,++j)
|
|
31700
31714
|
{
|
|
31701
|
-
var
|
|
31702
|
-
if (
|
|
31715
|
+
var item=this.Data.Data[i];
|
|
31716
|
+
if (item && IFrameSplitOperator.IsNumber(item.Close))
|
|
31717
|
+
{
|
|
31718
|
+
if (bFirstPoint) //百分比使用每天的昨收计算
|
|
31719
|
+
{
|
|
31720
|
+
yClose=item.YClose;
|
|
31721
|
+
var minItem=this.MainData.Data[i];
|
|
31722
|
+
mainYClose=minItem.YClose;
|
|
31723
|
+
}
|
|
31703
31724
|
|
|
31704
|
-
|
|
31705
|
-
|
|
31725
|
+
var value=item.Close;
|
|
31726
|
+
showValue=value; //绝对叠加
|
|
31706
31727
|
|
|
31707
|
-
|
|
31708
|
-
|
|
31728
|
+
if (this.OverlayType==0)
|
|
31729
|
+
showValue=value/yClose*mainYClose; //百分比
|
|
31709
31730
|
|
|
31710
|
-
|
|
31711
|
-
|
|
31712
|
-
|
|
31713
|
-
|
|
31714
|
-
|
|
31715
|
-
|
|
31716
|
-
|
|
31717
|
-
|
|
31718
|
-
|
|
31719
|
-
|
|
31720
|
-
|
|
31721
|
-
else
|
|
31731
|
+
var x=this.ChartFrame.GetXFromIndex(j);
|
|
31732
|
+
var y=this.ChartFrame.GetYFromData(showValue, false);
|
|
31733
|
+
|
|
31734
|
+
if (bFirstPoint)
|
|
31735
|
+
{
|
|
31736
|
+
this.Canvas.strokeStyle=this.Color;
|
|
31737
|
+
this.Canvas.beginPath();
|
|
31738
|
+
if (isHScreen) this.Canvas.moveTo(y,x);
|
|
31739
|
+
else this.Canvas.moveTo(x,y);
|
|
31740
|
+
bFirstPoint=false;
|
|
31741
|
+
}
|
|
31742
|
+
else
|
|
31743
|
+
{
|
|
31744
|
+
if (isHScreen) this.Canvas.lineTo(y,x);
|
|
31745
|
+
else this.Canvas.lineTo(x,y);
|
|
31746
|
+
}
|
|
31747
|
+
|
|
31748
|
+
++drawCount;
|
|
31722
31749
|
}
|
|
31723
31750
|
|
|
31724
|
-
++
|
|
31751
|
+
++pointCount;
|
|
31725
31752
|
|
|
31726
|
-
if (
|
|
31753
|
+
if (pointCount>=minuteCount) //上一天的数据和这天地数据线段要断开
|
|
31727
31754
|
{
|
|
31728
31755
|
bFirstPoint=true;
|
|
31729
|
-
|
|
31756
|
+
pointCount=0;
|
|
31757
|
+
if (drawCount>0) this.Canvas.stroke();
|
|
31730
31758
|
drawCount=0;
|
|
31731
31759
|
}
|
|
31732
31760
|
}
|
|
@@ -31739,24 +31767,46 @@ function ChartOverlayMinutePriceLine()
|
|
|
31739
31767
|
this.GetMaxMin=function()
|
|
31740
31768
|
{
|
|
31741
31769
|
var xPointCount=this.ChartFrame.XPointCount;
|
|
31742
|
-
var range={};
|
|
31770
|
+
var range={ Min:null, Max:null };
|
|
31743
31771
|
if (!this.IsCalcuateMaxMin) return range;
|
|
31744
|
-
if (this.YClose==null) return range;
|
|
31745
31772
|
|
|
31746
|
-
|
|
31747
|
-
|
|
31773
|
+
var minuteCount=this.ChartFrame.MinuteCount;
|
|
31774
|
+
var yClose=null, mainYClose=null;
|
|
31775
|
+
var bFirstPoint=true;
|
|
31776
|
+
var pointCount=0;
|
|
31748
31777
|
for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length && j<xPointCount;++i,++j)
|
|
31749
31778
|
{
|
|
31750
|
-
var
|
|
31751
|
-
if (
|
|
31779
|
+
var item=this.Data.Data[i];
|
|
31780
|
+
if (!item || !IFrameSplitOperator.IsNumber(item.Close))
|
|
31781
|
+
{
|
|
31782
|
+
++pointCount;
|
|
31783
|
+
continue;
|
|
31784
|
+
}
|
|
31752
31785
|
|
|
31753
|
-
if (
|
|
31786
|
+
if (bFirstPoint)
|
|
31787
|
+
{
|
|
31788
|
+
yClose=item.YClose;
|
|
31789
|
+
var minItem=this.MainData.Data[i];
|
|
31790
|
+
mainYClose=minItem.YClose;
|
|
31791
|
+
bFirstPoint=false;
|
|
31792
|
+
}
|
|
31793
|
+
|
|
31794
|
+
var value=item.Close;
|
|
31795
|
+
if (this.OverlayType==0) value=value/yClose*mainYClose;
|
|
31754
31796
|
|
|
31755
31797
|
if (range.Max==null) range.Max=value;
|
|
31756
31798
|
if (range.Min==null) range.Min=value;
|
|
31757
31799
|
|
|
31758
31800
|
if (range.Max<value) range.Max=value;
|
|
31759
31801
|
if (range.Min>value) range.Min=value;
|
|
31802
|
+
|
|
31803
|
+
++pointCount;
|
|
31804
|
+
|
|
31805
|
+
if (pointCount>=minuteCount)
|
|
31806
|
+
{
|
|
31807
|
+
bFirstPoint=true;
|
|
31808
|
+
pointCount=0;
|
|
31809
|
+
}
|
|
31760
31810
|
}
|
|
31761
31811
|
|
|
31762
31812
|
//JSConsole.Chart.Log(`[ChartOverlayMinutePriceLine::GetMaxMin] max=${range.Max} min=${range.Min}`);
|
|
@@ -72884,7 +72934,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
72884
72934
|
//叠加股票
|
|
72885
72935
|
this.OverlaySymbol=function(symbol,option)
|
|
72886
72936
|
{
|
|
72887
|
-
for(var i
|
|
72937
|
+
for(var i=0; i<this.OverlayChartPaint.length; ++i)
|
|
72888
72938
|
{
|
|
72889
72939
|
var item=this.OverlayChartPaint[i];
|
|
72890
72940
|
if (item.Symbol==symbol)
|
|
@@ -72904,11 +72954,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
72904
72954
|
if (option && option.Color) paint.Color=option.Color; //外部设置颜色
|
|
72905
72955
|
else paint.Color=g_JSChartResource.OverlaySymbol.Color[g_JSChartResource.OverlaySymbol.Random%g_JSChartResource.OverlaySymbol.Color.length];
|
|
72906
72956
|
++g_JSChartResource.OverlaySymbol.Random;
|
|
72907
|
-
|
|
72908
|
-
{
|
|
72909
|
-
paint.MainData=this.ChartPaint[0].Data;
|
|
72910
|
-
paint.MainYClose=this.ChartPaint[0].YClose;
|
|
72911
|
-
}
|
|
72957
|
+
paint.MainData=this.SourceData; //绑定主图数据
|
|
72912
72958
|
|
|
72913
72959
|
if (paint.SetOption) paint.SetOption(option);
|
|
72914
72960
|
|
|
@@ -73876,7 +73922,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
73876
73922
|
for(var i=0; i<this.OverlayChartPaint.length; ++i)
|
|
73877
73923
|
{
|
|
73878
73924
|
let item=this.OverlayChartPaint[i];
|
|
73879
|
-
if (!item.MainData
|
|
73925
|
+
if (!item.MainData) continue;
|
|
73880
73926
|
if (item.Status!=OVERLAY_STATUS_ID.STATUS_NONE_ID) continue;
|
|
73881
73927
|
var symbol=item.Symbol;
|
|
73882
73928
|
if (!symbol) continue;
|
|
@@ -73937,7 +73983,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
73937
73983
|
for(var j=0; j<this.OverlayChartPaint.length; ++j)
|
|
73938
73984
|
{
|
|
73939
73985
|
var item=this.OverlayChartPaint[j];
|
|
73940
|
-
if (!item.MainData
|
|
73986
|
+
if (!item.MainData) continue;
|
|
73941
73987
|
if (overlayData.symbol==item.Symbol)
|
|
73942
73988
|
{
|
|
73943
73989
|
this.RecvOverlayMinuteData(overlayData, item, { Redraw:false });
|
|
@@ -74098,6 +74144,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
74098
74144
|
{
|
|
74099
74145
|
var empytData=new ChartData();
|
|
74100
74146
|
empytData.Date=item.Date;
|
|
74147
|
+
empytData.Data.length=item.Data.length;
|
|
74101
74148
|
overlayDayData.push(empytData);
|
|
74102
74149
|
}
|
|
74103
74150
|
}
|
|
@@ -74331,11 +74378,10 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
74331
74378
|
this.ExtendChartPaint[0].Name=this.Name;
|
|
74332
74379
|
}
|
|
74333
74380
|
|
|
74334
|
-
for(var i
|
|
74381
|
+
for(var i=0; i<this.OverlayChartPaint.length; ++i)
|
|
74335
74382
|
{
|
|
74336
74383
|
var item=this.OverlayChartPaint[i];
|
|
74337
|
-
item.MainData=
|
|
74338
|
-
item.MainYClose=yClose;
|
|
74384
|
+
item.MainData=minuteData; //绑定主图数据
|
|
74339
74385
|
}
|
|
74340
74386
|
}
|
|
74341
74387
|
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
|
|
18
18
|
function JSStockResource()
|
|
19
19
|
{
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
this.Domain = "http://127.0.0.1:8886"; //API域名
|
|
21
|
+
this.CacheDomain = "http://127.0.0.1:8886"; //缓存域名
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
var g_JSStockResource = new JSStockResource();
|