hqchart 1.1.12505 → 1.1.12516
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 +62 -37
- package/package.json +1 -1
- package/src/jscommon/umychart.complier.js +60 -1
- package/src/jscommon/umychart.js +155 -73
- 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 +216 -75
- 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 +216 -75
- 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
|
@@ -5712,6 +5712,7 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
5712
5712
|
|
|
5713
5713
|
this.JSChartContainer=chart;
|
|
5714
5714
|
|
|
5715
|
+
if (option.DefaultCursor) chart.DefaultCursor=option.DefaultCursor;
|
|
5715
5716
|
if (option.OnCreatedCallback) option.OnCreatedCallback(chart);
|
|
5716
5717
|
|
|
5717
5718
|
//是否自动更新
|
|
@@ -6817,6 +6818,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
6817
6818
|
this.IsClickShowCorssCursor=false; //手势点击显示十字光标
|
|
6818
6819
|
this.ChartSplashPaint=null; //等待提示
|
|
6819
6820
|
this.LoadDataSplashTitle="数据加载中"; //下载数据提示信息
|
|
6821
|
+
this.DefaultCursor="default"; //crosshair , default 默认手型
|
|
6820
6822
|
|
|
6821
6823
|
//绘图缓存
|
|
6822
6824
|
this.CacheCanvas=null;
|
|
@@ -7296,7 +7298,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
7296
7298
|
event.Callback(event, sendData, this);
|
|
7297
7299
|
this.CustomChartDrag=sendData.ChartDrag;
|
|
7298
7300
|
|
|
7299
|
-
|
|
7301
|
+
this.SetCursor(sendData);
|
|
7300
7302
|
}
|
|
7301
7303
|
|
|
7302
7304
|
this.TryDragMove_CustomChartDrag=function(sendData)
|
|
@@ -7375,7 +7377,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
7375
7377
|
{
|
|
7376
7378
|
if (item.Type==4)
|
|
7377
7379
|
{
|
|
7378
|
-
this.UIElement.style.cursor="pointer";
|
|
7380
|
+
//this.UIElement.style.cursor="pointer";
|
|
7381
|
+
this.SetCursor({Cursor:"pointer"});
|
|
7379
7382
|
var obj={ X:e.clientX };
|
|
7380
7383
|
if (this.GetXDataIndex(obj))
|
|
7381
7384
|
{
|
|
@@ -7385,7 +7388,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
7385
7388
|
}
|
|
7386
7389
|
else
|
|
7387
7390
|
{
|
|
7388
|
-
this.UIElement.style.cursor="ew-resize";
|
|
7391
|
+
//this.UIElement.style.cursor="ew-resize";
|
|
7392
|
+
this.SetCursor({Cursor:"ew-resize"});
|
|
7389
7393
|
this.RectSelectDrag={ Index:item.PointIndex, Type:item.Type };
|
|
7390
7394
|
JSConsole.Chart.Log("[JSChartContainer::UIOnMouseDown] drag rect select ",item);
|
|
7391
7395
|
}
|
|
@@ -7399,7 +7403,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
7399
7403
|
var dragBorder=this.Frame.PtInFrameBorder(x,y);
|
|
7400
7404
|
if (dragBorder && dragBorder.Index>=0)
|
|
7401
7405
|
{
|
|
7402
|
-
this.UIElement.style.cursor="n-resize";
|
|
7406
|
+
//this.UIElement.style.cursor="n-resize";
|
|
7407
|
+
this.SetCursor({Cursor:"n-resize"});
|
|
7403
7408
|
this.BorderDrag={ Index:dragBorder.Index };
|
|
7404
7409
|
JSConsole.Chart.Log("[JSChartContainer::UIOnMouseDown] DragBorder ",dragBorder);
|
|
7405
7410
|
}
|
|
@@ -7411,7 +7416,9 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
7411
7416
|
var dragY=this.TryYDrag(x,y);
|
|
7412
7417
|
if (dragY)
|
|
7413
7418
|
{
|
|
7414
|
-
this.UIElement.style.cursor=dragY.Position==0 ? "n-resize":"row-resize";
|
|
7419
|
+
//this.UIElement.style.cursor=dragY.Position==0 ? "n-resize":"row-resize";
|
|
7420
|
+
var cursor=dragY.Position==0 ? "n-resize":"row-resize";
|
|
7421
|
+
this.SetCursor({Cursor:cursor});
|
|
7415
7422
|
this.YDrag=dragY;
|
|
7416
7423
|
JSConsole.Chart.Log("[JSChartContainer::UIOnMouseDown] dragY ",dragY);
|
|
7417
7424
|
}
|
|
@@ -7420,7 +7427,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
7420
7427
|
var dragUpDown=this.TryUpDownDrag(x,y);
|
|
7421
7428
|
if (dragUpDown)
|
|
7422
7429
|
{
|
|
7423
|
-
this.UIElement.style.cursor="pointer";
|
|
7430
|
+
//this.UIElement.style.cursor="pointer";
|
|
7431
|
+
this.SetCursor({Cursor:"pointer"});
|
|
7424
7432
|
this.UpDownDrag=dragUpDown;
|
|
7425
7433
|
JSConsole.Chart.Log("[JSChartContainer::UIOnMouseDown] dragUpDown ",dragUpDown);
|
|
7426
7434
|
}
|
|
@@ -7743,8 +7751,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
7743
7751
|
|
|
7744
7752
|
if (moveSetp<5 && yMoveSetp<5) return;
|
|
7745
7753
|
|
|
7746
|
-
this.UIElement.style.cursor="default";
|
|
7747
|
-
|
|
7754
|
+
//this.UIElement.style.cursor="default";
|
|
7755
|
+
this.SetCursor({Cursor:"default"});
|
|
7748
7756
|
var x=drag.Click.X-uielement.getBoundingClientRect().left;
|
|
7749
7757
|
var y=drag.Click.Y-uielement.getBoundingClientRect().top;
|
|
7750
7758
|
var x2=e.clientX-uielement.getBoundingClientRect().left;
|
|
@@ -7773,7 +7781,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
7773
7781
|
{
|
|
7774
7782
|
var yMove=e.clientY-drag.LastMove.Y;
|
|
7775
7783
|
JSConsole.Chart.Log("[JSChartContainer::OnDragMode_One] UpDownDrag ",this.UpDownDrag,yMove);
|
|
7776
|
-
this.UIElement.style.cursor="pointer";
|
|
7784
|
+
//this.UIElement.style.cursor="pointer";
|
|
7785
|
+
this.SetCursor({Cursor:"pointer"});
|
|
7777
7786
|
if (this.OnUpDonwFrameY(this.UpDownDrag, yMove))
|
|
7778
7787
|
{
|
|
7779
7788
|
bNeedDraw=true;
|
|
@@ -7820,7 +7829,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
7820
7829
|
var oneStepWidth=this.GetMoveOneStepWidth();
|
|
7821
7830
|
if (moveSetp<oneStepWidth)
|
|
7822
7831
|
{
|
|
7823
|
-
this.UIElement.style.cursor=cursorStatus;
|
|
7832
|
+
//this.UIElement.style.cursor=cursorStatus;
|
|
7833
|
+
this.SetCursor({Cursor:cursorStatus});
|
|
7824
7834
|
if (bNeedDraw) this.Draw();
|
|
7825
7835
|
return;
|
|
7826
7836
|
}
|
|
@@ -7850,7 +7860,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
7850
7860
|
if (this.DragDownloadData) this.DragDownloadData();
|
|
7851
7861
|
}
|
|
7852
7862
|
}
|
|
7853
|
-
this.UIElement.style.cursor=cursorStatus;
|
|
7863
|
+
//this.UIElement.style.cursor=cursorStatus;
|
|
7864
|
+
this.SetCursor({Cursor:cursorStatus});
|
|
7854
7865
|
}
|
|
7855
7866
|
drag.LastMove.X=e.clientX;
|
|
7856
7867
|
}
|
|
@@ -7918,7 +7929,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
7918
7929
|
var chartMove=this.GetExtendChartByClassName("DragMovePaint");
|
|
7919
7930
|
if (chartMove && chartMove.Chart) chartMove.Chart.Clear();
|
|
7920
7931
|
if (!this.OnDragChart(this.IndexChartDrag)) this.DrawDynamicInfo();
|
|
7921
|
-
this.UIElement.style.cursor="default";
|
|
7932
|
+
//this.UIElement.style.cursor="default";
|
|
7933
|
+
this.SetCursor({Cursor:"default"});
|
|
7922
7934
|
}
|
|
7923
7935
|
else if (this.CustomChartDrag)
|
|
7924
7936
|
{
|
|
@@ -8008,7 +8020,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
8008
8020
|
//清空数据
|
|
8009
8021
|
JSConsole.Chart.Log('[KLineChartContainer::document.onmouseup]',e);
|
|
8010
8022
|
if (this.SelectChartDrawPicture) this.SelectChartDrawPicture.DragInfo=null;
|
|
8011
|
-
this.UIElement.style.cursor="default";
|
|
8023
|
+
//this.UIElement.style.cursor="default";
|
|
8024
|
+
this.SetCursor({Cursor:"default"});
|
|
8012
8025
|
this.MouseDrag=null;
|
|
8013
8026
|
this.ClickDownPoint=null;
|
|
8014
8027
|
this.IsOnTouch=false;
|
|
@@ -9843,7 +9856,6 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
9843
9856
|
var frameID=this.Frame.PtInFrame(x,y);
|
|
9844
9857
|
if (IFrameSplitOperator.IsNumber(frameID) && frameID>=0) //在K线内部移动,调整K线索引
|
|
9845
9858
|
this.CursorIndex=this.Frame.GetXData(x);
|
|
9846
|
-
|
|
9847
9859
|
|
|
9848
9860
|
|
|
9849
9861
|
if (this.EnableBorderDrag && this.Frame && !this.CurrentChartDrawPicture)
|
|
@@ -9966,13 +9978,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
9966
9978
|
|
|
9967
9979
|
if (drawPictrueData.PointIndex===100)
|
|
9968
9980
|
{
|
|
9969
|
-
if (drawPictrueData.Cursor) this.UIElement.style.cursor=drawPictrueData.Cursor;
|
|
9970
|
-
else this.UIElement.style.cursor="move";
|
|
9981
|
+
if (drawPictrueData.Cursor) this.SetCursor(drawPictrueData); //this.UIElement.style.cursor=drawPictrueData.Cursor;
|
|
9982
|
+
else this.SetCursor({Cursor:"move"}); //this.UIElement.style.cursor="move";
|
|
9971
9983
|
}
|
|
9972
9984
|
else
|
|
9973
9985
|
{
|
|
9974
|
-
if (drawPictrueData.Cursor) this.UIElement.style.cursor=drawPictrueData.Cursor
|
|
9975
|
-
else this.UIElement.style.cursor="pointer";
|
|
9986
|
+
if (drawPictrueData.Cursor) this.SetCursor(drawPictrueData); //this.UIElement.style.cursor=drawPictrueData.Cursor
|
|
9987
|
+
else this.SetCursor({Cursor:"pointer"}); //this.UIElement.style.cursor="pointer";
|
|
9976
9988
|
}
|
|
9977
9989
|
|
|
9978
9990
|
bDrawPicture=true;
|
|
@@ -9980,7 +9992,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
9980
9992
|
}
|
|
9981
9993
|
else
|
|
9982
9994
|
{
|
|
9983
|
-
if (!this.MouseDrag) this.UIElement.style.cursor="default";
|
|
9995
|
+
if (!this.MouseDrag) this.SetCursor({Cursor:"default"}); //this.UIElement.style.cursor="default";
|
|
9984
9996
|
}
|
|
9985
9997
|
}
|
|
9986
9998
|
|
|
@@ -10003,7 +10015,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
10003
10015
|
this.DrawDynamicInfo(option);
|
|
10004
10016
|
}
|
|
10005
10017
|
|
|
10006
|
-
|
|
10018
|
+
this.SetCursor(mouseStatus);
|
|
10007
10019
|
|
|
10008
10020
|
if (this.IsShowTooltip && bDrawPicture==false)
|
|
10009
10021
|
{
|
|
@@ -10031,6 +10043,17 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
10031
10043
|
}
|
|
10032
10044
|
}
|
|
10033
10045
|
|
|
10046
|
+
//设置鼠标形状 {Cursor:鼠标形状 }
|
|
10047
|
+
this.SetCursor=function(obj)
|
|
10048
|
+
{
|
|
10049
|
+
if (!obj || !obj.Cursor) return;
|
|
10050
|
+
|
|
10051
|
+
if (obj.Cursor=="default")
|
|
10052
|
+
this.UIElement.style.cursor=this.DefaultCursor;
|
|
10053
|
+
else
|
|
10054
|
+
this.UIElement.style.cursor=obj.Cursor;
|
|
10055
|
+
}
|
|
10056
|
+
|
|
10034
10057
|
this.OnKeyDown=function(e)
|
|
10035
10058
|
{
|
|
10036
10059
|
if (this.ChartSplashPaint && this.ChartSplashPaint.IsEnableSplash == true) return;
|
|
@@ -10414,6 +10437,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
10414
10437
|
return false;
|
|
10415
10438
|
}
|
|
10416
10439
|
|
|
10440
|
+
this.IsMinuteContainer=function()
|
|
10441
|
+
{
|
|
10442
|
+
if (this.ClassName=="MinuteChartContainer" || this.ClassName=="MinuteChartHScreenContainer") return true;
|
|
10443
|
+
|
|
10444
|
+
return false;
|
|
10445
|
+
}
|
|
10446
|
+
|
|
10417
10447
|
this.UpdatePointByCursorIndex=function(type) //type 1=根据十字光标更新 2=强制取消十字光标
|
|
10418
10448
|
{
|
|
10419
10449
|
var pt={X:null, Y:null};
|
|
@@ -12777,6 +12807,7 @@ function CoordinateInfo()
|
|
|
12777
12807
|
this.Value; //坐标数据
|
|
12778
12808
|
this.Message=[]; //坐标输出文字信息 0=左 1=右 2=内左 3=内右
|
|
12779
12809
|
this.TextColor=g_JSChartResource.FrameSplitTextColor //文字颜色
|
|
12810
|
+
this.TextBGColor; //文字背景色
|
|
12780
12811
|
this.TextColor2; //右侧文字颜色,空使用TextColor
|
|
12781
12812
|
this.Font=g_JSChartResource.FrameSplitTextFont; //字体
|
|
12782
12813
|
this.LineColor=g_JSChartResource.FrameSplitPen; //线段颜色
|
|
@@ -14289,9 +14320,10 @@ function AverageWidthFrame()
|
|
|
14289
14320
|
this.Canvas.font=this.VerticalInfo[i].Font;
|
|
14290
14321
|
|
|
14291
14322
|
var textLeft=0;
|
|
14292
|
-
|
|
14323
|
+
|
|
14293
14324
|
this.Canvas.strokeStyle=item.TextColor;
|
|
14294
14325
|
var testWidth=this.Canvas.measureText(this.VerticalInfo[i].Message[0]).width;
|
|
14326
|
+
var textHeight=this.Canvas.measureText("擎").width;
|
|
14295
14327
|
if (x<testWidth/2)
|
|
14296
14328
|
{
|
|
14297
14329
|
this.Canvas.textAlign="left";
|
|
@@ -14325,6 +14357,15 @@ function AverageWidthFrame()
|
|
|
14325
14357
|
yText+=lineLength+2*pixelRatio;
|
|
14326
14358
|
}
|
|
14327
14359
|
|
|
14360
|
+
//item.TextBGColor="rgb(0,255,0)";
|
|
14361
|
+
if (item.TextBGColor) //文字背景色
|
|
14362
|
+
{
|
|
14363
|
+
var rtText={ Left:textLeft, Top:yText+this.XBottomOffset, Width:testWidth, Height:textHeight };
|
|
14364
|
+
this.Canvas.fillStyle=item.TextBGColor;
|
|
14365
|
+
this.Canvas.fillRect(rtText.Left-1, rtText.Top, rtText.Width+2, rtText.Height);
|
|
14366
|
+
}
|
|
14367
|
+
|
|
14368
|
+
this.Canvas.fillStyle=item.TextColor;
|
|
14328
14369
|
this.Canvas.fillText(this.VerticalInfo[i].Message[0],x,yText+this.XBottomOffset);
|
|
14329
14370
|
textRightPrev=textLeft+testWidth;
|
|
14330
14371
|
}
|
|
@@ -24989,9 +25030,12 @@ function IChartPainting()
|
|
|
24989
25030
|
}
|
|
24990
25031
|
else if (valueType==3)
|
|
24991
25032
|
{
|
|
24992
|
-
var
|
|
24993
|
-
|
|
24994
|
-
|
|
25033
|
+
var minItem=this.Data.Data[i];
|
|
25034
|
+
var mainItem=this.MainData.Data[i];
|
|
25035
|
+
if (!minItem || !IFrameSplitOperator.IsNumber(minItem.Close) || !IFrameSplitOperator.IsNumber(minItem.YClose)) continue;
|
|
25036
|
+
if (!mainItem || !IFrameSplitOperator.IsNumber(mainItem.Close) || !IFrameSplitOperator.IsNumber(mainItem.YClose)) continue;
|
|
25037
|
+
var price=minItem.Close;
|
|
25038
|
+
var value=price/minItem.YClose*mainItem.YClose;
|
|
24995
25039
|
}
|
|
24996
25040
|
else if (valueType==4)
|
|
24997
25041
|
{
|
|
@@ -25111,9 +25155,12 @@ function IChartPainting()
|
|
|
25111
25155
|
}
|
|
25112
25156
|
else if (valueType==3)
|
|
25113
25157
|
{
|
|
25114
|
-
var
|
|
25115
|
-
|
|
25116
|
-
|
|
25158
|
+
var minItem=this.Data.Data[i];
|
|
25159
|
+
var mainItem=this.MainData.Data[i];
|
|
25160
|
+
if (!minItem || !IFrameSplitOperator.IsNumber(minItem.Close) || !IFrameSplitOperator.IsNumber(minItem.YClose)) continue;
|
|
25161
|
+
if (!mainItem || !IFrameSplitOperator.IsNumber(mainItem.Close) || !IFrameSplitOperator.IsNumber(mainItem.YClose)) continue;
|
|
25162
|
+
var price=minItem.Close;
|
|
25163
|
+
var value=price/minItem.YClose*mainItem.YClose;
|
|
25117
25164
|
}
|
|
25118
25165
|
else
|
|
25119
25166
|
{
|
|
@@ -35763,19 +35810,16 @@ function ChartOverlayMinutePriceLine()
|
|
|
35763
35810
|
|
|
35764
35811
|
this.Color="rgb(65,105,225)";
|
|
35765
35812
|
this.MainData; //主图数据
|
|
35766
|
-
this.MainYClose; //主图股票的前收盘价
|
|
35767
35813
|
this.SourceData; //原始数据
|
|
35768
35814
|
|
|
35769
35815
|
this.ClassName="ChartOverlayMinutePriceLine";
|
|
35770
35816
|
this.Title;
|
|
35771
35817
|
this.Symbol; //叠加的股票代码
|
|
35772
|
-
this.YClose; //叠加的股票前收盘
|
|
35773
35818
|
this.Status=OVERLAY_STATUS_ID.STATUS_NONE_ID;
|
|
35774
35819
|
|
|
35775
35820
|
this.OverlayType=0; //叠加方式 0=百分比叠加 1=绝对叠加
|
|
35776
35821
|
this.IsCalcuateMaxMin=true; //是否参与计算Y轴的最大最小值
|
|
35777
35822
|
|
|
35778
|
-
|
|
35779
35823
|
this.SetOption=function(option)
|
|
35780
35824
|
{
|
|
35781
35825
|
if (option)
|
|
@@ -35787,19 +35831,21 @@ function ChartOverlayMinutePriceLine()
|
|
|
35787
35831
|
|
|
35788
35832
|
this.PtInChart=function(x,y)
|
|
35789
35833
|
{
|
|
35790
|
-
var option={ MinuteOverlayPrice:true,
|
|
35834
|
+
var option={ MinuteOverlayPrice:true, OverlayType:this.OverlayType };
|
|
35791
35835
|
return this.PtInLine(x, y, option);
|
|
35792
35836
|
}
|
|
35793
35837
|
|
|
35794
35838
|
this.DrawSelectedStatus=function()
|
|
35795
35839
|
{
|
|
35796
|
-
var option={ MinuteOverlayPrice:true,
|
|
35840
|
+
var option={ MinuteOverlayPrice:true, OverlayType:this.OverlayType };
|
|
35797
35841
|
this.DrawLinePoint(option);
|
|
35798
35842
|
}
|
|
35799
35843
|
|
|
35800
35844
|
this.Draw=function()
|
|
35801
35845
|
{
|
|
35802
35846
|
if (!this.Data) return;
|
|
35847
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data)) return;
|
|
35848
|
+
|
|
35803
35849
|
if (this.NotSupportMessage)
|
|
35804
35850
|
{
|
|
35805
35851
|
this.DrawNotSupportmessage();
|
|
@@ -35820,37 +35866,53 @@ function ChartOverlayMinutePriceLine()
|
|
|
35820
35866
|
var bFirstPoint=true;
|
|
35821
35867
|
var drawCount=0;
|
|
35822
35868
|
var xOffset=0, showValue=0;
|
|
35869
|
+
var yClose=null, mainYClose=null;
|
|
35870
|
+
var pointCount=0;
|
|
35823
35871
|
for(var i=this.Data.DataOffset+xOffset,j=0;i<this.Data.Data.length && j<xPointCount;++i,++j)
|
|
35824
35872
|
{
|
|
35825
|
-
var
|
|
35826
|
-
if (
|
|
35873
|
+
var item=this.Data.Data[i];
|
|
35874
|
+
if (item && IFrameSplitOperator.IsNumber(item.Close))
|
|
35875
|
+
{
|
|
35876
|
+
if (bFirstPoint) //百分比使用每天的昨收计算
|
|
35877
|
+
{
|
|
35878
|
+
yClose=item.YClose;
|
|
35879
|
+
var minItem=this.MainData.Data[i];
|
|
35880
|
+
mainYClose=minItem.YClose;
|
|
35881
|
+
}
|
|
35827
35882
|
|
|
35828
|
-
|
|
35829
|
-
|
|
35883
|
+
var value=item.Close;
|
|
35884
|
+
showValue=value; //绝对叠加
|
|
35830
35885
|
|
|
35831
|
-
|
|
35832
|
-
|
|
35886
|
+
if (this.OverlayType==0)
|
|
35887
|
+
showValue=value/yClose*mainYClose; //百分比
|
|
35833
35888
|
|
|
35834
|
-
|
|
35835
|
-
|
|
35836
|
-
|
|
35837
|
-
|
|
35838
|
-
|
|
35839
|
-
|
|
35840
|
-
|
|
35841
|
-
|
|
35842
|
-
|
|
35843
|
-
|
|
35844
|
-
|
|
35845
|
-
else
|
|
35889
|
+
var x=this.ChartFrame.GetXFromIndex(j);
|
|
35890
|
+
var y=this.ChartFrame.GetYFromData(showValue, false);
|
|
35891
|
+
|
|
35892
|
+
if (bFirstPoint)
|
|
35893
|
+
{
|
|
35894
|
+
this.Canvas.strokeStyle=this.Color;
|
|
35895
|
+
this.Canvas.beginPath();
|
|
35896
|
+
if (isHScreen) this.Canvas.moveTo(y,x);
|
|
35897
|
+
else this.Canvas.moveTo(x,y);
|
|
35898
|
+
bFirstPoint=false;
|
|
35899
|
+
}
|
|
35900
|
+
else
|
|
35901
|
+
{
|
|
35902
|
+
if (isHScreen) this.Canvas.lineTo(y,x);
|
|
35903
|
+
else this.Canvas.lineTo(x,y);
|
|
35904
|
+
}
|
|
35905
|
+
|
|
35906
|
+
++drawCount;
|
|
35846
35907
|
}
|
|
35847
35908
|
|
|
35848
|
-
++
|
|
35909
|
+
++pointCount;
|
|
35849
35910
|
|
|
35850
|
-
if (
|
|
35911
|
+
if (pointCount>=minuteCount) //上一天的数据和这天地数据线段要断开
|
|
35851
35912
|
{
|
|
35852
35913
|
bFirstPoint=true;
|
|
35853
|
-
|
|
35914
|
+
pointCount=0;
|
|
35915
|
+
if (drawCount>0) this.Canvas.stroke();
|
|
35854
35916
|
drawCount=0;
|
|
35855
35917
|
}
|
|
35856
35918
|
}
|
|
@@ -35863,24 +35925,46 @@ function ChartOverlayMinutePriceLine()
|
|
|
35863
35925
|
this.GetMaxMin=function()
|
|
35864
35926
|
{
|
|
35865
35927
|
var xPointCount=this.ChartFrame.XPointCount;
|
|
35866
|
-
var range={};
|
|
35928
|
+
var range={ Min:null, Max:null };
|
|
35867
35929
|
if (!this.IsCalcuateMaxMin) return range;
|
|
35868
|
-
if (this.YClose==null) return range;
|
|
35869
35930
|
|
|
35870
|
-
|
|
35871
|
-
|
|
35931
|
+
var minuteCount=this.ChartFrame.MinuteCount;
|
|
35932
|
+
var yClose=null, mainYClose=null;
|
|
35933
|
+
var bFirstPoint=true;
|
|
35934
|
+
var pointCount=0;
|
|
35872
35935
|
for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length && j<xPointCount;++i,++j)
|
|
35873
35936
|
{
|
|
35874
|
-
var
|
|
35875
|
-
if (
|
|
35937
|
+
var item=this.Data.Data[i];
|
|
35938
|
+
if (!item || !IFrameSplitOperator.IsNumber(item.Close))
|
|
35939
|
+
{
|
|
35940
|
+
++pointCount;
|
|
35941
|
+
continue;
|
|
35942
|
+
}
|
|
35876
35943
|
|
|
35877
|
-
if (
|
|
35944
|
+
if (bFirstPoint)
|
|
35945
|
+
{
|
|
35946
|
+
yClose=item.YClose;
|
|
35947
|
+
var minItem=this.MainData.Data[i];
|
|
35948
|
+
mainYClose=minItem.YClose;
|
|
35949
|
+
bFirstPoint=false;
|
|
35950
|
+
}
|
|
35951
|
+
|
|
35952
|
+
var value=item.Close;
|
|
35953
|
+
if (this.OverlayType==0) value=value/yClose*mainYClose;
|
|
35878
35954
|
|
|
35879
35955
|
if (range.Max==null) range.Max=value;
|
|
35880
35956
|
if (range.Min==null) range.Min=value;
|
|
35881
35957
|
|
|
35882
35958
|
if (range.Max<value) range.Max=value;
|
|
35883
35959
|
if (range.Min>value) range.Min=value;
|
|
35960
|
+
|
|
35961
|
+
++pointCount;
|
|
35962
|
+
|
|
35963
|
+
if (pointCount>=minuteCount)
|
|
35964
|
+
{
|
|
35965
|
+
bFirstPoint=true;
|
|
35966
|
+
pointCount=0;
|
|
35967
|
+
}
|
|
35884
35968
|
}
|
|
35885
35969
|
|
|
35886
35970
|
//JSConsole.Chart.Log(`[ChartOverlayMinutePriceLine::GetMaxMin] max=${range.Max} min=${range.Min}`);
|
|
@@ -48796,6 +48880,7 @@ function FrameSplitMinuteX()
|
|
|
48796
48880
|
info.Value=item[0];
|
|
48797
48881
|
if (this.ShowText) info.Message[0]=item[3];
|
|
48798
48882
|
if (item[4]) info.LineColor=item[4]; //线段颜色
|
|
48883
|
+
if (item[5]) info.TextBGColor=item[5]; //文字背景色
|
|
48799
48884
|
this.Frame.VerticalInfo[i]=info;
|
|
48800
48885
|
}
|
|
48801
48886
|
}
|
|
@@ -74872,7 +74957,8 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
74872
74957
|
if (moveSetp<5 && yMoveSetp<5) return;
|
|
74873
74958
|
if (!this.EnableSelectRect) return;
|
|
74874
74959
|
|
|
74875
|
-
this.UIElement.style.cursor="default";
|
|
74960
|
+
//this.UIElement.style.cursor="default";
|
|
74961
|
+
this.SetCursor({Cursor:"default"});
|
|
74876
74962
|
var x=drag.Click.X-uielement.getBoundingClientRect().left;
|
|
74877
74963
|
var y=drag.Click.Y-uielement.getBoundingClientRect().top;
|
|
74878
74964
|
var x2=e.clientX-uielement.getBoundingClientRect().left;
|
|
@@ -77008,7 +77094,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
77008
77094
|
//叠加股票
|
|
77009
77095
|
this.OverlaySymbol=function(symbol,option)
|
|
77010
77096
|
{
|
|
77011
|
-
for(var i
|
|
77097
|
+
for(var i=0; i<this.OverlayChartPaint.length; ++i)
|
|
77012
77098
|
{
|
|
77013
77099
|
var item=this.OverlayChartPaint[i];
|
|
77014
77100
|
if (item.Symbol==symbol)
|
|
@@ -77028,11 +77114,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
77028
77114
|
if (option && option.Color) paint.Color=option.Color; //外部设置颜色
|
|
77029
77115
|
else paint.Color=g_JSChartResource.OverlaySymbol.Color[g_JSChartResource.OverlaySymbol.Random%g_JSChartResource.OverlaySymbol.Color.length];
|
|
77030
77116
|
++g_JSChartResource.OverlaySymbol.Random;
|
|
77031
|
-
|
|
77032
|
-
{
|
|
77033
|
-
paint.MainData=this.ChartPaint[0].Data;
|
|
77034
|
-
paint.MainYClose=this.ChartPaint[0].YClose;
|
|
77035
|
-
}
|
|
77117
|
+
paint.MainData=this.SourceData; //绑定主图数据
|
|
77036
77118
|
|
|
77037
77119
|
if (paint.SetOption) paint.SetOption(option);
|
|
77038
77120
|
|
|
@@ -78000,7 +78082,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
78000
78082
|
for(var i=0; i<this.OverlayChartPaint.length; ++i)
|
|
78001
78083
|
{
|
|
78002
78084
|
let item=this.OverlayChartPaint[i];
|
|
78003
|
-
if (!item.MainData
|
|
78085
|
+
if (!item.MainData) continue;
|
|
78004
78086
|
if (item.Status!=OVERLAY_STATUS_ID.STATUS_NONE_ID) continue;
|
|
78005
78087
|
var symbol=item.Symbol;
|
|
78006
78088
|
if (!symbol) continue;
|
|
@@ -78061,7 +78143,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
78061
78143
|
for(var j=0; j<this.OverlayChartPaint.length; ++j)
|
|
78062
78144
|
{
|
|
78063
78145
|
var item=this.OverlayChartPaint[j];
|
|
78064
|
-
if (!item.MainData
|
|
78146
|
+
if (!item.MainData) continue;
|
|
78065
78147
|
if (overlayData.symbol==item.Symbol)
|
|
78066
78148
|
{
|
|
78067
78149
|
this.RecvOverlayMinuteData(overlayData, item, { Redraw:false });
|
|
@@ -78222,6 +78304,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
78222
78304
|
{
|
|
78223
78305
|
var empytData=new ChartData();
|
|
78224
78306
|
empytData.Date=item.Date;
|
|
78307
|
+
empytData.Data.length=item.Data.length;
|
|
78225
78308
|
overlayDayData.push(empytData);
|
|
78226
78309
|
}
|
|
78227
78310
|
}
|
|
@@ -78455,11 +78538,10 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
78455
78538
|
this.ExtendChartPaint[0].Name=this.Name;
|
|
78456
78539
|
}
|
|
78457
78540
|
|
|
78458
|
-
for(var i
|
|
78541
|
+
for(var i=0; i<this.OverlayChartPaint.length; ++i)
|
|
78459
78542
|
{
|
|
78460
78543
|
var item=this.OverlayChartPaint[i];
|
|
78461
|
-
item.MainData=
|
|
78462
|
-
item.MainYClose=yClose;
|
|
78544
|
+
item.MainData=minuteData; //绑定主图数据
|
|
78463
78545
|
}
|
|
78464
78546
|
}
|
|
78465
78547
|
|
|
@@ -89818,7 +89900,7 @@ function MinuteCoordinateData()
|
|
|
89818
89900
|
{
|
|
89819
89901
|
Full: //完整模式
|
|
89820
89902
|
[
|
|
89821
|
-
[0, 0, "rgb(200,200,200)", "09:30"], //[0]=索引 [1]=线段类型 [2]=文字颜色(弃用) [3]=刻度文字 [4]=线段颜色
|
|
89903
|
+
[0, 0, "rgb(200,200,200)", "09:30"], //[0]=索引 [1]=线段类型 [2]=文字颜色(弃用) [3]=刻度文字 [4]=线段颜色 [5]=背景色
|
|
89822
89904
|
[31, 0, "RGB(200,200,200)", "10:00"],
|
|
89823
89905
|
[61, 0, "RGB(200,200,200)", "10:30"],
|
|
89824
89906
|
[91, 0, "RGB(200,200,200)", "11:00"],
|
|
@@ -102245,6 +102327,36 @@ function JSDraw(errorHandler,symbolData)
|
|
|
102245
102327
|
return result;
|
|
102246
102328
|
}
|
|
102247
102329
|
|
|
102330
|
+
//叠加一个K线
|
|
102331
|
+
this.DRAWOVERLAYKLINE=function(open, high, low, close)
|
|
102332
|
+
{
|
|
102333
|
+
var drawData=[];
|
|
102334
|
+
var result={DrawData:drawData, DrawType:'DRAWOVERLAYKLINE'};
|
|
102335
|
+
var count=Math.max(high.length, open.length,low.length,close.length);
|
|
102336
|
+
|
|
102337
|
+
var kData=this.SymbolData.Data.Data;
|
|
102338
|
+
for(var i=0;i<count;++i)
|
|
102339
|
+
{
|
|
102340
|
+
var item={Open:null,High:null, Low:null, Close:null};
|
|
102341
|
+
var kItem=kData[i];
|
|
102342
|
+
if (i<high.length && i<open.length && i<low.length && i<close.length &&
|
|
102343
|
+
IFrameSplitOperator.IsNumber(open[i]) && IFrameSplitOperator.IsNumber(high[i]) && IFrameSplitOperator.IsNumber(low[i]) && IFrameSplitOperator.IsNumber(low[i]))
|
|
102344
|
+
{
|
|
102345
|
+
|
|
102346
|
+
item.Open=open[i];
|
|
102347
|
+
item.High=high[i];
|
|
102348
|
+
item.Low=low[i];
|
|
102349
|
+
item.Close=close[i];
|
|
102350
|
+
item.Date=kItem.Date;
|
|
102351
|
+
if (IFrameSplitOperator.IsNumber(kItem.Time)) item.Time=kItem.Time;
|
|
102352
|
+
}
|
|
102353
|
+
|
|
102354
|
+
drawData[i]=item;
|
|
102355
|
+
}
|
|
102356
|
+
|
|
102357
|
+
return result;
|
|
102358
|
+
}
|
|
102359
|
+
|
|
102248
102360
|
/*
|
|
102249
102361
|
DRAWCOLORKLINE 绘制K线
|
|
102250
102362
|
用法:
|
|
@@ -103752,7 +103864,7 @@ JSDraw.prototype.IsDrawFunction=function(name)
|
|
|
103752
103864
|
{
|
|
103753
103865
|
let setFunctionName=new Set(
|
|
103754
103866
|
[
|
|
103755
|
-
"STICKLINE","DRAWTEXT",'SUPERDRAWTEXT','DRAWLINE','DRAWBAND','DRAWKLINE',"DRAWKLINE1",'DRAWKLINE_IF',"DRAWCOLORKLINE",'PLOYLINE',
|
|
103867
|
+
"STICKLINE","DRAWTEXT",'SUPERDRAWTEXT','DRAWLINE','DRAWBAND','DRAWKLINE',"DRAWKLINE1",'DRAWKLINE_IF',"DRAWCOLORKLINE",'PLOYLINE',"DRAWOVERLAYKLINE",
|
|
103756
103868
|
'POLYLINE','DRAWNUMBER',"DRAWNUMBER_FIX",'DRAWICON','DRAWCHANNEL','PARTLINE','DRAWTEXT_FIX','DRAWGBK','DRAWTEXT_LINE','DRAWRECTREL',"DRAWTEXTABS","DRAWTEXTREL",
|
|
103757
103869
|
'DRAWOVERLAYLINE',"FILLRGN", "FILLRGN2","FILLTOPRGN", "FILLBOTTOMRGN", "FILLVERTICALRGN","FLOATRGN","DRAWSL", "DRAWGBK2","DRAWGBK_DIV",
|
|
103758
103870
|
"VERTLINE","HORLINE","TIPICON"
|
|
@@ -110036,6 +110148,10 @@ function JSExecute(ast,option)
|
|
|
110036
110148
|
node.Draw=this.Draw.DRAWKLINE_IF(args[0],args[1],args[2],args[3],args[4]);
|
|
110037
110149
|
node.Out=[];
|
|
110038
110150
|
break;
|
|
110151
|
+
case "DRAWOVERLAYKLINE":
|
|
110152
|
+
node.Draw=this.Draw.DRAWOVERLAYKLINE(args[0],args[1],args[2],args[3]);
|
|
110153
|
+
node.Out=[];
|
|
110154
|
+
break;
|
|
110039
110155
|
case "DRAWCOLORKLINE":
|
|
110040
110156
|
node.Draw=this.Draw.DRAWCOLORKLINE(args[0],args[1],args[2]);
|
|
110041
110157
|
node.Out=[];
|
|
@@ -112657,6 +112773,28 @@ function ScriptIndex(name,script,args,option)
|
|
|
112657
112773
|
hqChart.ChartPaint.push(chart);
|
|
112658
112774
|
}
|
|
112659
112775
|
|
|
112776
|
+
this.CreateOverlayKLine=function(hqChart,windowIndex,varItem,id)
|
|
112777
|
+
{
|
|
112778
|
+
var chart=null;
|
|
112779
|
+
if (hqChart.IsKLineContainer()) chart=new ChartOverlayKLine();
|
|
112780
|
+
else if (hqChart.IsMinuteContainer()) chart=new ChartOverlayMinutePriceLine();
|
|
112781
|
+
else return;
|
|
112782
|
+
|
|
112783
|
+
chart.Canvas=hqChart.Canvas;
|
|
112784
|
+
chart.Name=varItem.Name;
|
|
112785
|
+
chart.Identify=this.Guid;
|
|
112786
|
+
chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;
|
|
112787
|
+
chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;
|
|
112788
|
+
|
|
112789
|
+
if (varItem.Color) chart.Color=this.GetColor(varItem.Color); //如果设置了颜色,使用外面设置的颜色
|
|
112790
|
+
else chart.Color=this.GetDefaultColor(id);
|
|
112791
|
+
|
|
112792
|
+
chart.Data.Data=varItem.Draw.DrawData;
|
|
112793
|
+
chart.MainData=hqChart.ChartPaint[0].Data;//绑定K线
|
|
112794
|
+
|
|
112795
|
+
hqChart.ChartPaint.push(chart);
|
|
112796
|
+
}
|
|
112797
|
+
|
|
112660
112798
|
this.CreateDrawColorKLine=function(hqChart,windowIndex,varItem,i)
|
|
112661
112799
|
{
|
|
112662
112800
|
let chart=new ChartColorKline();
|
|
@@ -113497,6 +113635,9 @@ function ScriptIndex(name,script,args,option)
|
|
|
113497
113635
|
case "DRAWKLINE1":
|
|
113498
113636
|
this.CreateKLine(hqChart,windowIndex,item,i);
|
|
113499
113637
|
break;
|
|
113638
|
+
case "DRAWOVERLAYKLINE":
|
|
113639
|
+
this.CreateOverlayKLine(hqChart,windowIndex,item,i);
|
|
113640
|
+
break;
|
|
113500
113641
|
case "DRAWCOLORKLINE":
|
|
113501
113642
|
this.CreateDrawColorKLine(hqChart,windowIndex,item,i);
|
|
113502
113643
|
break;
|
|
@@ -128475,7 +128616,7 @@ function HQChartScriptWorker()
|
|
|
128475
128616
|
|
|
128476
128617
|
|
|
128477
128618
|
|
|
128478
|
-
var HQCHART_VERSION="1.1.
|
|
128619
|
+
var HQCHART_VERSION="1.1.12515";
|
|
128479
128620
|
|
|
128480
128621
|
function PrintHQChartVersion()
|
|
128481
128622
|
{
|
|
@@ -8574,7 +8574,7 @@ function JSDraw(errorHandler, symbolData)
|
|
|
8574
8574
|
例如:
|
|
8575
8575
|
DRAWICON(CLOSE>OPEN,LOW,1)表示当收阳时在最低价位置画1号图标.
|
|
8576
8576
|
*/
|
|
8577
|
-
this.DRAWICON = function (condition, data, type)
|
|
8577
|
+
this.DRAWICON = function (condition, data, type, markID)
|
|
8578
8578
|
{
|
|
8579
8579
|
if (IFrameSplitOperator.IsString(type)) //把ICO1=>1
|
|
8580
8580
|
{
|
|
@@ -8586,6 +8586,7 @@ function JSDraw(errorHandler, symbolData)
|
|
|
8586
8586
|
if (!icon) icon = { Symbol: '●', Color: 'rgb(0,139,69)'};
|
|
8587
8587
|
let drawData = [];
|
|
8588
8588
|
let result = { DrawData: drawData, DrawType: 'DRAWICON', Icon: icon , IconID:type};
|
|
8589
|
+
if (markID) result.MarkID=markID;
|
|
8589
8590
|
if (condition.length <= 0) return result;
|
|
8590
8591
|
|
|
8591
8592
|
var IsNumber = typeof (data) == "number";
|
|
@@ -13254,7 +13255,7 @@ function JSExecute(ast,option)
|
|
|
13254
13255
|
node.Out=[];
|
|
13255
13256
|
break;
|
|
13256
13257
|
case 'DRAWICON':
|
|
13257
|
-
node.Draw = this.Draw.DRAWICON(args[0], args[1], args[2]);
|
|
13258
|
+
node.Draw = this.Draw.DRAWICON(args[0], args[1], args[2], args[3]);
|
|
13258
13259
|
node.Out = [];
|
|
13259
13260
|
break;
|
|
13260
13261
|
case "ICON":
|