hqchart 1.1.12685 → 1.1.12693
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 +101 -55
- package/package.json +1 -1
- package/src/jscommon/umychart.complier.js +3 -1
- package/src/jscommon/umychart.js +402 -109
- package/src/jscommon/umychart.style.js +11 -4
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +417 -115
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.vue.js +417 -115
- package/src/jscommon/umychart.wechat/umychart.chartframe.wechat.js +12 -1
- package/src/jscommon/umychart.wechat/umychart.wechat.3.0.js +4 -0
|
@@ -4777,7 +4777,7 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
4777
4777
|
}
|
|
4778
4778
|
|
|
4779
4779
|
//叠加指标宽度
|
|
4780
|
-
if (option.OverlayIndexFrameWidth>40) chart.
|
|
4780
|
+
if (option.OverlayIndexFrameWidth>40) chart.Frame.FixedRightWidth.Overlay=option.OverlayIndexFrameWidth;
|
|
4781
4781
|
|
|
4782
4782
|
//叠加指标
|
|
4783
4783
|
if (IFrameSplitOperator.IsNonEmptyArray(option.OverlayIndex))
|
|
@@ -6661,7 +6661,9 @@ var JSCHART_EVENT_ID=
|
|
|
6661
6661
|
ON_CUSTOM_DRAG_DOC_MOUSE_UP:115,
|
|
6662
6662
|
ON_CUSTOM_DRAG_MOUSE_MOVE:116,
|
|
6663
6663
|
|
|
6664
|
-
ON_KEYDOWN:117
|
|
6664
|
+
ON_KEYDOWN:117,
|
|
6665
|
+
|
|
6666
|
+
ON_CREATE_OVERLAY_FRAME:118, //创建叠加框架回调
|
|
6665
6667
|
}
|
|
6666
6668
|
|
|
6667
6669
|
var JSCHART_OPERATOR_ID=
|
|
@@ -8774,6 +8776,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
8774
8776
|
this.UpdatePointByCursorIndex();
|
|
8775
8777
|
this.UpdataDataoffset();
|
|
8776
8778
|
this.UpdateFrameMaxMin();
|
|
8779
|
+
//this.ResetFrameXSplit();
|
|
8777
8780
|
this.Draw();
|
|
8778
8781
|
this.ShowTooltipByKeyDown();
|
|
8779
8782
|
this.StopDragTimer();
|
|
@@ -8788,6 +8791,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
8788
8791
|
this.UpdataDataoffset();
|
|
8789
8792
|
this.UpdatePointByCursorIndex();
|
|
8790
8793
|
this.UpdateFrameMaxMin();
|
|
8794
|
+
//this.ResetFrameXSplit();
|
|
8791
8795
|
this.Draw();
|
|
8792
8796
|
this.ShowTooltipByKeyDown();
|
|
8793
8797
|
this.StopDragTimer();
|
|
@@ -10934,6 +10938,10 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
10934
10938
|
frame.HorizontalMax=max;
|
|
10935
10939
|
frame.HorizontalMin=min;
|
|
10936
10940
|
}
|
|
10941
|
+
else
|
|
10942
|
+
{
|
|
10943
|
+
frame.XSplit=true;
|
|
10944
|
+
}
|
|
10937
10945
|
|
|
10938
10946
|
//共享Y轴叠加指标同步下坐标
|
|
10939
10947
|
for(var j=0;j<item.OverlayFrame.length;++j)
|
|
@@ -12496,7 +12504,6 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
12496
12504
|
else
|
|
12497
12505
|
{
|
|
12498
12506
|
var subFrame=this.Frame.SubFrame[dest.WindowIndex];
|
|
12499
|
-
subFrame.Interval=this.OverlayIndexFrameWidth;
|
|
12500
12507
|
var overlayFrame=new OverlayIndexItem();
|
|
12501
12508
|
var frame=this.CreateOverlayFrame();
|
|
12502
12509
|
frame.Canvas=this.Canvas;
|
|
@@ -12513,6 +12520,15 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
12513
12520
|
frame.YSplitOperator.GetEventCallback=(id)=> { return this.GetEventCallback(id); };
|
|
12514
12521
|
|
|
12515
12522
|
overlayFrame.Frame=frame;
|
|
12523
|
+
|
|
12524
|
+
var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CREATE_OVERLAY_FRAME);
|
|
12525
|
+
if (event && event.Callback)
|
|
12526
|
+
{
|
|
12527
|
+
var sendData={ OverlayFrame:overlayFrame, WindowIndex:dest.WindowIndex, SubFrame:subFrame };
|
|
12528
|
+
event.Callback(event, sendData, this);
|
|
12529
|
+
}
|
|
12530
|
+
|
|
12531
|
+
|
|
12516
12532
|
var scriptIndex;
|
|
12517
12533
|
if (findItem)
|
|
12518
12534
|
{
|
|
@@ -13003,7 +13019,7 @@ function CoordinateInfo()
|
|
|
13003
13019
|
this.Font=g_JSChartResource.FrameSplitTextFont; //字体
|
|
13004
13020
|
this.LineColor=g_JSChartResource.FrameSplitPen; //线段颜色
|
|
13005
13021
|
this.LineDash=null; //当线段类型==2时 可以设置虚线样式
|
|
13006
|
-
this.LineType=1; //线段类型 -1
|
|
13022
|
+
this.LineType=1; //线段类型 -1=不画线段 2=虚线, 8,9=集合竞价坐标
|
|
13007
13023
|
this.LineWidth; //线段宽度
|
|
13008
13024
|
this.ExtendData; //扩展属性
|
|
13009
13025
|
//百分比 { PriceColor:, PercentageColor:, SplitColor:, Font: }
|
|
@@ -13363,6 +13379,9 @@ function IChartFramePainting()
|
|
|
13363
13379
|
this.LogoBGColor=g_JSChartResource.FrameLogo.BGColor;
|
|
13364
13380
|
this.GlobalOption;
|
|
13365
13381
|
|
|
13382
|
+
//this.IsDrawLeftBorder;
|
|
13383
|
+
this.IsDrawRightBorder=false; //是否绘制右侧刻度空白的边框
|
|
13384
|
+
|
|
13366
13385
|
this.PtInButtons=function(x,y) //坐标是否在按钮上
|
|
13367
13386
|
{
|
|
13368
13387
|
for(var i=0;i<this.Buttons.length;++i)
|
|
@@ -13442,8 +13461,22 @@ function IChartFramePainting()
|
|
|
13442
13461
|
//JSConsole.Chart.Log(`[IChartFramePainting.DrawBorder] left=${left} `);
|
|
13443
13462
|
if (this.BorderLine==null)
|
|
13444
13463
|
{
|
|
13445
|
-
this.
|
|
13446
|
-
|
|
13464
|
+
if (this.IsDrawRightBorder)
|
|
13465
|
+
{
|
|
13466
|
+
var xRight=ToFixedPoint(border.ChartWidth);
|
|
13467
|
+
this.Canvas.strokeStyle=this.PenBorder;
|
|
13468
|
+
this.Canvas.strokeRect(left,top,xRight-left,height);
|
|
13469
|
+
|
|
13470
|
+
this.Canvas.beginPath();
|
|
13471
|
+
this.Canvas.moveTo(right,top);
|
|
13472
|
+
this.Canvas.lineTo(right,bottom);
|
|
13473
|
+
this.Canvas.stroke();
|
|
13474
|
+
}
|
|
13475
|
+
else
|
|
13476
|
+
{
|
|
13477
|
+
this.Canvas.strokeStyle=this.PenBorder;
|
|
13478
|
+
this.Canvas.strokeRect(left,top,width,height);
|
|
13479
|
+
}
|
|
13447
13480
|
}
|
|
13448
13481
|
else if (IFrameSplitOperator.IsPlusNumber(this.BorderLine)) //单独绘制每个边框
|
|
13449
13482
|
{
|
|
@@ -13477,7 +13510,20 @@ function IChartFramePainting()
|
|
|
13477
13510
|
this.Canvas.stroke();
|
|
13478
13511
|
}
|
|
13479
13512
|
|
|
13480
|
-
|
|
13513
|
+
/*
|
|
13514
|
+
if (this.IsDrawRightBorder)
|
|
13515
|
+
{
|
|
13516
|
+
var xRight=ToFixedPoint(border.ChartWidth);
|
|
13517
|
+
var xLeft=right;
|
|
13518
|
+
this.Canvas.beginPath();
|
|
13519
|
+
this.Canvas.moveTo(xLeft,top);
|
|
13520
|
+
this.Canvas.lineTo(xRight,top);
|
|
13521
|
+
this.Canvas.lineTo(xRight,bottom);
|
|
13522
|
+
this.Canvas.lineTo(xLeft,bottom);
|
|
13523
|
+
|
|
13524
|
+
this.Canvas.stroke();
|
|
13525
|
+
}
|
|
13526
|
+
*/
|
|
13481
13527
|
}
|
|
13482
13528
|
|
|
13483
13529
|
//画标题背景色
|
|
@@ -13722,6 +13768,11 @@ function AverageWidthFrame()
|
|
|
13722
13768
|
|
|
13723
13769
|
this.ButtonTooltip=CloneData(g_JSChartResource.Buttons.Tooltip);
|
|
13724
13770
|
|
|
13771
|
+
//Y轴刻度长线
|
|
13772
|
+
this.YLineExtend; //[0]=左 [1]=右 { Width:5, Color:颜色, }
|
|
13773
|
+
this.YTextExtend; //[0]=左 [1]=右 { Align:0=默认 1=左对齐 2=右对齐 }
|
|
13774
|
+
this.YRightTextInfo;
|
|
13775
|
+
|
|
13725
13776
|
//画图工具刻度
|
|
13726
13777
|
|
|
13727
13778
|
this.DrawPicture={
|
|
@@ -13960,6 +14011,18 @@ function AverageWidthFrame()
|
|
|
13960
14011
|
var isDrawLeft=borderLeft>10 && this.IsShowYText[0]===true && this.YTextPosition[0]!=2;
|
|
13961
14012
|
var isDrawRight=borderRight>10 && this.IsShowYText[1]===true && this.YTextPosition[1]!=2;
|
|
13962
14013
|
|
|
14014
|
+
var rightExtendLine=null; //右侧延长线
|
|
14015
|
+
if (IFrameSplitOperator.IsNonEmptyArray(this.YLineExtend))
|
|
14016
|
+
{
|
|
14017
|
+
rightExtendLine=this.YLineExtend[1];
|
|
14018
|
+
}
|
|
14019
|
+
|
|
14020
|
+
var rightExtendText=null; //右侧文字设置
|
|
14021
|
+
if (IFrameSplitOperator.IsNonEmptyArray(this.YTextExtend))
|
|
14022
|
+
{
|
|
14023
|
+
rightExtendText=this.YTextExtend[1];
|
|
14024
|
+
}
|
|
14025
|
+
|
|
13963
14026
|
var yPrev=null; //上一个坐标y的值
|
|
13964
14027
|
var pixelRatio=GetDevicePixelRatio();
|
|
13965
14028
|
var itemHeight=(border.BottomEx-border.TopEx)/this.HorizontalInfo.length;
|
|
@@ -13973,6 +14036,7 @@ function AverageWidthFrame()
|
|
|
13973
14036
|
if (y!=null && yPrev!=null && Math.abs(y-yPrev)<this.MinYDistance) continue; //两个坐标在近了 就不画了
|
|
13974
14037
|
|
|
13975
14038
|
var yFixed=ToFixedPoint(y);
|
|
14039
|
+
//绘制刻度线
|
|
13976
14040
|
if (y!=bottom && this.IsShowYLine)
|
|
13977
14041
|
{
|
|
13978
14042
|
var bChangeLineWidth=false;
|
|
@@ -14049,7 +14113,7 @@ function AverageWidthFrame()
|
|
|
14049
14113
|
textBaseline=1;
|
|
14050
14114
|
}
|
|
14051
14115
|
|
|
14052
|
-
|
|
14116
|
+
//左边 坐标信息 间距小于10 不画坐标
|
|
14053
14117
|
this.Canvas.strokeStyle=item.TextColor;
|
|
14054
14118
|
this.Canvas.fillStyle=item.TextColor;
|
|
14055
14119
|
|
|
@@ -14066,7 +14130,7 @@ function AverageWidthFrame()
|
|
|
14066
14130
|
}
|
|
14067
14131
|
}
|
|
14068
14132
|
|
|
14069
|
-
|
|
14133
|
+
//右边 坐标信息 间距小于10 不画坐标
|
|
14070
14134
|
if (item.Message[1]!=null && isDrawRight)
|
|
14071
14135
|
{
|
|
14072
14136
|
if (item.Font!=null) this.Canvas.font=item.Font;
|
|
@@ -14083,6 +14147,21 @@ function AverageWidthFrame()
|
|
|
14083
14147
|
xText+=lineLength;
|
|
14084
14148
|
}
|
|
14085
14149
|
|
|
14150
|
+
//右侧延长线
|
|
14151
|
+
if (rightExtendLine && rightExtendLine.Width>1)
|
|
14152
|
+
{
|
|
14153
|
+
var lineLength=rightExtendLine.Width;
|
|
14154
|
+
if (rightExtendLine.Color) this.Canvas.strokeStyle=rightExtendLine.Color;
|
|
14155
|
+
else this.Canvas.strokeStyle=item.LineColor;
|
|
14156
|
+
this.Canvas.beginPath();
|
|
14157
|
+
this.Canvas.moveTo(xText,yFixed);
|
|
14158
|
+
this.Canvas.lineTo(xText+lineLength,yFixed);
|
|
14159
|
+
this.Canvas.stroke();
|
|
14160
|
+
|
|
14161
|
+
xText+=lineLength+2;
|
|
14162
|
+
}
|
|
14163
|
+
|
|
14164
|
+
|
|
14086
14165
|
this.Canvas.textAlign="left";
|
|
14087
14166
|
if (Array.isArray(item.Message[1]))
|
|
14088
14167
|
{
|
|
@@ -14125,7 +14204,17 @@ function AverageWidthFrame()
|
|
|
14125
14204
|
if (!rtPreRight || (rtRight && !this.IsTextTopBottomOverlap(rtRight,rtPreRight)))
|
|
14126
14205
|
{
|
|
14127
14206
|
if (item.TextColor2) this.Canvas.fillStyle=item.TextColor2;
|
|
14128
|
-
|
|
14207
|
+
if (rightExtendText && rightExtendText.Align && this.YRightTextInfo)
|
|
14208
|
+
{
|
|
14209
|
+
this.Canvas.textAlign="right";
|
|
14210
|
+
var xRight=this.YRightTextInfo.MainTextWidth+right-this.YTextPadding[1];
|
|
14211
|
+
this.Canvas.fillText(item.Message[1],xRight,yText);
|
|
14212
|
+
}
|
|
14213
|
+
else
|
|
14214
|
+
{
|
|
14215
|
+
this.Canvas.fillText(item.Message[1],xText+this.YTextPadding[1],yText);
|
|
14216
|
+
}
|
|
14217
|
+
|
|
14129
14218
|
rtPreRight=rtRight;
|
|
14130
14219
|
}
|
|
14131
14220
|
}
|
|
@@ -14134,7 +14223,33 @@ function AverageWidthFrame()
|
|
|
14134
14223
|
yPrev=y;
|
|
14135
14224
|
}
|
|
14136
14225
|
|
|
14137
|
-
if (IFrameSplitOperator.IsNonEmptyArray(aryMultiText) && this.MultiTextFormat==1) this.DrawHorizontalMuText(aryMultiText)
|
|
14226
|
+
if (IFrameSplitOperator.IsNonEmptyArray(aryMultiText) && this.MultiTextFormat==1) this.DrawHorizontalMuText(aryMultiText);
|
|
14227
|
+
|
|
14228
|
+
if (isDrawRight && this.IsDrawRightBorder && this.YRightTextInfo)
|
|
14229
|
+
{
|
|
14230
|
+
var xRight=this.YRightTextInfo.MainTextWidth+right;
|
|
14231
|
+
xLine=ToFixedPoint(xRight);
|
|
14232
|
+
this.Canvas.strokeStyle=this.PenBorder;
|
|
14233
|
+
this.Canvas.beginPath();
|
|
14234
|
+
this.Canvas.moveTo(xLine,top);
|
|
14235
|
+
this.Canvas.lineTo(xLine,bottom);
|
|
14236
|
+
this.Canvas.stroke();
|
|
14237
|
+
|
|
14238
|
+
if (IFrameSplitOperator.IsNonEmptyArray(this.YRightTextInfo.AryOverlayWidth))
|
|
14239
|
+
{
|
|
14240
|
+
this.Canvas.beginPath();
|
|
14241
|
+
for(var i=0;i<this.YRightTextInfo.AryOverlayWidth.length;++i)
|
|
14242
|
+
{
|
|
14243
|
+
var width=this.YRightTextInfo.AryOverlayWidth[i];
|
|
14244
|
+
xRight+=width;
|
|
14245
|
+
xLine=ToFixedPoint(xRight);
|
|
14246
|
+
this.Canvas.moveTo(xLine,top);
|
|
14247
|
+
this.Canvas.lineTo(xLine,bottom);
|
|
14248
|
+
}
|
|
14249
|
+
this.Canvas.stroke();
|
|
14250
|
+
|
|
14251
|
+
}
|
|
14252
|
+
}
|
|
14138
14253
|
}
|
|
14139
14254
|
|
|
14140
14255
|
//上下区域是否重叠
|
|
@@ -14798,7 +14913,9 @@ function AverageWidthFrame()
|
|
|
14798
14913
|
{
|
|
14799
14914
|
var value=this.Canvas.measureText(text[i].Text).width;
|
|
14800
14915
|
if (value>width) width=value;
|
|
14801
|
-
|
|
14916
|
+
var outItem={ Text:text[i].Text, Width:value+2*pixelTatio };
|
|
14917
|
+
if (item.TextColor) outItem.TextColor=item.TextColor;
|
|
14918
|
+
aryText.push(outItem);
|
|
14802
14919
|
}
|
|
14803
14920
|
}
|
|
14804
14921
|
|
|
@@ -15023,7 +15140,8 @@ function AverageWidthFrame()
|
|
|
15023
15140
|
var textLeft=right-itemText.Width;
|
|
15024
15141
|
this.Canvas.fillStyle=bgColor;
|
|
15025
15142
|
this.Canvas.fillRect(textLeft,bgTop,itemText.Width,textHeight); //文本背景区域
|
|
15026
|
-
this.Canvas.fillStyle
|
|
15143
|
+
if (itemText.TextColor) this.Canvas.fillStyle=itemText.TextColor;
|
|
15144
|
+
else this.Canvas.fillStyle = item.TextColor;
|
|
15027
15145
|
this.Canvas.fillText(itemText.Text, textLeft + 1*pixelTatio, yText);
|
|
15028
15146
|
if (i==0) this.DrawLine(left,textLeft,yText,item.LineColor,item.LineType,item);
|
|
15029
15147
|
yText+=textHeight+1*pixelTatio;
|
|
@@ -15135,7 +15253,8 @@ function AverageWidthFrame()
|
|
|
15135
15253
|
{
|
|
15136
15254
|
this.Canvas.fillStyle=item.LineColor;
|
|
15137
15255
|
this.Canvas.fillRect(textLeft,bgTop,itemText.Width,textHeight);
|
|
15138
|
-
this.Canvas.fillStyle
|
|
15256
|
+
if (itemText.TextColor) this.Canvas.fillStyle=itemText.TextColor;
|
|
15257
|
+
else this.Canvas.fillStyle = item.TextColor;
|
|
15139
15258
|
this.Canvas.fillText(itemText.Text, textLeft + 1*pixelTatio, yText);
|
|
15140
15259
|
}
|
|
15141
15260
|
|
|
@@ -18729,8 +18848,13 @@ function OverlayKLineFrame()
|
|
|
18729
18848
|
this.Title=null;
|
|
18730
18849
|
this.TitleColor=g_JSChartResource.OverlayFrame.TitleColor;
|
|
18731
18850
|
this.TitleFont=g_JSChartResource.OverlayFrame.TitleFont;
|
|
18851
|
+
this.IsShowTitle=true;
|
|
18732
18852
|
|
|
18733
18853
|
this.IsYDrawMainFrame=false; //Y轴自定刻度绘制在主图框架上
|
|
18854
|
+
this.BlankWidth=0;
|
|
18855
|
+
this.Style=0; //0=Y轴在BlankWidth 1=Y轴在左边
|
|
18856
|
+
|
|
18857
|
+
this.YLineExtend=[ { Width:2 }, null]; //[0]=左 [1]=右 { Width:5, Color:颜色, }
|
|
18734
18858
|
|
|
18735
18859
|
this.Buttons=[];
|
|
18736
18860
|
|
|
@@ -18770,21 +18894,69 @@ function OverlayKLineFrame()
|
|
|
18770
18894
|
this.XSplit=false;
|
|
18771
18895
|
}
|
|
18772
18896
|
|
|
18897
|
+
|
|
18898
|
+
//Y轴刻度线 x坐标
|
|
18899
|
+
this.GetXHorizontal=function()
|
|
18900
|
+
{
|
|
18901
|
+
var border=this.ChartBorder.GetBorder();
|
|
18902
|
+
var x=border.Right;
|
|
18903
|
+
x+=this.RightOffset;
|
|
18904
|
+
|
|
18905
|
+
if (this.Style==1)
|
|
18906
|
+
{
|
|
18907
|
+
|
|
18908
|
+
}
|
|
18909
|
+
else
|
|
18910
|
+
{
|
|
18911
|
+
x+=this.BlankWidth;
|
|
18912
|
+
}
|
|
18913
|
+
|
|
18914
|
+
return x;
|
|
18915
|
+
}
|
|
18916
|
+
|
|
18917
|
+
this.GetHorizontalWidth=function()
|
|
18918
|
+
{
|
|
18919
|
+
var width=null;
|
|
18920
|
+
if (this.YRightTextInfo && IFrameSplitOperator.IsNumber(this.TextWidthIndex))
|
|
18921
|
+
width=this.YRightTextInfo.AryOverlayWidth[this.TextWidthIndex];
|
|
18922
|
+
|
|
18923
|
+
return width;
|
|
18924
|
+
}
|
|
18925
|
+
|
|
18773
18926
|
this.DrawTitle=function() //画标题
|
|
18774
18927
|
{
|
|
18928
|
+
if (!this.IsShowTitle) return;
|
|
18775
18929
|
if (!this.Title) return;
|
|
18776
18930
|
var border=this.ChartBorder.GetBorder();
|
|
18777
18931
|
var top = this.ChartBorder.GetTopTitle();
|
|
18778
18932
|
var bottom = border.Bottom;
|
|
18779
|
-
|
|
18780
|
-
|
|
18781
|
-
|
|
18933
|
+
|
|
18934
|
+
var xText=this.GetXHorizontal();
|
|
18935
|
+
var leftLine=null, rightLine=null;
|
|
18936
|
+
if (IFrameSplitOperator.IsNonEmptyArray(this.YLineExtend))
|
|
18937
|
+
{
|
|
18938
|
+
rightLine=this.YLineExtend[1];
|
|
18939
|
+
leftLine=this.YLineExtend[0];
|
|
18940
|
+
}
|
|
18941
|
+
|
|
18942
|
+
if (this.Style==1)
|
|
18943
|
+
{
|
|
18944
|
+
this.Canvas.textBaseline="bottom";
|
|
18945
|
+
if (rightLine && rightLine.Width>0) xText+=rightLine.Width+1;
|
|
18946
|
+
else xText+=1;
|
|
18947
|
+
}
|
|
18948
|
+
else
|
|
18949
|
+
{
|
|
18950
|
+
this.Canvas.textBaseline="top";
|
|
18951
|
+
if (leftLine && leftLine.Width>0) xText-=leftLine.Width;
|
|
18952
|
+
else xText-=2;
|
|
18953
|
+
}
|
|
18954
|
+
|
|
18955
|
+
var yText=top+(bottom-top)/2;
|
|
18782
18956
|
this.Canvas.fillStyle=this.TitleColor;
|
|
18783
18957
|
this.Canvas.font=this.TitleFont;
|
|
18784
18958
|
this.Canvas.textAlign="center";
|
|
18785
|
-
|
|
18786
|
-
|
|
18787
|
-
var xText=right-2,yText=top+(bottom-top)/2;
|
|
18959
|
+
|
|
18788
18960
|
this.Canvas.save();
|
|
18789
18961
|
this.Canvas.translate(xText, yText);
|
|
18790
18962
|
this.Canvas.rotate(90 * Math.PI / 180);
|
|
@@ -18823,10 +18995,18 @@ function OverlayKLineFrame()
|
|
|
18823
18995
|
if (item.Font!=null) this.Canvas.font=item.Font;
|
|
18824
18996
|
|
|
18825
18997
|
textWidth=this.Canvas.measureText(item.Message[1]).width;
|
|
18998
|
+
if (this.YTextPadding && IFrameSplitOperator.IsNumber(this.YTextPadding[1]))
|
|
18999
|
+
textWidth+=this.YTextPadding[1];
|
|
18826
19000
|
if (width.Right<textWidth) width.Right=textWidth;
|
|
18827
19001
|
}
|
|
18828
19002
|
}
|
|
18829
19003
|
|
|
19004
|
+
if (IFrameSplitOperator.IsNonEmptyArray(this.YLineExtend))
|
|
19005
|
+
{
|
|
19006
|
+
var line=this.YLineExtend[1];
|
|
19007
|
+
if (line && line.Width>0) width.Right+=line.Width;
|
|
19008
|
+
}
|
|
19009
|
+
|
|
18830
19010
|
return { TextWidth:width };
|
|
18831
19011
|
}
|
|
18832
19012
|
|
|
@@ -18866,7 +19046,23 @@ function OverlayKLineFrame()
|
|
|
18866
19046
|
var top = this.ChartBorder.GetTopTitle();
|
|
18867
19047
|
var borderRight=this.ChartBorder.Right;
|
|
18868
19048
|
right+=this.RightOffset;
|
|
19049
|
+
var xLine=this.GetXHorizontal();
|
|
19050
|
+
if (IFrameSplitOperator.IsNumber(this.BlankWidth)) right+=this.BlankWidth;
|
|
19051
|
+
|
|
19052
|
+
var rightExtendText=null; //右侧文字设置
|
|
19053
|
+
if (IFrameSplitOperator.IsNonEmptyArray(this.YTextExtend))
|
|
19054
|
+
{
|
|
19055
|
+
rightExtendText=this.YTextExtend[1];
|
|
19056
|
+
}
|
|
19057
|
+
|
|
19058
|
+
var leftLine=null, rightLine=null;
|
|
19059
|
+
if (IFrameSplitOperator.IsNonEmptyArray(this.YLineExtend))
|
|
19060
|
+
{
|
|
19061
|
+
rightLine=this.YLineExtend[1];
|
|
19062
|
+
leftLine=this.YLineExtend[0];
|
|
19063
|
+
}
|
|
18869
19064
|
|
|
19065
|
+
var rightWidth=this.GetHorizontalWidth(); //右侧宽度
|
|
18870
19066
|
var yPrev=null; //上一个坐标y的值
|
|
18871
19067
|
for(var i=this.HorizontalInfo.length-1; i>=0; --i) //从上往下画分割线
|
|
18872
19068
|
{
|
|
@@ -18878,11 +19074,24 @@ function OverlayKLineFrame()
|
|
|
18878
19074
|
else if (y <= top + 2) this.Canvas.textBaseline = 'top';
|
|
18879
19075
|
else this.Canvas.textBaseline = "middle";
|
|
18880
19076
|
|
|
18881
|
-
|
|
18882
|
-
|
|
18883
|
-
|
|
18884
|
-
|
|
18885
|
-
|
|
19077
|
+
|
|
19078
|
+
if (leftLine && leftLine.Width>0) //左边
|
|
19079
|
+
{
|
|
19080
|
+
this.Canvas.strokeStyle=this.PenBorder;
|
|
19081
|
+
this.Canvas.beginPath();
|
|
19082
|
+
this.Canvas.moveTo(xLine-leftLine.Width,ToFixedPoint(y));
|
|
19083
|
+
this.Canvas.lineTo(xLine,ToFixedPoint(y));
|
|
19084
|
+
this.Canvas.stroke();
|
|
19085
|
+
}
|
|
19086
|
+
|
|
19087
|
+
if (rightLine && rightLine.Width>0)
|
|
19088
|
+
{
|
|
19089
|
+
this.Canvas.strokeStyle=this.PenBorder;
|
|
19090
|
+
this.Canvas.beginPath();
|
|
19091
|
+
this.Canvas.moveTo(xLine+rightLine.Width,ToFixedPoint(y));
|
|
19092
|
+
this.Canvas.lineTo(xLine,ToFixedPoint(y));
|
|
19093
|
+
this.Canvas.stroke();
|
|
19094
|
+
}
|
|
18886
19095
|
|
|
18887
19096
|
//坐标信息 右边 间距小于10 不画坐标
|
|
18888
19097
|
if (item.Message[1]!=null && borderRight>10)
|
|
@@ -18891,10 +19100,22 @@ function OverlayKLineFrame()
|
|
|
18891
19100
|
|
|
18892
19101
|
var text=item.Message[1];
|
|
18893
19102
|
if (Array.isArray(item.Message[1])) text=item.Message[1][0];
|
|
18894
|
-
|
|
18895
|
-
|
|
18896
|
-
|
|
18897
|
-
|
|
19103
|
+
|
|
19104
|
+
if (rightExtendText && rightExtendText.Align)
|
|
19105
|
+
{
|
|
19106
|
+
var textWidth=rightWidth;
|
|
19107
|
+
this.Canvas.textAlign="right";
|
|
19108
|
+
var xRight=border.Right+this.RightOffset+textWidth-this.YTextPadding[1];
|
|
19109
|
+
this.Canvas.fillText(text,xRight,y);
|
|
19110
|
+
}
|
|
19111
|
+
else
|
|
19112
|
+
{
|
|
19113
|
+
var xText=right+2;
|
|
19114
|
+
if (rightLine && rightLine.Width>0) xText+=rightLine.Width;
|
|
19115
|
+
this.Canvas.fillStyle=item.TextColor;
|
|
19116
|
+
this.Canvas.textAlign="left";
|
|
19117
|
+
this.Canvas.fillText(text,xText,y);
|
|
19118
|
+
}
|
|
18898
19119
|
}
|
|
18899
19120
|
|
|
18900
19121
|
yPrev=y;
|
|
@@ -18906,10 +19127,8 @@ function OverlayKLineFrame()
|
|
|
18906
19127
|
{
|
|
18907
19128
|
var border=this.ChartBorder.GetBorder();
|
|
18908
19129
|
var top=border.TopEx;
|
|
18909
|
-
//var left=this.ChartBorder.GetLeft();
|
|
18910
|
-
var right=border.Right;
|
|
18911
19130
|
var bottom=border.BottomEx;
|
|
18912
|
-
right
|
|
19131
|
+
var right=this.GetXHorizontal();
|
|
18913
19132
|
|
|
18914
19133
|
this.Canvas.strokeStyle=this.PenBorder;
|
|
18915
19134
|
this.Canvas.beginPath();
|
|
@@ -18955,14 +19174,15 @@ function OverlayKLineFrame()
|
|
|
18955
19174
|
|
|
18956
19175
|
var border=this.ChartBorder.GetBorder();
|
|
18957
19176
|
var yButton=border.Top+this.ChartBorder.TitleHeight/2;
|
|
18958
|
-
var
|
|
19177
|
+
var rightWidth=this.GetHorizontalWidth();
|
|
19178
|
+
var xBotton=border.Right+this.RightOffset+rightWidth-this.CloseButton.MerginLeft;
|
|
18959
19179
|
|
|
18960
|
-
for(var i=
|
|
19180
|
+
for(var i=aryButton.length-1;i>=0;--i)
|
|
18961
19181
|
{
|
|
18962
19182
|
var item=aryButton[i];
|
|
18963
19183
|
var size=item.Style.Size;
|
|
18964
19184
|
var font=`${size}px ${item.Style.Family}`;
|
|
18965
|
-
var rtButton={ Left:xBotton, Top:yButton-size/2, Right:xBotton
|
|
19185
|
+
var rtButton={ Left:xBotton-size-item.Style.MerginLeft, Top:yButton-size/2, Right:xBotton, Bottom:yButton+size/2, Width:size+item.Style.MerginLeft, Height:size };
|
|
18966
19186
|
var color=this.CloseButton.Color;
|
|
18967
19187
|
if (moveonPoint && (moveonPoint.X>=rtButton.Left && moveonPoint.X<rtButton.Right && moveonPoint.Y>=rtButton.Top && moveonPoint.Y<=rtButton.Bottom))
|
|
18968
19188
|
{
|
|
@@ -18973,13 +19193,13 @@ function OverlayKLineFrame()
|
|
|
18973
19193
|
|
|
18974
19194
|
this.Canvas.fillStyle=color;
|
|
18975
19195
|
this.Canvas.font=font;
|
|
18976
|
-
this.Canvas.textAlign="
|
|
19196
|
+
this.Canvas.textAlign="right";
|
|
18977
19197
|
this.Canvas.textBaseline="middle";
|
|
18978
19198
|
this.Canvas.fillText(item.Style.Text, xBotton, yButton);
|
|
18979
19199
|
|
|
18980
19200
|
this.Buttons.push({ ID:item.ID, Rect:rtButton });
|
|
18981
19201
|
|
|
18982
|
-
xBotton=rtButton.
|
|
19202
|
+
xBotton=rtButton.Left;
|
|
18983
19203
|
}
|
|
18984
19204
|
}
|
|
18985
19205
|
|
|
@@ -20056,7 +20276,7 @@ function SubFrameItem()
|
|
|
20056
20276
|
this.Frame;
|
|
20057
20277
|
this.Height;
|
|
20058
20278
|
this.OverlayIndex=[]; //叠加指标
|
|
20059
|
-
this.Interval=60; //子坐标间间距
|
|
20279
|
+
//this.Interval=60; //子坐标间间距
|
|
20060
20280
|
}
|
|
20061
20281
|
|
|
20062
20282
|
function OverlayIndexItem()
|
|
@@ -20124,8 +20344,11 @@ function HQTradeFrame()
|
|
|
20124
20344
|
|
|
20125
20345
|
this.AutoLeftBorder=null; //{ Blank:10 留白宽度, MinWidth:最小宽度 }
|
|
20126
20346
|
this.AutoRightBorder=null; //{ Blank:10 留白宽度, MinWidth:最小宽度 }
|
|
20127
|
-
this.OverlayBlankWidth=
|
|
20128
|
-
this.AuotRightWidth; //右边主坐标刻度宽度
|
|
20347
|
+
this.OverlayBlankWidth=30;
|
|
20348
|
+
this.AuotRightWidth; //右边主坐标刻度宽度 (自动模式)
|
|
20349
|
+
|
|
20350
|
+
//固定模式右侧宽度
|
|
20351
|
+
this.FixedRightWidth={ Main:60, Overlay:80 };
|
|
20129
20352
|
|
|
20130
20353
|
this.ZoomWindowsInfo=null; //附图指标缩放,备份信息
|
|
20131
20354
|
this.ZoomStartWindowIndex=1; //允许缩放窗口起始位置
|
|
@@ -20634,7 +20857,7 @@ function HQTradeFrame()
|
|
|
20634
20857
|
|
|
20635
20858
|
overlayItem.Frame.YSplitOperator.Operator();
|
|
20636
20859
|
var value=overlayItem.Frame.GetScaleTextWidth();
|
|
20637
|
-
|
|
20860
|
+
|
|
20638
20861
|
overlayItem.Frame.HorizontalMax=maxValue;
|
|
20639
20862
|
overlayItem.Frame.HorizontalMin=minValue;
|
|
20640
20863
|
|
|
@@ -20691,6 +20914,8 @@ function HQTradeFrame()
|
|
|
20691
20914
|
width.OverlayRight+=value;
|
|
20692
20915
|
}
|
|
20693
20916
|
|
|
20917
|
+
width.AryOverlayWidth=overlayWidth;
|
|
20918
|
+
|
|
20694
20919
|
return width;
|
|
20695
20920
|
}
|
|
20696
20921
|
|
|
@@ -20745,59 +20970,104 @@ function HQTradeFrame()
|
|
|
20745
20970
|
}
|
|
20746
20971
|
}
|
|
20747
20972
|
|
|
20748
|
-
if (IFrameSplitOperator.IsNumber(textWidth.Right)
|
|
20973
|
+
if (IFrameSplitOperator.IsNumber(textWidth.Right))
|
|
20749
20974
|
{
|
|
20750
|
-
|
|
20751
|
-
if (IFrameSplitOperator.IsNumber(this.AutoRightBorder.Blank)) blank=this.AutoRightBorder.Blank;
|
|
20752
|
-
var value=textWidth.Right+blank;
|
|
20753
|
-
if (IFrameSplitOperator.IsNumber(this.AutoRightBorder.MinWidth))
|
|
20975
|
+
if (this.AutoRightBorder) //自动调整右侧间距
|
|
20754
20976
|
{
|
|
20755
|
-
|
|
20756
|
-
|
|
20977
|
+
var rightTextInfo={ };
|
|
20978
|
+
var blank=0;
|
|
20979
|
+
if (IFrameSplitOperator.IsNumber(this.AutoRightBorder.Blank)) blank=this.AutoRightBorder.Blank;
|
|
20980
|
+
var value=textWidth.Right+blank;
|
|
20981
|
+
if (IFrameSplitOperator.IsNumber(this.AutoRightBorder.MinWidth))
|
|
20982
|
+
{
|
|
20983
|
+
if (this.AutoRightBorder.MinWidth>value) value=this.AutoRightBorder.MinWidth;
|
|
20984
|
+
}
|
|
20757
20985
|
|
|
20758
|
-
this.AuotRightWidth=value;
|
|
20759
|
-
if (IFrameSplitOperator.IsPlusNumber(textWidth.OverlayRight))
|
|
20760
|
-
{
|
|
20761
|
-
value+=this.OverlayBlankWidth;
|
|
20762
20986
|
this.AuotRightWidth=value;
|
|
20763
|
-
value
|
|
20764
|
-
|
|
20987
|
+
rightTextInfo.MainTextWidth=value; //主图坐标宽度
|
|
20988
|
+
if (IFrameSplitOperator.IsNonEmptyArray(textWidth.AryOverlayWidth)) rightTextInfo.AryOverlayWidth=textWidth.AryOverlayWidth;
|
|
20765
20989
|
|
|
20766
|
-
|
|
20767
|
-
|
|
20768
|
-
|
|
20990
|
+
if (IFrameSplitOperator.IsPlusNumber(textWidth.OverlayRight))
|
|
20991
|
+
{
|
|
20992
|
+
this.AuotRightWidth=value;
|
|
20993
|
+
value+=textWidth.OverlayRight;
|
|
20994
|
+
}
|
|
20769
20995
|
|
|
20770
|
-
if (this.
|
|
20996
|
+
if (this.GetExtendChartRightWidth)
|
|
20771
20997
|
{
|
|
20772
|
-
var
|
|
20773
|
-
|
|
20998
|
+
var extendWidth=this.GetExtendChartRightWidth();
|
|
20999
|
+
|
|
21000
|
+
if (this.GetExtendChartByClassName)
|
|
20774
21001
|
{
|
|
20775
|
-
finder.
|
|
21002
|
+
var finder=this.GetExtendChartByClassName("StockChip");
|
|
21003
|
+
if (finder && finder.Chart)
|
|
21004
|
+
{
|
|
21005
|
+
finder.Chart.Left=value;
|
|
21006
|
+
}
|
|
20776
21007
|
}
|
|
21008
|
+
|
|
21009
|
+
value+=extendWidth;
|
|
20777
21010
|
}
|
|
20778
21011
|
|
|
20779
|
-
|
|
20780
|
-
|
|
21012
|
+
if (this.IsHScreen)
|
|
21013
|
+
{
|
|
21014
|
+
if (this.ChartBorder.Bottom!=value) bSizeChange=true;
|
|
21015
|
+
this.ChartBorder.Bottom=value;
|
|
21016
|
+
}
|
|
21017
|
+
else
|
|
21018
|
+
{
|
|
21019
|
+
if (this.ChartBorder.Right!=value) bSizeChange=true;
|
|
21020
|
+
this.ChartBorder.Right=value;
|
|
21021
|
+
}
|
|
20781
21022
|
|
|
20782
|
-
|
|
20783
|
-
|
|
20784
|
-
|
|
20785
|
-
|
|
21023
|
+
for(var i=0; i<this.SubFrame.length; ++i)
|
|
21024
|
+
{
|
|
21025
|
+
var item=this.SubFrame[i];
|
|
21026
|
+
if (this.IsHScreen) item.Frame.ChartBorder.Bottom=value;
|
|
21027
|
+
else item.Frame.ChartBorder.Right=value;
|
|
21028
|
+
|
|
21029
|
+
item.Frame.ReDrawToolbar=true;
|
|
21030
|
+
item.Frame.YRightTextInfo=rightTextInfo;
|
|
21031
|
+
|
|
21032
|
+
for(var j=0;j<item.OverlayIndex.length;++j)
|
|
21033
|
+
{
|
|
21034
|
+
var overlayItem=item.OverlayIndex[j];
|
|
21035
|
+
overlayItem.Frame.YRightTextInfo=rightTextInfo;
|
|
21036
|
+
}
|
|
21037
|
+
}
|
|
20786
21038
|
}
|
|
20787
|
-
else
|
|
21039
|
+
else
|
|
20788
21040
|
{
|
|
20789
|
-
|
|
20790
|
-
this.
|
|
20791
|
-
|
|
21041
|
+
var rightTextInfo={ };
|
|
21042
|
+
rightTextInfo.MainTextWidth=this.FixedRightWidth.Main;
|
|
21043
|
+
if (textWidth.OverlayRight==0) //无叠加直接最右边
|
|
21044
|
+
{
|
|
21045
|
+
if (this.IsHScreen)
|
|
21046
|
+
rightTextInfo.MainTextWidth=this.ChartBorder.Bottom;
|
|
21047
|
+
else
|
|
21048
|
+
rightTextInfo.MainTextWidth=this.ChartBorder.Right;
|
|
21049
|
+
}
|
|
21050
|
+
else if (IFrameSplitOperator.IsNonEmptyArray(textWidth.AryOverlayWidth))
|
|
21051
|
+
{
|
|
21052
|
+
for(var i=0;i<textWidth.AryOverlayWidth.length;++i)
|
|
21053
|
+
textWidth.AryOverlayWidth[i]=this.FixedRightWidth.Overlay;
|
|
20792
21054
|
|
|
20793
|
-
|
|
20794
|
-
|
|
20795
|
-
|
|
20796
|
-
|
|
20797
|
-
|
|
21055
|
+
rightTextInfo.AryOverlayWidth=textWidth.AryOverlayWidth;
|
|
21056
|
+
}
|
|
21057
|
+
|
|
21058
|
+
for(var i=0; i<this.SubFrame.length; ++i)
|
|
21059
|
+
{
|
|
21060
|
+
var item=this.SubFrame[i];
|
|
21061
|
+
|
|
21062
|
+
item.Frame.ReDrawToolbar=true;
|
|
21063
|
+
item.Frame.YRightTextInfo=rightTextInfo;
|
|
20798
21064
|
|
|
20799
|
-
|
|
20800
|
-
|
|
21065
|
+
for(var j=0;j<item.OverlayIndex.length;++j)
|
|
21066
|
+
{
|
|
21067
|
+
var overlayItem=item.OverlayIndex[j];
|
|
21068
|
+
overlayItem.Frame.YRightTextInfo=rightTextInfo;
|
|
21069
|
+
}
|
|
21070
|
+
}
|
|
20801
21071
|
}
|
|
20802
21072
|
}
|
|
20803
21073
|
|
|
@@ -20815,39 +21085,47 @@ function HQTradeFrame()
|
|
|
20815
21085
|
{
|
|
20816
21086
|
var rightOffset=this.AuotRightWidth;
|
|
20817
21087
|
|
|
20818
|
-
for(var j=0; j<item.OverlayIndex.length; ++j)
|
|
21088
|
+
for(var j=0, index=0; j<item.OverlayIndex.length; ++j)
|
|
20819
21089
|
{
|
|
20820
21090
|
var overlayItem=item.OverlayIndex[j];
|
|
20821
21091
|
//把主坐标部分设置给子坐标下来
|
|
20822
21092
|
overlayItem.Frame.DataWidth=item.Frame.DataWidth;
|
|
20823
21093
|
overlayItem.Frame.DistanceWidth=item.Frame.DistanceWidth;
|
|
20824
21094
|
overlayItem.Frame.XPointCount=item.Frame.XPointCount;
|
|
20825
|
-
|
|
20826
|
-
|
|
20827
|
-
|
|
20828
|
-
|
|
20829
|
-
|
|
20830
|
-
|
|
21095
|
+
overlayItem.Frame.RightOffset=rightOffset;
|
|
21096
|
+
overlayItem.Frame.BlankWidth=0;
|
|
21097
|
+
overlayItem.Frame.TextWidthIndex=index;
|
|
21098
|
+
if (IFrameSplitOperator.IsNumber(this.OverlayBlankWidth)) overlayItem.Frame.BlankWidth=this.OverlayBlankWidth;
|
|
21099
|
+
|
|
21100
|
+
overlayItem.Frame.Draw();
|
|
21101
|
+
rightOffset+=overlayItem.RightWidth.Width;
|
|
21102
|
+
if (overlayItem.Frame.IsShow) ++index;
|
|
20831
21103
|
}
|
|
20832
|
-
|
|
20833
21104
|
}
|
|
20834
21105
|
else
|
|
20835
21106
|
{
|
|
20836
|
-
var rightOffset=
|
|
21107
|
+
var rightOffset=this.FixedRightWidth.Main;
|
|
20837
21108
|
if (item.Frame.RightTextMaxWidth>rightOffset) rightOffset=item.Frame.RightTextMaxWidth;
|
|
20838
|
-
|
|
21109
|
+
|
|
21110
|
+
for(var j =0, index=0; j<item.OverlayIndex.length;++j)
|
|
20839
21111
|
{
|
|
20840
21112
|
var overlayItem=item.OverlayIndex[j];
|
|
20841
21113
|
//把主坐标部分设置给子坐标下来
|
|
20842
21114
|
overlayItem.Frame.DataWidth=item.Frame.DataWidth;
|
|
20843
21115
|
overlayItem.Frame.DistanceWidth=item.Frame.DistanceWidth;
|
|
20844
21116
|
overlayItem.Frame.XPointCount=item.Frame.XPointCount;
|
|
20845
|
-
|
|
21117
|
+
overlayItem.Frame.RightOffset=rightOffset;
|
|
21118
|
+
overlayItem.Frame.BlankWidth=0;
|
|
21119
|
+
overlayItem.Frame.TextWidthIndex=index;
|
|
21120
|
+
if (IFrameSplitOperator.IsNumber(this.OverlayBlankWidth)) overlayItem.Frame.BlankWidth=this.OverlayBlankWidth;
|
|
21121
|
+
|
|
21122
|
+
overlayItem.Frame.Draw();
|
|
21123
|
+
if (overlayItem.Frame.IsShow)
|
|
20846
21124
|
{
|
|
20847
|
-
|
|
20848
|
-
|
|
20849
|
-
if (overlayItem.Frame.IsShow) rightOffset+=item.Interval;
|
|
21125
|
+
rightOffset+=this.FixedRightWidth.Overlay;
|
|
21126
|
+
++index;
|
|
20850
21127
|
}
|
|
21128
|
+
|
|
20851
21129
|
}
|
|
20852
21130
|
}
|
|
20853
21131
|
}
|
|
@@ -21054,6 +21332,7 @@ function HQTradeFrame()
|
|
|
21054
21332
|
{
|
|
21055
21333
|
var overlayItem=item.OverlayIndex[j];
|
|
21056
21334
|
var overlayFrame=overlayItem.Frame;
|
|
21335
|
+
if (!overlayFrame.IsShow) continue;
|
|
21057
21336
|
if (overlayFrame.DrawToolbar) overlayFrame.DrawToolbar(moveonPoint, frame.IsMinSize, mouseStatus);
|
|
21058
21337
|
}
|
|
21059
21338
|
}
|
|
@@ -50539,36 +50818,35 @@ function ChartCorssCursor()
|
|
|
50539
50818
|
if (yValueExtend.FrameID>=0)
|
|
50540
50819
|
{
|
|
50541
50820
|
var frame=this.Frame.SubFrame[yValueExtend.FrameID];
|
|
50542
|
-
var isAutoRightBorder=false;
|
|
50543
|
-
if (this.Frame.AutoRightBorder) isAutoRightBorder=true;
|
|
50544
50821
|
var overlayLeft=right;
|
|
50545
|
-
if (isAutoRightBorder) overlayLeft=right+this.Frame.AuotRightWidth;
|
|
50546
50822
|
this.Canvas.font=this.Font;
|
|
50547
|
-
for(var i
|
|
50823
|
+
for(var i=0; i<frame.OverlayIndex.length; ++i)
|
|
50548
50824
|
{
|
|
50549
50825
|
var item=frame.OverlayIndex[i];
|
|
50550
50826
|
if (item.Frame.IsShow===false) continue;
|
|
50551
50827
|
|
|
50552
|
-
|
|
50828
|
+
overlayLeft=item.Frame.GetXHorizontal();
|
|
50553
50829
|
|
|
50554
|
-
if (overlayLeft+30>chartRight) break;
|
|
50830
|
+
//if (overlayLeft+30>chartRight) break;
|
|
50555
50831
|
var yValue=item.Frame.GetYData(y);
|
|
50556
|
-
|
|
50557
|
-
|
|
50832
|
+
var text=IFrameSplitOperator.FormatValueString(yValue,2);
|
|
50833
|
+
var textWidth=this.Canvas.measureText(text).width+4; //前后各空2个像素
|
|
50834
|
+
|
|
50835
|
+
/*
|
|
50836
|
+
for(var j=2;j>=0;--j)
|
|
50558
50837
|
{
|
|
50559
|
-
var text=IFrameSplitOperator.FormatValueString(yValue,
|
|
50838
|
+
var text=IFrameSplitOperator.FormatValueString(yValue,j);
|
|
50560
50839
|
var textWidth=this.Canvas.measureText(text).width+4; //前后各空2个像素
|
|
50561
50840
|
if (textWidth<frame.Interval) break;
|
|
50562
50841
|
}
|
|
50842
|
+
*/
|
|
50563
50843
|
|
|
50564
50844
|
this.Canvas.fillStyle=this.TextBGColor;
|
|
50565
|
-
this.Canvas.fillRect(overlayLeft+
|
|
50845
|
+
this.Canvas.fillRect(overlayLeft+1,y-this.TextHeight/2,textWidth,this.TextHeight);
|
|
50566
50846
|
this.Canvas.textAlign="left";
|
|
50567
50847
|
this.Canvas.textBaseline="middle";
|
|
50568
50848
|
this.Canvas.fillStyle=this.TextColor;
|
|
50569
50849
|
this.Canvas.fillText(text,overlayLeft+4,y,textWidth);
|
|
50570
|
-
|
|
50571
|
-
if (isAutoRightBorder) overlayLeft+=item.RightWidth.Width;
|
|
50572
50850
|
}
|
|
50573
50851
|
}
|
|
50574
50852
|
|
|
@@ -66625,6 +66903,14 @@ function JSChartResource()
|
|
|
66625
66903
|
if (item.EmptyBGColor) this.FrameLatestPrice.EmptyBGColor = item.EmptyBGColor;
|
|
66626
66904
|
}
|
|
66627
66905
|
|
|
66906
|
+
if (style.OverlayFrame)
|
|
66907
|
+
{
|
|
66908
|
+
var item=style.OverlayFrame;
|
|
66909
|
+
if (style.OverlayFrame.BolderPen) this.OverlayFrame.BolderPen = style.OverlayFrame.BolderPen;
|
|
66910
|
+
if (style.OverlayFrame.TitleColor) this.OverlayFrame.TitleColor = style.OverlayFrame.TitleColor;
|
|
66911
|
+
if (style.OverlayFrame.TitleFont) this.OverlayFrame.TitleFont = style.OverlayFrame.TitleFont;
|
|
66912
|
+
}
|
|
66913
|
+
|
|
66628
66914
|
if (style.CorssCursorBGColor) this.CorssCursorBGColor = style.CorssCursorBGColor;
|
|
66629
66915
|
if (style.CorssCursorTextColor) this.CorssCursorTextColor = style.CorssCursorTextColor;
|
|
66630
66916
|
if (style.CorssCursorTextFont) this.CorssCursorTextFont = style.CorssCursorTextFont;
|
|
@@ -68912,7 +69198,6 @@ function KLineChartContainer(uielement,OffscreenElement)
|
|
|
68912
69198
|
this.CtrlMoveStep=5; //Ctrl+(Left/Right) 移动数据个数
|
|
68913
69199
|
|
|
68914
69200
|
this.CustomShow=null; //首先显示的K线的起始日期 { Date:日期 PageSize:}
|
|
68915
|
-
this.OverlayIndexFrameWidth=60; //叠加指标框架宽度
|
|
68916
69201
|
this.ZoomType=0; //缩放模式 0=最右边固定缩放, 1=十字光标两边缩放
|
|
68917
69202
|
this.IsZoomLockRight=false;
|
|
68918
69203
|
this.KLineSize=null; //{ DataWidth:, }
|
|
@@ -69196,6 +69481,7 @@ function KLineChartContainer(uielement,OffscreenElement)
|
|
|
69196
69481
|
this.UpdataDataoffset();
|
|
69197
69482
|
this.UpdatePointByCursorIndex();
|
|
69198
69483
|
this.UpdateFrameMaxMin();
|
|
69484
|
+
this.ResetFrameXSplit();
|
|
69199
69485
|
this.Draw();
|
|
69200
69486
|
}
|
|
69201
69487
|
else if (id===JSCHART_OPERATOR_ID.OP_GOTO_HOME)
|
|
@@ -69651,6 +69937,7 @@ function KLineChartContainer(uielement,OffscreenElement)
|
|
|
69651
69937
|
{
|
|
69652
69938
|
this.UpdataDataoffset(); //更新数据偏移
|
|
69653
69939
|
this.UpdateFrameMaxMin(); //调整坐标最大 最小值
|
|
69940
|
+
this.ResetFrameXSplit();
|
|
69654
69941
|
this.Frame.SetSizeChage(true);
|
|
69655
69942
|
this.Draw();
|
|
69656
69943
|
this.UpdatePointByCursorIndex(); //更新十字光标位子
|
|
@@ -72521,10 +72808,10 @@ function KLineChartContainer(uielement,OffscreenElement)
|
|
|
72521
72808
|
}
|
|
72522
72809
|
|
|
72523
72810
|
var subFrame=this.Frame.SubFrame[windowIndex];
|
|
72524
|
-
subFrame.Interval=this.OverlayIndexFrameWidth;
|
|
72525
72811
|
var overlayFrame=new OverlayIndexItem();
|
|
72526
72812
|
if (obj.Identify) overlayFrame.Identify=obj.Identify; //由外部指定id
|
|
72527
|
-
var frame= this.ClassName==='KLineChartHScreenContainer' ? new OverlayKLineHScreenFrame() : new OverlayKLineFrame();
|
|
72813
|
+
//var frame= this.ClassName==='KLineChartHScreenContainer' ? new OverlayKLineHScreenFrame() : new OverlayKLineFrame();
|
|
72814
|
+
var frame=this.CreateOverlayFrame();
|
|
72528
72815
|
frame.Canvas=this.Canvas;
|
|
72529
72816
|
frame.MainFrame=subFrame.Frame;
|
|
72530
72817
|
frame.ChartBorder=subFrame.Frame.ChartBorder;
|
|
@@ -72553,11 +72840,18 @@ function KLineChartContainer(uielement,OffscreenElement)
|
|
|
72553
72840
|
var item=obj.Frame;
|
|
72554
72841
|
if (item.Custom) frame.YSplitOperator.Custom=item.Custom;
|
|
72555
72842
|
if (IFrameSplitOperator.IsBool(item.IsYDrawMainFrame)) frame.IsYDrawMainFrame=item.IsYDrawMainFrame; //自定义刻度绘制在主图上
|
|
72556
|
-
if (IFrameSplitOperator.IsBool(item.IsShowToolbar)) frame.IsShowToolbar=item.IsShowToolbar;
|
|
72843
|
+
if (IFrameSplitOperator.IsBool(item.IsShowToolbar)) frame.IsShowToolbar=item.IsShowToolbar; //是否显示工具栏
|
|
72557
72844
|
}
|
|
72558
72845
|
|
|
72559
72846
|
overlayFrame.Frame=frame;
|
|
72560
72847
|
|
|
72848
|
+
var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CREATE_OVERLAY_FRAME);
|
|
72849
|
+
if (event && event.Callback)
|
|
72850
|
+
{
|
|
72851
|
+
var sendData={ OverlayFrame:overlayFrame, WindowIndex:windowIndex, SubFrame:subFrame };
|
|
72852
|
+
event.Callback(event, sendData, this);
|
|
72853
|
+
}
|
|
72854
|
+
|
|
72561
72855
|
if (apiItem)
|
|
72562
72856
|
{
|
|
72563
72857
|
var apiIndex=new APIScriptIndex(apiItem.Name,apiItem.Script,apiItem.Args,obj, true);
|
|
@@ -80364,7 +80658,6 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
80364
80658
|
}
|
|
80365
80659
|
|
|
80366
80660
|
var subFrame=this.Frame.SubFrame[windowIndex];
|
|
80367
|
-
subFrame.Interval=this.OverlayIndexFrameWidth;
|
|
80368
80661
|
var overlayFrame=new OverlayIndexItem();
|
|
80369
80662
|
if (obj.Identify) overlayFrame.Identify=obj.Identify; //由外部指定id
|
|
80370
80663
|
var frame=null;
|
|
@@ -115914,12 +116207,14 @@ function OverlayScriptIndex(name,script,args,option)
|
|
|
115914
116207
|
var titleIndex=windowIndex+1;
|
|
115915
116208
|
var titlePaint=hqChart.TitlePaint[titleIndex];
|
|
115916
116209
|
titlePaint.OverlayIndex.set(this.OverlayIndex.Identify,titleInfo);
|
|
115917
|
-
|
|
116210
|
+
|
|
115918
116211
|
if (this.OutName && this.OutName.length>0 && this.Arguments && this.Arguments.length>0)
|
|
115919
116212
|
{
|
|
115920
116213
|
titlePaint.SetDynamicTitle(this.OutName,this.Arguments, this.OverlayIndex.Identify);
|
|
115921
116214
|
}
|
|
115922
116215
|
|
|
116216
|
+
this.OverlayIndex.Frame.Frame.Title=this.Name; //给子框架设置标题
|
|
116217
|
+
|
|
115923
116218
|
for(var i=0; i<this.OutVar.length; ++i)
|
|
115924
116219
|
{
|
|
115925
116220
|
let item=this.OutVar[i];
|
|
@@ -119790,10 +120085,10 @@ function GetBlackStyle()
|
|
|
119790
120085
|
PositionColor:"rgb(101,104,112)" //持仓
|
|
119791
120086
|
},
|
|
119792
120087
|
|
|
119793
|
-
FrameBorderPen: "
|
|
120088
|
+
FrameBorderPen: "rgb(47,51,62)", //边框
|
|
119794
120089
|
MultiDayBorderPen:"rgba(236,236,236,0.5)",
|
|
119795
120090
|
FrameSplitPen: "rgba(236,236,236,0.13)", //分割线
|
|
119796
|
-
FrameSplitTextColor: "rgb(
|
|
120091
|
+
FrameSplitTextColor: "rgb(220,220,220)", //刻度文字颜色
|
|
119797
120092
|
FrameSplitTextFont: 12*GetDevicePixelRatio() +"px 微软雅黑", //坐标刻度文字字体
|
|
119798
120093
|
FrameTitleBGColor: "rgb(0,0,0)", //标题栏背景色
|
|
119799
120094
|
OverlayIndexTitleBGColor:'rgba(0,0,0,0.7)', //叠加指标背景色
|
|
@@ -119809,8 +120104,15 @@ function GetBlackStyle()
|
|
|
119809
120104
|
SplitColor:"rgb(101,104,112)",
|
|
119810
120105
|
Font:14*GetDevicePixelRatio() +"px 微软雅黑"
|
|
119811
120106
|
}
|
|
119812
|
-
},
|
|
119813
|
-
|
|
120107
|
+
},
|
|
120108
|
+
|
|
120109
|
+
//叠加指标框架
|
|
120110
|
+
OverlayFrame:
|
|
120111
|
+
{
|
|
120112
|
+
BolderPen:'rgb(130,130,130)', //指标边框线
|
|
120113
|
+
TitleColor:'rgb(181,181,181)', //指标名字颜色
|
|
120114
|
+
TitleFont:11*GetDevicePixelRatio() +'px arial', //指标名字字体
|
|
120115
|
+
},
|
|
119814
120116
|
|
|
119815
120117
|
FrameLatestPrice : {
|
|
119816
120118
|
TextColor:'rgb(255,255,255)', //最新价格文字颜色
|
|
@@ -130566,7 +130868,7 @@ function ScrollBarBGChart()
|
|
|
130566
130868
|
|
|
130567
130869
|
|
|
130568
130870
|
|
|
130569
|
-
var HQCHART_VERSION="1.1.
|
|
130871
|
+
var HQCHART_VERSION="1.1.12692";
|
|
130570
130872
|
|
|
130571
130873
|
function PrintHQChartVersion()
|
|
130572
130874
|
{
|