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
|
@@ -9568,6 +9568,36 @@ function JSDraw(errorHandler,symbolData)
|
|
|
9568
9568
|
return result;
|
|
9569
9569
|
}
|
|
9570
9570
|
|
|
9571
|
+
//叠加一个K线
|
|
9572
|
+
this.DRAWOVERLAYKLINE=function(open, high, low, close)
|
|
9573
|
+
{
|
|
9574
|
+
var drawData=[];
|
|
9575
|
+
var result={DrawData:drawData, DrawType:'DRAWOVERLAYKLINE'};
|
|
9576
|
+
var count=Math.max(high.length, open.length,low.length,close.length);
|
|
9577
|
+
|
|
9578
|
+
var kData=this.SymbolData.Data.Data;
|
|
9579
|
+
for(var i=0;i<count;++i)
|
|
9580
|
+
{
|
|
9581
|
+
var item={Open:null,High:null, Low:null, Close:null};
|
|
9582
|
+
var kItem=kData[i];
|
|
9583
|
+
if (i<high.length && i<open.length && i<low.length && i<close.length &&
|
|
9584
|
+
IFrameSplitOperator.IsNumber(open[i]) && IFrameSplitOperator.IsNumber(high[i]) && IFrameSplitOperator.IsNumber(low[i]) && IFrameSplitOperator.IsNumber(low[i]))
|
|
9585
|
+
{
|
|
9586
|
+
|
|
9587
|
+
item.Open=open[i];
|
|
9588
|
+
item.High=high[i];
|
|
9589
|
+
item.Low=low[i];
|
|
9590
|
+
item.Close=close[i];
|
|
9591
|
+
item.Date=kItem.Date;
|
|
9592
|
+
if (IFrameSplitOperator.IsNumber(kItem.Time)) item.Time=kItem.Time;
|
|
9593
|
+
}
|
|
9594
|
+
|
|
9595
|
+
drawData[i]=item;
|
|
9596
|
+
}
|
|
9597
|
+
|
|
9598
|
+
return result;
|
|
9599
|
+
}
|
|
9600
|
+
|
|
9571
9601
|
/*
|
|
9572
9602
|
DRAWCOLORKLINE 绘制K线
|
|
9573
9603
|
用法:
|
|
@@ -11075,7 +11105,7 @@ JSDraw.prototype.IsDrawFunction=function(name)
|
|
|
11075
11105
|
{
|
|
11076
11106
|
let setFunctionName=new Set(
|
|
11077
11107
|
[
|
|
11078
|
-
"STICKLINE","DRAWTEXT",'SUPERDRAWTEXT','DRAWLINE','DRAWBAND','DRAWKLINE',"DRAWKLINE1",'DRAWKLINE_IF',"DRAWCOLORKLINE",'PLOYLINE',
|
|
11108
|
+
"STICKLINE","DRAWTEXT",'SUPERDRAWTEXT','DRAWLINE','DRAWBAND','DRAWKLINE',"DRAWKLINE1",'DRAWKLINE_IF',"DRAWCOLORKLINE",'PLOYLINE',"DRAWOVERLAYKLINE",
|
|
11079
11109
|
'POLYLINE','DRAWNUMBER',"DRAWNUMBER_FIX",'DRAWICON','DRAWCHANNEL','PARTLINE','DRAWTEXT_FIX','DRAWGBK','DRAWTEXT_LINE','DRAWRECTREL',"DRAWTEXTABS","DRAWTEXTREL",
|
|
11080
11110
|
'DRAWOVERLAYLINE',"FILLRGN", "FILLRGN2","FILLTOPRGN", "FILLBOTTOMRGN", "FILLVERTICALRGN","FLOATRGN","DRAWSL", "DRAWGBK2","DRAWGBK_DIV",
|
|
11081
11111
|
"VERTLINE","HORLINE","TIPICON"
|
|
@@ -17359,6 +17389,10 @@ function JSExecute(ast,option)
|
|
|
17359
17389
|
node.Draw=this.Draw.DRAWKLINE_IF(args[0],args[1],args[2],args[3],args[4]);
|
|
17360
17390
|
node.Out=[];
|
|
17361
17391
|
break;
|
|
17392
|
+
case "DRAWOVERLAYKLINE":
|
|
17393
|
+
node.Draw=this.Draw.DRAWOVERLAYKLINE(args[0],args[1],args[2],args[3]);
|
|
17394
|
+
node.Out=[];
|
|
17395
|
+
break;
|
|
17362
17396
|
case "DRAWCOLORKLINE":
|
|
17363
17397
|
node.Draw=this.Draw.DRAWCOLORKLINE(args[0],args[1],args[2]);
|
|
17364
17398
|
node.Out=[];
|
|
@@ -19980,6 +20014,28 @@ function ScriptIndex(name,script,args,option)
|
|
|
19980
20014
|
hqChart.ChartPaint.push(chart);
|
|
19981
20015
|
}
|
|
19982
20016
|
|
|
20017
|
+
this.CreateOverlayKLine=function(hqChart,windowIndex,varItem,id)
|
|
20018
|
+
{
|
|
20019
|
+
var chart=null;
|
|
20020
|
+
if (hqChart.IsKLineContainer()) chart=new ChartOverlayKLine();
|
|
20021
|
+
else if (hqChart.IsMinuteContainer()) chart=new ChartOverlayMinutePriceLine();
|
|
20022
|
+
else return;
|
|
20023
|
+
|
|
20024
|
+
chart.Canvas=hqChart.Canvas;
|
|
20025
|
+
chart.Name=varItem.Name;
|
|
20026
|
+
chart.Identify=this.Guid;
|
|
20027
|
+
chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;
|
|
20028
|
+
chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;
|
|
20029
|
+
|
|
20030
|
+
if (varItem.Color) chart.Color=this.GetColor(varItem.Color); //如果设置了颜色,使用外面设置的颜色
|
|
20031
|
+
else chart.Color=this.GetDefaultColor(id);
|
|
20032
|
+
|
|
20033
|
+
chart.Data.Data=varItem.Draw.DrawData;
|
|
20034
|
+
chart.MainData=hqChart.ChartPaint[0].Data;//绑定K线
|
|
20035
|
+
|
|
20036
|
+
hqChart.ChartPaint.push(chart);
|
|
20037
|
+
}
|
|
20038
|
+
|
|
19983
20039
|
this.CreateDrawColorKLine=function(hqChart,windowIndex,varItem,i)
|
|
19984
20040
|
{
|
|
19985
20041
|
let chart=new ChartColorKline();
|
|
@@ -20820,6 +20876,9 @@ function ScriptIndex(name,script,args,option)
|
|
|
20820
20876
|
case "DRAWKLINE1":
|
|
20821
20877
|
this.CreateKLine(hqChart,windowIndex,item,i);
|
|
20822
20878
|
break;
|
|
20879
|
+
case "DRAWOVERLAYKLINE":
|
|
20880
|
+
this.CreateOverlayKLine(hqChart,windowIndex,item,i);
|
|
20881
|
+
break;
|
|
20823
20882
|
case "DRAWCOLORKLINE":
|
|
20824
20883
|
this.CreateDrawColorKLine(hqChart,windowIndex,item,i);
|
|
20825
20884
|
break;
|
package/src/jscommon/umychart.js
CHANGED
|
@@ -1588,6 +1588,7 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
1588
1588
|
|
|
1589
1589
|
this.JSChartContainer=chart;
|
|
1590
1590
|
|
|
1591
|
+
if (option.DefaultCursor) chart.DefaultCursor=option.DefaultCursor;
|
|
1591
1592
|
if (option.OnCreatedCallback) option.OnCreatedCallback(chart);
|
|
1592
1593
|
|
|
1593
1594
|
//是否自动更新
|
|
@@ -2693,6 +2694,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
2693
2694
|
this.IsClickShowCorssCursor=false; //手势点击显示十字光标
|
|
2694
2695
|
this.ChartSplashPaint=null; //等待提示
|
|
2695
2696
|
this.LoadDataSplashTitle="数据加载中"; //下载数据提示信息
|
|
2697
|
+
this.DefaultCursor="default"; //crosshair , default 默认手型
|
|
2696
2698
|
|
|
2697
2699
|
//绘图缓存
|
|
2698
2700
|
this.CacheCanvas=null;
|
|
@@ -3172,7 +3174,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
3172
3174
|
event.Callback(event, sendData, this);
|
|
3173
3175
|
this.CustomChartDrag=sendData.ChartDrag;
|
|
3174
3176
|
|
|
3175
|
-
|
|
3177
|
+
this.SetCursor(sendData);
|
|
3176
3178
|
}
|
|
3177
3179
|
|
|
3178
3180
|
this.TryDragMove_CustomChartDrag=function(sendData)
|
|
@@ -3251,7 +3253,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
3251
3253
|
{
|
|
3252
3254
|
if (item.Type==4)
|
|
3253
3255
|
{
|
|
3254
|
-
this.UIElement.style.cursor="pointer";
|
|
3256
|
+
//this.UIElement.style.cursor="pointer";
|
|
3257
|
+
this.SetCursor({Cursor:"pointer"});
|
|
3255
3258
|
var obj={ X:e.clientX };
|
|
3256
3259
|
if (this.GetXDataIndex(obj))
|
|
3257
3260
|
{
|
|
@@ -3261,7 +3264,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
3261
3264
|
}
|
|
3262
3265
|
else
|
|
3263
3266
|
{
|
|
3264
|
-
this.UIElement.style.cursor="ew-resize";
|
|
3267
|
+
//this.UIElement.style.cursor="ew-resize";
|
|
3268
|
+
this.SetCursor({Cursor:"ew-resize"});
|
|
3265
3269
|
this.RectSelectDrag={ Index:item.PointIndex, Type:item.Type };
|
|
3266
3270
|
JSConsole.Chart.Log("[JSChartContainer::UIOnMouseDown] drag rect select ",item);
|
|
3267
3271
|
}
|
|
@@ -3275,7 +3279,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
3275
3279
|
var dragBorder=this.Frame.PtInFrameBorder(x,y);
|
|
3276
3280
|
if (dragBorder && dragBorder.Index>=0)
|
|
3277
3281
|
{
|
|
3278
|
-
this.UIElement.style.cursor="n-resize";
|
|
3282
|
+
//this.UIElement.style.cursor="n-resize";
|
|
3283
|
+
this.SetCursor({Cursor:"n-resize"});
|
|
3279
3284
|
this.BorderDrag={ Index:dragBorder.Index };
|
|
3280
3285
|
JSConsole.Chart.Log("[JSChartContainer::UIOnMouseDown] DragBorder ",dragBorder);
|
|
3281
3286
|
}
|
|
@@ -3287,7 +3292,9 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
3287
3292
|
var dragY=this.TryYDrag(x,y);
|
|
3288
3293
|
if (dragY)
|
|
3289
3294
|
{
|
|
3290
|
-
this.UIElement.style.cursor=dragY.Position==0 ? "n-resize":"row-resize";
|
|
3295
|
+
//this.UIElement.style.cursor=dragY.Position==0 ? "n-resize":"row-resize";
|
|
3296
|
+
var cursor=dragY.Position==0 ? "n-resize":"row-resize";
|
|
3297
|
+
this.SetCursor({Cursor:cursor});
|
|
3291
3298
|
this.YDrag=dragY;
|
|
3292
3299
|
JSConsole.Chart.Log("[JSChartContainer::UIOnMouseDown] dragY ",dragY);
|
|
3293
3300
|
}
|
|
@@ -3296,7 +3303,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
3296
3303
|
var dragUpDown=this.TryUpDownDrag(x,y);
|
|
3297
3304
|
if (dragUpDown)
|
|
3298
3305
|
{
|
|
3299
|
-
this.UIElement.style.cursor="pointer";
|
|
3306
|
+
//this.UIElement.style.cursor="pointer";
|
|
3307
|
+
this.SetCursor({Cursor:"pointer"});
|
|
3300
3308
|
this.UpDownDrag=dragUpDown;
|
|
3301
3309
|
JSConsole.Chart.Log("[JSChartContainer::UIOnMouseDown] dragUpDown ",dragUpDown);
|
|
3302
3310
|
}
|
|
@@ -3619,8 +3627,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
3619
3627
|
|
|
3620
3628
|
if (moveSetp<5 && yMoveSetp<5) return;
|
|
3621
3629
|
|
|
3622
|
-
this.UIElement.style.cursor="default";
|
|
3623
|
-
|
|
3630
|
+
//this.UIElement.style.cursor="default";
|
|
3631
|
+
this.SetCursor({Cursor:"default"});
|
|
3624
3632
|
var x=drag.Click.X-uielement.getBoundingClientRect().left;
|
|
3625
3633
|
var y=drag.Click.Y-uielement.getBoundingClientRect().top;
|
|
3626
3634
|
var x2=e.clientX-uielement.getBoundingClientRect().left;
|
|
@@ -3649,7 +3657,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
3649
3657
|
{
|
|
3650
3658
|
var yMove=e.clientY-drag.LastMove.Y;
|
|
3651
3659
|
JSConsole.Chart.Log("[JSChartContainer::OnDragMode_One] UpDownDrag ",this.UpDownDrag,yMove);
|
|
3652
|
-
this.UIElement.style.cursor="pointer";
|
|
3660
|
+
//this.UIElement.style.cursor="pointer";
|
|
3661
|
+
this.SetCursor({Cursor:"pointer"});
|
|
3653
3662
|
if (this.OnUpDonwFrameY(this.UpDownDrag, yMove))
|
|
3654
3663
|
{
|
|
3655
3664
|
bNeedDraw=true;
|
|
@@ -3696,7 +3705,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
3696
3705
|
var oneStepWidth=this.GetMoveOneStepWidth();
|
|
3697
3706
|
if (moveSetp<oneStepWidth)
|
|
3698
3707
|
{
|
|
3699
|
-
this.UIElement.style.cursor=cursorStatus;
|
|
3708
|
+
//this.UIElement.style.cursor=cursorStatus;
|
|
3709
|
+
this.SetCursor({Cursor:cursorStatus});
|
|
3700
3710
|
if (bNeedDraw) this.Draw();
|
|
3701
3711
|
return;
|
|
3702
3712
|
}
|
|
@@ -3726,7 +3736,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
3726
3736
|
if (this.DragDownloadData) this.DragDownloadData();
|
|
3727
3737
|
}
|
|
3728
3738
|
}
|
|
3729
|
-
this.UIElement.style.cursor=cursorStatus;
|
|
3739
|
+
//this.UIElement.style.cursor=cursorStatus;
|
|
3740
|
+
this.SetCursor({Cursor:cursorStatus});
|
|
3730
3741
|
}
|
|
3731
3742
|
drag.LastMove.X=e.clientX;
|
|
3732
3743
|
}
|
|
@@ -3794,7 +3805,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
3794
3805
|
var chartMove=this.GetExtendChartByClassName("DragMovePaint");
|
|
3795
3806
|
if (chartMove && chartMove.Chart) chartMove.Chart.Clear();
|
|
3796
3807
|
if (!this.OnDragChart(this.IndexChartDrag)) this.DrawDynamicInfo();
|
|
3797
|
-
this.UIElement.style.cursor="default";
|
|
3808
|
+
//this.UIElement.style.cursor="default";
|
|
3809
|
+
this.SetCursor({Cursor:"default"});
|
|
3798
3810
|
}
|
|
3799
3811
|
else if (this.CustomChartDrag)
|
|
3800
3812
|
{
|
|
@@ -3884,7 +3896,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
3884
3896
|
//清空数据
|
|
3885
3897
|
JSConsole.Chart.Log('[KLineChartContainer::document.onmouseup]',e);
|
|
3886
3898
|
if (this.SelectChartDrawPicture) this.SelectChartDrawPicture.DragInfo=null;
|
|
3887
|
-
this.UIElement.style.cursor="default";
|
|
3899
|
+
//this.UIElement.style.cursor="default";
|
|
3900
|
+
this.SetCursor({Cursor:"default"});
|
|
3888
3901
|
this.MouseDrag=null;
|
|
3889
3902
|
this.ClickDownPoint=null;
|
|
3890
3903
|
this.IsOnTouch=false;
|
|
@@ -5719,7 +5732,6 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
5719
5732
|
var frameID=this.Frame.PtInFrame(x,y);
|
|
5720
5733
|
if (IFrameSplitOperator.IsNumber(frameID) && frameID>=0) //在K线内部移动,调整K线索引
|
|
5721
5734
|
this.CursorIndex=this.Frame.GetXData(x);
|
|
5722
|
-
|
|
5723
5735
|
|
|
5724
5736
|
|
|
5725
5737
|
if (this.EnableBorderDrag && this.Frame && !this.CurrentChartDrawPicture)
|
|
@@ -5842,13 +5854,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
5842
5854
|
|
|
5843
5855
|
if (drawPictrueData.PointIndex===100)
|
|
5844
5856
|
{
|
|
5845
|
-
if (drawPictrueData.Cursor) this.UIElement.style.cursor=drawPictrueData.Cursor;
|
|
5846
|
-
else this.UIElement.style.cursor="move";
|
|
5857
|
+
if (drawPictrueData.Cursor) this.SetCursor(drawPictrueData); //this.UIElement.style.cursor=drawPictrueData.Cursor;
|
|
5858
|
+
else this.SetCursor({Cursor:"move"}); //this.UIElement.style.cursor="move";
|
|
5847
5859
|
}
|
|
5848
5860
|
else
|
|
5849
5861
|
{
|
|
5850
|
-
if (drawPictrueData.Cursor) this.UIElement.style.cursor=drawPictrueData.Cursor
|
|
5851
|
-
else this.UIElement.style.cursor="pointer";
|
|
5862
|
+
if (drawPictrueData.Cursor) this.SetCursor(drawPictrueData); //this.UIElement.style.cursor=drawPictrueData.Cursor
|
|
5863
|
+
else this.SetCursor({Cursor:"pointer"}); //this.UIElement.style.cursor="pointer";
|
|
5852
5864
|
}
|
|
5853
5865
|
|
|
5854
5866
|
bDrawPicture=true;
|
|
@@ -5856,7 +5868,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
5856
5868
|
}
|
|
5857
5869
|
else
|
|
5858
5870
|
{
|
|
5859
|
-
if (!this.MouseDrag) this.UIElement.style.cursor="default";
|
|
5871
|
+
if (!this.MouseDrag) this.SetCursor({Cursor:"default"}); //this.UIElement.style.cursor="default";
|
|
5860
5872
|
}
|
|
5861
5873
|
}
|
|
5862
5874
|
|
|
@@ -5879,7 +5891,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
5879
5891
|
this.DrawDynamicInfo(option);
|
|
5880
5892
|
}
|
|
5881
5893
|
|
|
5882
|
-
|
|
5894
|
+
this.SetCursor(mouseStatus);
|
|
5883
5895
|
|
|
5884
5896
|
if (this.IsShowTooltip && bDrawPicture==false)
|
|
5885
5897
|
{
|
|
@@ -5907,6 +5919,17 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
5907
5919
|
}
|
|
5908
5920
|
}
|
|
5909
5921
|
|
|
5922
|
+
//设置鼠标形状 {Cursor:鼠标形状 }
|
|
5923
|
+
this.SetCursor=function(obj)
|
|
5924
|
+
{
|
|
5925
|
+
if (!obj || !obj.Cursor) return;
|
|
5926
|
+
|
|
5927
|
+
if (obj.Cursor=="default")
|
|
5928
|
+
this.UIElement.style.cursor=this.DefaultCursor;
|
|
5929
|
+
else
|
|
5930
|
+
this.UIElement.style.cursor=obj.Cursor;
|
|
5931
|
+
}
|
|
5932
|
+
|
|
5910
5933
|
this.OnKeyDown=function(e)
|
|
5911
5934
|
{
|
|
5912
5935
|
if (this.ChartSplashPaint && this.ChartSplashPaint.IsEnableSplash == true) return;
|
|
@@ -6290,6 +6313,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
6290
6313
|
return false;
|
|
6291
6314
|
}
|
|
6292
6315
|
|
|
6316
|
+
this.IsMinuteContainer=function()
|
|
6317
|
+
{
|
|
6318
|
+
if (this.ClassName=="MinuteChartContainer" || this.ClassName=="MinuteChartHScreenContainer") return true;
|
|
6319
|
+
|
|
6320
|
+
return false;
|
|
6321
|
+
}
|
|
6322
|
+
|
|
6293
6323
|
this.UpdatePointByCursorIndex=function(type) //type 1=根据十字光标更新 2=强制取消十字光标
|
|
6294
6324
|
{
|
|
6295
6325
|
var pt={X:null, Y:null};
|
|
@@ -8653,6 +8683,7 @@ function CoordinateInfo()
|
|
|
8653
8683
|
this.Value; //坐标数据
|
|
8654
8684
|
this.Message=[]; //坐标输出文字信息 0=左 1=右 2=内左 3=内右
|
|
8655
8685
|
this.TextColor=g_JSChartResource.FrameSplitTextColor //文字颜色
|
|
8686
|
+
this.TextBGColor; //文字背景色
|
|
8656
8687
|
this.TextColor2; //右侧文字颜色,空使用TextColor
|
|
8657
8688
|
this.Font=g_JSChartResource.FrameSplitTextFont; //字体
|
|
8658
8689
|
this.LineColor=g_JSChartResource.FrameSplitPen; //线段颜色
|
|
@@ -10165,9 +10196,10 @@ function AverageWidthFrame()
|
|
|
10165
10196
|
this.Canvas.font=this.VerticalInfo[i].Font;
|
|
10166
10197
|
|
|
10167
10198
|
var textLeft=0;
|
|
10168
|
-
|
|
10199
|
+
|
|
10169
10200
|
this.Canvas.strokeStyle=item.TextColor;
|
|
10170
10201
|
var testWidth=this.Canvas.measureText(this.VerticalInfo[i].Message[0]).width;
|
|
10202
|
+
var textHeight=this.Canvas.measureText("擎").width;
|
|
10171
10203
|
if (x<testWidth/2)
|
|
10172
10204
|
{
|
|
10173
10205
|
this.Canvas.textAlign="left";
|
|
@@ -10201,6 +10233,15 @@ function AverageWidthFrame()
|
|
|
10201
10233
|
yText+=lineLength+2*pixelRatio;
|
|
10202
10234
|
}
|
|
10203
10235
|
|
|
10236
|
+
//item.TextBGColor="rgb(0,255,0)";
|
|
10237
|
+
if (item.TextBGColor) //文字背景色
|
|
10238
|
+
{
|
|
10239
|
+
var rtText={ Left:textLeft, Top:yText+this.XBottomOffset, Width:testWidth, Height:textHeight };
|
|
10240
|
+
this.Canvas.fillStyle=item.TextBGColor;
|
|
10241
|
+
this.Canvas.fillRect(rtText.Left-1, rtText.Top, rtText.Width+2, rtText.Height);
|
|
10242
|
+
}
|
|
10243
|
+
|
|
10244
|
+
this.Canvas.fillStyle=item.TextColor;
|
|
10204
10245
|
this.Canvas.fillText(this.VerticalInfo[i].Message[0],x,yText+this.XBottomOffset);
|
|
10205
10246
|
textRightPrev=textLeft+testWidth;
|
|
10206
10247
|
}
|
|
@@ -20865,9 +20906,12 @@ function IChartPainting()
|
|
|
20865
20906
|
}
|
|
20866
20907
|
else if (valueType==3)
|
|
20867
20908
|
{
|
|
20868
|
-
var
|
|
20869
|
-
|
|
20870
|
-
|
|
20909
|
+
var minItem=this.Data.Data[i];
|
|
20910
|
+
var mainItem=this.MainData.Data[i];
|
|
20911
|
+
if (!minItem || !IFrameSplitOperator.IsNumber(minItem.Close) || !IFrameSplitOperator.IsNumber(minItem.YClose)) continue;
|
|
20912
|
+
if (!mainItem || !IFrameSplitOperator.IsNumber(mainItem.Close) || !IFrameSplitOperator.IsNumber(mainItem.YClose)) continue;
|
|
20913
|
+
var price=minItem.Close;
|
|
20914
|
+
var value=price/minItem.YClose*mainItem.YClose;
|
|
20871
20915
|
}
|
|
20872
20916
|
else if (valueType==4)
|
|
20873
20917
|
{
|
|
@@ -20987,9 +21031,12 @@ function IChartPainting()
|
|
|
20987
21031
|
}
|
|
20988
21032
|
else if (valueType==3)
|
|
20989
21033
|
{
|
|
20990
|
-
var
|
|
20991
|
-
|
|
20992
|
-
|
|
21034
|
+
var minItem=this.Data.Data[i];
|
|
21035
|
+
var mainItem=this.MainData.Data[i];
|
|
21036
|
+
if (!minItem || !IFrameSplitOperator.IsNumber(minItem.Close) || !IFrameSplitOperator.IsNumber(minItem.YClose)) continue;
|
|
21037
|
+
if (!mainItem || !IFrameSplitOperator.IsNumber(mainItem.Close) || !IFrameSplitOperator.IsNumber(mainItem.YClose)) continue;
|
|
21038
|
+
var price=minItem.Close;
|
|
21039
|
+
var value=price/minItem.YClose*mainItem.YClose;
|
|
20993
21040
|
}
|
|
20994
21041
|
else
|
|
20995
21042
|
{
|
|
@@ -31639,19 +31686,16 @@ function ChartOverlayMinutePriceLine()
|
|
|
31639
31686
|
|
|
31640
31687
|
this.Color="rgb(65,105,225)";
|
|
31641
31688
|
this.MainData; //主图数据
|
|
31642
|
-
this.MainYClose; //主图股票的前收盘价
|
|
31643
31689
|
this.SourceData; //原始数据
|
|
31644
31690
|
|
|
31645
31691
|
this.ClassName="ChartOverlayMinutePriceLine";
|
|
31646
31692
|
this.Title;
|
|
31647
31693
|
this.Symbol; //叠加的股票代码
|
|
31648
|
-
this.YClose; //叠加的股票前收盘
|
|
31649
31694
|
this.Status=OVERLAY_STATUS_ID.STATUS_NONE_ID;
|
|
31650
31695
|
|
|
31651
31696
|
this.OverlayType=0; //叠加方式 0=百分比叠加 1=绝对叠加
|
|
31652
31697
|
this.IsCalcuateMaxMin=true; //是否参与计算Y轴的最大最小值
|
|
31653
31698
|
|
|
31654
|
-
|
|
31655
31699
|
this.SetOption=function(option)
|
|
31656
31700
|
{
|
|
31657
31701
|
if (option)
|
|
@@ -31663,19 +31707,21 @@ function ChartOverlayMinutePriceLine()
|
|
|
31663
31707
|
|
|
31664
31708
|
this.PtInChart=function(x,y)
|
|
31665
31709
|
{
|
|
31666
|
-
var option={ MinuteOverlayPrice:true,
|
|
31710
|
+
var option={ MinuteOverlayPrice:true, OverlayType:this.OverlayType };
|
|
31667
31711
|
return this.PtInLine(x, y, option);
|
|
31668
31712
|
}
|
|
31669
31713
|
|
|
31670
31714
|
this.DrawSelectedStatus=function()
|
|
31671
31715
|
{
|
|
31672
|
-
var option={ MinuteOverlayPrice:true,
|
|
31716
|
+
var option={ MinuteOverlayPrice:true, OverlayType:this.OverlayType };
|
|
31673
31717
|
this.DrawLinePoint(option);
|
|
31674
31718
|
}
|
|
31675
31719
|
|
|
31676
31720
|
this.Draw=function()
|
|
31677
31721
|
{
|
|
31678
31722
|
if (!this.Data) return;
|
|
31723
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data)) return;
|
|
31724
|
+
|
|
31679
31725
|
if (this.NotSupportMessage)
|
|
31680
31726
|
{
|
|
31681
31727
|
this.DrawNotSupportmessage();
|
|
@@ -31696,37 +31742,53 @@ function ChartOverlayMinutePriceLine()
|
|
|
31696
31742
|
var bFirstPoint=true;
|
|
31697
31743
|
var drawCount=0;
|
|
31698
31744
|
var xOffset=0, showValue=0;
|
|
31745
|
+
var yClose=null, mainYClose=null;
|
|
31746
|
+
var pointCount=0;
|
|
31699
31747
|
for(var i=this.Data.DataOffset+xOffset,j=0;i<this.Data.Data.length && j<xPointCount;++i,++j)
|
|
31700
31748
|
{
|
|
31701
|
-
var
|
|
31702
|
-
if (
|
|
31749
|
+
var item=this.Data.Data[i];
|
|
31750
|
+
if (item && IFrameSplitOperator.IsNumber(item.Close))
|
|
31751
|
+
{
|
|
31752
|
+
if (bFirstPoint) //百分比使用每天的昨收计算
|
|
31753
|
+
{
|
|
31754
|
+
yClose=item.YClose;
|
|
31755
|
+
var minItem=this.MainData.Data[i];
|
|
31756
|
+
mainYClose=minItem.YClose;
|
|
31757
|
+
}
|
|
31703
31758
|
|
|
31704
|
-
|
|
31705
|
-
|
|
31759
|
+
var value=item.Close;
|
|
31760
|
+
showValue=value; //绝对叠加
|
|
31706
31761
|
|
|
31707
|
-
|
|
31708
|
-
|
|
31762
|
+
if (this.OverlayType==0)
|
|
31763
|
+
showValue=value/yClose*mainYClose; //百分比
|
|
31709
31764
|
|
|
31710
|
-
|
|
31711
|
-
|
|
31712
|
-
|
|
31713
|
-
|
|
31714
|
-
|
|
31715
|
-
|
|
31716
|
-
|
|
31717
|
-
|
|
31718
|
-
|
|
31719
|
-
|
|
31720
|
-
|
|
31721
|
-
else
|
|
31765
|
+
var x=this.ChartFrame.GetXFromIndex(j);
|
|
31766
|
+
var y=this.ChartFrame.GetYFromData(showValue, false);
|
|
31767
|
+
|
|
31768
|
+
if (bFirstPoint)
|
|
31769
|
+
{
|
|
31770
|
+
this.Canvas.strokeStyle=this.Color;
|
|
31771
|
+
this.Canvas.beginPath();
|
|
31772
|
+
if (isHScreen) this.Canvas.moveTo(y,x);
|
|
31773
|
+
else this.Canvas.moveTo(x,y);
|
|
31774
|
+
bFirstPoint=false;
|
|
31775
|
+
}
|
|
31776
|
+
else
|
|
31777
|
+
{
|
|
31778
|
+
if (isHScreen) this.Canvas.lineTo(y,x);
|
|
31779
|
+
else this.Canvas.lineTo(x,y);
|
|
31780
|
+
}
|
|
31781
|
+
|
|
31782
|
+
++drawCount;
|
|
31722
31783
|
}
|
|
31723
31784
|
|
|
31724
|
-
++
|
|
31785
|
+
++pointCount;
|
|
31725
31786
|
|
|
31726
|
-
if (
|
|
31787
|
+
if (pointCount>=minuteCount) //上一天的数据和这天地数据线段要断开
|
|
31727
31788
|
{
|
|
31728
31789
|
bFirstPoint=true;
|
|
31729
|
-
|
|
31790
|
+
pointCount=0;
|
|
31791
|
+
if (drawCount>0) this.Canvas.stroke();
|
|
31730
31792
|
drawCount=0;
|
|
31731
31793
|
}
|
|
31732
31794
|
}
|
|
@@ -31739,24 +31801,46 @@ function ChartOverlayMinutePriceLine()
|
|
|
31739
31801
|
this.GetMaxMin=function()
|
|
31740
31802
|
{
|
|
31741
31803
|
var xPointCount=this.ChartFrame.XPointCount;
|
|
31742
|
-
var range={};
|
|
31804
|
+
var range={ Min:null, Max:null };
|
|
31743
31805
|
if (!this.IsCalcuateMaxMin) return range;
|
|
31744
|
-
if (this.YClose==null) return range;
|
|
31745
31806
|
|
|
31746
|
-
|
|
31747
|
-
|
|
31807
|
+
var minuteCount=this.ChartFrame.MinuteCount;
|
|
31808
|
+
var yClose=null, mainYClose=null;
|
|
31809
|
+
var bFirstPoint=true;
|
|
31810
|
+
var pointCount=0;
|
|
31748
31811
|
for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length && j<xPointCount;++i,++j)
|
|
31749
31812
|
{
|
|
31750
|
-
var
|
|
31751
|
-
if (
|
|
31813
|
+
var item=this.Data.Data[i];
|
|
31814
|
+
if (!item || !IFrameSplitOperator.IsNumber(item.Close))
|
|
31815
|
+
{
|
|
31816
|
+
++pointCount;
|
|
31817
|
+
continue;
|
|
31818
|
+
}
|
|
31819
|
+
|
|
31820
|
+
if (bFirstPoint)
|
|
31821
|
+
{
|
|
31822
|
+
yClose=item.YClose;
|
|
31823
|
+
var minItem=this.MainData.Data[i];
|
|
31824
|
+
mainYClose=minItem.YClose;
|
|
31825
|
+
bFirstPoint=false;
|
|
31826
|
+
}
|
|
31752
31827
|
|
|
31753
|
-
|
|
31828
|
+
var value=item.Close;
|
|
31829
|
+
if (this.OverlayType==0) value=value/yClose*mainYClose;
|
|
31754
31830
|
|
|
31755
31831
|
if (range.Max==null) range.Max=value;
|
|
31756
31832
|
if (range.Min==null) range.Min=value;
|
|
31757
31833
|
|
|
31758
31834
|
if (range.Max<value) range.Max=value;
|
|
31759
31835
|
if (range.Min>value) range.Min=value;
|
|
31836
|
+
|
|
31837
|
+
++pointCount;
|
|
31838
|
+
|
|
31839
|
+
if (pointCount>=minuteCount)
|
|
31840
|
+
{
|
|
31841
|
+
bFirstPoint=true;
|
|
31842
|
+
pointCount=0;
|
|
31843
|
+
}
|
|
31760
31844
|
}
|
|
31761
31845
|
|
|
31762
31846
|
//JSConsole.Chart.Log(`[ChartOverlayMinutePriceLine::GetMaxMin] max=${range.Max} min=${range.Min}`);
|
|
@@ -44672,6 +44756,7 @@ function FrameSplitMinuteX()
|
|
|
44672
44756
|
info.Value=item[0];
|
|
44673
44757
|
if (this.ShowText) info.Message[0]=item[3];
|
|
44674
44758
|
if (item[4]) info.LineColor=item[4]; //线段颜色
|
|
44759
|
+
if (item[5]) info.TextBGColor=item[5]; //文字背景色
|
|
44675
44760
|
this.Frame.VerticalInfo[i]=info;
|
|
44676
44761
|
}
|
|
44677
44762
|
}
|
|
@@ -70748,7 +70833,8 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
70748
70833
|
if (moveSetp<5 && yMoveSetp<5) return;
|
|
70749
70834
|
if (!this.EnableSelectRect) return;
|
|
70750
70835
|
|
|
70751
|
-
this.UIElement.style.cursor="default";
|
|
70836
|
+
//this.UIElement.style.cursor="default";
|
|
70837
|
+
this.SetCursor({Cursor:"default"});
|
|
70752
70838
|
var x=drag.Click.X-uielement.getBoundingClientRect().left;
|
|
70753
70839
|
var y=drag.Click.Y-uielement.getBoundingClientRect().top;
|
|
70754
70840
|
var x2=e.clientX-uielement.getBoundingClientRect().left;
|
|
@@ -72884,7 +72970,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
72884
72970
|
//叠加股票
|
|
72885
72971
|
this.OverlaySymbol=function(symbol,option)
|
|
72886
72972
|
{
|
|
72887
|
-
for(var i
|
|
72973
|
+
for(var i=0; i<this.OverlayChartPaint.length; ++i)
|
|
72888
72974
|
{
|
|
72889
72975
|
var item=this.OverlayChartPaint[i];
|
|
72890
72976
|
if (item.Symbol==symbol)
|
|
@@ -72904,11 +72990,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
72904
72990
|
if (option && option.Color) paint.Color=option.Color; //外部设置颜色
|
|
72905
72991
|
else paint.Color=g_JSChartResource.OverlaySymbol.Color[g_JSChartResource.OverlaySymbol.Random%g_JSChartResource.OverlaySymbol.Color.length];
|
|
72906
72992
|
++g_JSChartResource.OverlaySymbol.Random;
|
|
72907
|
-
|
|
72908
|
-
{
|
|
72909
|
-
paint.MainData=this.ChartPaint[0].Data;
|
|
72910
|
-
paint.MainYClose=this.ChartPaint[0].YClose;
|
|
72911
|
-
}
|
|
72993
|
+
paint.MainData=this.SourceData; //绑定主图数据
|
|
72912
72994
|
|
|
72913
72995
|
if (paint.SetOption) paint.SetOption(option);
|
|
72914
72996
|
|
|
@@ -73876,7 +73958,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
73876
73958
|
for(var i=0; i<this.OverlayChartPaint.length; ++i)
|
|
73877
73959
|
{
|
|
73878
73960
|
let item=this.OverlayChartPaint[i];
|
|
73879
|
-
if (!item.MainData
|
|
73961
|
+
if (!item.MainData) continue;
|
|
73880
73962
|
if (item.Status!=OVERLAY_STATUS_ID.STATUS_NONE_ID) continue;
|
|
73881
73963
|
var symbol=item.Symbol;
|
|
73882
73964
|
if (!symbol) continue;
|
|
@@ -73937,7 +74019,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
73937
74019
|
for(var j=0; j<this.OverlayChartPaint.length; ++j)
|
|
73938
74020
|
{
|
|
73939
74021
|
var item=this.OverlayChartPaint[j];
|
|
73940
|
-
if (!item.MainData
|
|
74022
|
+
if (!item.MainData) continue;
|
|
73941
74023
|
if (overlayData.symbol==item.Symbol)
|
|
73942
74024
|
{
|
|
73943
74025
|
this.RecvOverlayMinuteData(overlayData, item, { Redraw:false });
|
|
@@ -74098,6 +74180,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
74098
74180
|
{
|
|
74099
74181
|
var empytData=new ChartData();
|
|
74100
74182
|
empytData.Date=item.Date;
|
|
74183
|
+
empytData.Data.length=item.Data.length;
|
|
74101
74184
|
overlayDayData.push(empytData);
|
|
74102
74185
|
}
|
|
74103
74186
|
}
|
|
@@ -74331,11 +74414,10 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
74331
74414
|
this.ExtendChartPaint[0].Name=this.Name;
|
|
74332
74415
|
}
|
|
74333
74416
|
|
|
74334
|
-
for(var i
|
|
74417
|
+
for(var i=0; i<this.OverlayChartPaint.length; ++i)
|
|
74335
74418
|
{
|
|
74336
74419
|
var item=this.OverlayChartPaint[i];
|
|
74337
|
-
item.MainData=
|
|
74338
|
-
item.MainYClose=yClose;
|
|
74420
|
+
item.MainData=minuteData; //绑定主图数据
|
|
74339
74421
|
}
|
|
74340
74422
|
}
|
|
74341
74423
|
|
|
@@ -85694,7 +85776,7 @@ function MinuteCoordinateData()
|
|
|
85694
85776
|
{
|
|
85695
85777
|
Full: //完整模式
|
|
85696
85778
|
[
|
|
85697
|
-
[0, 0, "rgb(200,200,200)", "09:30"], //[0]=索引 [1]=线段类型 [2]=文字颜色(弃用) [3]=刻度文字 [4]=线段颜色
|
|
85779
|
+
[0, 0, "rgb(200,200,200)", "09:30"], //[0]=索引 [1]=线段类型 [2]=文字颜色(弃用) [3]=刻度文字 [4]=线段颜色 [5]=背景色
|
|
85698
85780
|
[31, 0, "RGB(200,200,200)", "10:00"],
|
|
85699
85781
|
[61, 0, "RGB(200,200,200)", "10:30"],
|
|
85700
85782
|
[91, 0, "RGB(200,200,200)", "11:00"],
|
|
@@ -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();
|