hqchart 1.1.14394 → 1.1.14406
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 +76 -31
- package/package.json +1 -1
- package/src/jscommon/umychart.NetworkFilterTest.js +142 -14
- package/src/jscommon/umychart.js +267 -66
- package/src/jscommon/umychart.testdata/DayMinute/600000.sh.1day.minute.js +1 -1
- package/src/jscommon/umychart.testdata.js +141 -13
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +268 -67
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.NetworkFilterTest.vue.js +142 -14
- package/src/jscommon/umychart.vue/umychart.vue.js +268 -67
|
@@ -4920,6 +4920,15 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
4920
4920
|
}
|
|
4921
4921
|
}
|
|
4922
4922
|
|
|
4923
|
+
if (option.EnableYDrag)
|
|
4924
|
+
{
|
|
4925
|
+
var item=option.EnableYDrag;
|
|
4926
|
+
if (IFrameSplitOperator.IsBool(item.Left)) chart.EnableYDrag.Left=item.Left;
|
|
4927
|
+
if (IFrameSplitOperator.IsBool(item.Right)) chart.EnableYDrag.Right=item.Right;
|
|
4928
|
+
if (IFrameSplitOperator.IsBool(item.Wheel)) chart.EnableYDrag.Wheel=item.Wheel;
|
|
4929
|
+
if (IFrameSplitOperator.IsNumber(item.WheelYMove)) chart.EnableYDrag.WheelYMove=item.WheelYMove;
|
|
4930
|
+
}
|
|
4931
|
+
|
|
4923
4932
|
//分页
|
|
4924
4933
|
if (option.PageInfo) chart.SetPageInfo(option.PageInfo);
|
|
4925
4934
|
|
|
@@ -4995,7 +5004,6 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
4995
5004
|
}
|
|
4996
5005
|
if (item.Height>=0) chart.Frame.SubFrame[i].Height = item.Height;
|
|
4997
5006
|
if (item.Custom) chart.Frame.SubFrame[i].Frame.YSplitOperator.Custom=item.Custom;
|
|
4998
|
-
if (item.RightTextFormat>0) chart.Frame.SubFrame[i].Frame.YSplitOperator.RightTextFormat=item.RightTextFormat;
|
|
4999
5007
|
if (IFrameSplitOperator.IsNumber(item.TitleHeight)) chart.Frame.SubFrame[i].Frame.ChartBorder.TitleHeight=item.TitleHeight;
|
|
5000
5008
|
if (IFrameSplitOperator.IsNumber(item.BorderLine)) chart.Frame.SubFrame[i].Frame.BorderLine=item.BorderLine;
|
|
5001
5009
|
if (IFrameSplitOperator.IsBool(item.EnableRemoveZero)) chart.Frame.SubFrame[i].Frame.YSplitOperator.EnableRemoveZero=item.EnableRemoveZero;
|
|
@@ -5013,6 +5021,15 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
5013
5021
|
|
|
5014
5022
|
if (item.ClientBGColor) subFrame.ClientBGColor=item.ClientBGColor;
|
|
5015
5023
|
if (!IFrameSplitOperator.IsUndefined(item.HorizontalReserved)) subFrame.HorizontalReserved=item.HorizontalReserved;
|
|
5024
|
+
|
|
5025
|
+
if (i==0)
|
|
5026
|
+
{
|
|
5027
|
+
if (IFrameSplitOperator.IsNumber(item.RightTextFormat))
|
|
5028
|
+
{
|
|
5029
|
+
subFrame.YSplitOperator.RightTextFormat=item.RightTextFormat;
|
|
5030
|
+
if (item.RightTextFormat==2) subFrame.MultiTextFormat=1;
|
|
5031
|
+
}
|
|
5032
|
+
}
|
|
5016
5033
|
}
|
|
5017
5034
|
|
|
5018
5035
|
chart.UpdateXShowText();
|
|
@@ -16405,7 +16422,7 @@ function AverageWidthFrame()
|
|
|
16405
16422
|
var item=aryText[i];
|
|
16406
16423
|
var message=item.Item;
|
|
16407
16424
|
|
|
16408
|
-
this.Canvas.textBaseline=
|
|
16425
|
+
this.Canvas.textBaseline=item.TextBaseline;
|
|
16409
16426
|
if (message.ExtendData && message.ExtendData.Font) this.Canvas.font=message.ExtendData.Font;
|
|
16410
16427
|
else if (message.Font) this.Canvas.font=message.Font;
|
|
16411
16428
|
|
|
@@ -18028,20 +18045,17 @@ function AverageWidthFrame()
|
|
|
18028
18045
|
|
|
18029
18046
|
if (Array.isArray(item.Message[1]))
|
|
18030
18047
|
{
|
|
18031
|
-
if (this.MultiTextFormat==1) //显示1行 格式:价格/百分比
|
|
18048
|
+
if (this.MultiTextFormat==1 && IFrameSplitOperator.IsNonEmptyArray(item.Message[1])) //显示1行 格式:价格/百分比
|
|
18032
18049
|
{
|
|
18033
|
-
if (item.ExtendData)
|
|
18034
|
-
|
|
18035
|
-
|
|
18036
|
-
|
|
18037
|
-
|
|
18038
|
-
|
|
18039
|
-
|
|
18040
|
-
|
|
18041
|
-
if (rightExtendWidth<width2) rightExtendWidth=width2;
|
|
18050
|
+
if (item.ExtendData && item.ExtendData.Font) this.Canvas.font=item.ExtendData.Font;
|
|
18051
|
+
|
|
18052
|
+
var width1=this.Canvas.measureText(item.Message[1][0]).width;
|
|
18053
|
+
var width2=this.Canvas.measureText(item.Message[1][1]).width;
|
|
18054
|
+
var width3=this.Canvas.measureText('/').width;
|
|
18055
|
+
textWidth=width1+width3;
|
|
18056
|
+
if (rightExtendWidth<width2) rightExtendWidth=width2;
|
|
18042
18057
|
|
|
18043
|
-
|
|
18044
|
-
}
|
|
18058
|
+
//JSConsole.Chart.Log(`[ChartData::GetScaleTextWidth] ${item.Message[1][1]}/${item.Message[1][0]} ${textWidth}, ${rightExtendWidth}`);
|
|
18045
18059
|
}
|
|
18046
18060
|
else if (this.MultiTextFormat==2) //显示2行
|
|
18047
18061
|
{
|
|
@@ -41066,7 +41080,7 @@ function ChartMinutePriceLine()
|
|
|
41066
41080
|
if (value==null) continue;
|
|
41067
41081
|
|
|
41068
41082
|
var x=this.ChartFrame.GetXFromIndex(j);
|
|
41069
|
-
var y=this.ChartFrame.GetYFromData(value);
|
|
41083
|
+
var y=this.ChartFrame.GetYFromData(value,false);
|
|
41070
41084
|
|
|
41071
41085
|
if (bFirstPoint)
|
|
41072
41086
|
{
|
|
@@ -56303,7 +56317,7 @@ function FrameSplitMinutePriceY()
|
|
|
56303
56317
|
this.DefaultSplitType=0;
|
|
56304
56318
|
this.LimitPrice; //{Max: Min:} 涨跌停价
|
|
56305
56319
|
this.Custom;
|
|
56306
|
-
this.RightTextFormat=0; //右边刻度显示模式 0=百分比 1=价格
|
|
56320
|
+
this.RightTextFormat=0; //右边刻度显示模式 0=百分比 1=价格 2=价格 | 百分比
|
|
56307
56321
|
|
|
56308
56322
|
this.BeforeOpenData;
|
|
56309
56323
|
this.IsBeforeData=false;
|
|
@@ -56319,9 +56333,12 @@ function FrameSplitMinutePriceY()
|
|
|
56319
56333
|
this.GlobalOption;
|
|
56320
56334
|
this.HQChart;
|
|
56321
56335
|
|
|
56336
|
+
this.FixedYMaxMin; //{ Max, Min} 固定Y轴最大最小值
|
|
56337
|
+
this.EnableZoomUpDown=false;
|
|
56338
|
+
|
|
56322
56339
|
this.IsEnableDragY=function()
|
|
56323
56340
|
{
|
|
56324
|
-
return
|
|
56341
|
+
return true;
|
|
56325
56342
|
}
|
|
56326
56343
|
|
|
56327
56344
|
this.Operator=function()
|
|
@@ -56330,23 +56347,35 @@ function FrameSplitMinutePriceY()
|
|
|
56330
56347
|
this.Frame.CustomHorizontalInfo=[];
|
|
56331
56348
|
if (!this.Data) return;
|
|
56332
56349
|
|
|
56333
|
-
var range=
|
|
56350
|
+
var range=null;
|
|
56351
|
+
var isFixedMaxMin=(this.FixedYMaxMin && IFrameSplitOperator.IsNumber(this.FixedYMaxMin.Max) && IFrameSplitOperator.IsNumber(this.FixedYMaxMin.Min));
|
|
56352
|
+
if (isFixedMaxMin)
|
|
56353
|
+
{
|
|
56354
|
+
range={ Max:this.FixedYMaxMin.Max, Min:this.FixedYMaxMin.Min };
|
|
56355
|
+
JSConsole.Chart.Log(`[FrameSplitMinutePriceY::Operator] FixedYMaxMin.Max=${this.FixedYMaxMin.Max} FixedYMaxMin.Min=${this.FixedYMaxMin.Min} `);
|
|
56356
|
+
}
|
|
56357
|
+
else
|
|
56358
|
+
{
|
|
56359
|
+
range=this.GetMaxMin();
|
|
56360
|
+
}
|
|
56334
56361
|
|
|
56335
56362
|
if (this.Symbol && MARKET_SUFFIX_NAME.IsUSA(this.Symbol.toUpperCase()))
|
|
56336
56363
|
{
|
|
56337
|
-
this.USASplit(range);
|
|
56364
|
+
this.USASplit(range,isFixedMaxMin);
|
|
56338
56365
|
}
|
|
56339
56366
|
else if (this.SplitType==2)
|
|
56340
56367
|
{
|
|
56341
|
-
this.USASplit(range);
|
|
56368
|
+
this.USASplit(range,isFixedMaxMin);
|
|
56342
56369
|
}
|
|
56343
56370
|
else
|
|
56344
56371
|
{
|
|
56345
|
-
this.DefaultSplit(range);
|
|
56372
|
+
this.DefaultSplit(range,isFixedMaxMin);
|
|
56346
56373
|
}
|
|
56347
56374
|
|
|
56348
56375
|
this.CustomCoordinate();
|
|
56349
56376
|
|
|
56377
|
+
if (this.EnableZoomUpDown==true && !this.FixedYMaxMin) this.FixedYMaxMin={ Max:range.Max, Min:range.Min };
|
|
56378
|
+
|
|
56350
56379
|
this.ReservedHeight({ Max:this.Frame.HorizontalMax, Min:this.Frame.HorizontalMin }); //预留高度
|
|
56351
56380
|
|
|
56352
56381
|
if (this.GetEventCallback)
|
|
@@ -56734,21 +56763,7 @@ function FrameSplitMinutePriceY()
|
|
|
56734
56763
|
if (this.YClose && price==this.YClose) continue;
|
|
56735
56764
|
var coordinate=new CoordinateInfo();
|
|
56736
56765
|
coordinate.Value=price;
|
|
56737
|
-
|
|
56738
|
-
if (this.IsShowLeftText) coordinate.Message[0]=strPrice;
|
|
56739
|
-
|
|
56740
|
-
if (this.YClose && this.YClose!=0)
|
|
56741
|
-
{
|
|
56742
|
-
var per=(price/this.YClose-1)*100;
|
|
56743
|
-
if (per>0) coordinate.TextColor=g_JSChartResource.UpTextColor;
|
|
56744
|
-
else if (per<0) coordinate.TextColor=g_JSChartResource.DownTextColor;
|
|
56745
|
-
if (this.IsShowRightText)
|
|
56746
|
-
{
|
|
56747
|
-
if (this.RightTextFormat==1) coordinate.Message[1]=strPrice;
|
|
56748
|
-
else coordinate.Message[1]=IFrameSplitOperator.FormatValueString(per,2)+'%'; //百分比
|
|
56749
|
-
}
|
|
56750
|
-
}
|
|
56751
|
-
|
|
56766
|
+
this.FormatCoordinate(coordinate,defaultfloatPrecision);
|
|
56752
56767
|
this.Frame.HorizontalInfo.push(coordinate);
|
|
56753
56768
|
}
|
|
56754
56769
|
|
|
@@ -56777,22 +56792,25 @@ function FrameSplitMinutePriceY()
|
|
|
56777
56792
|
this.Frame.HorizontalMin=min;
|
|
56778
56793
|
}
|
|
56779
56794
|
|
|
56780
|
-
this.DefaultSplit=function(range)
|
|
56795
|
+
this.DefaultSplit=function(range,isFixedMaxMin)
|
|
56781
56796
|
{
|
|
56782
56797
|
var max=range.Max;
|
|
56783
56798
|
var min=range.Min;
|
|
56784
56799
|
|
|
56785
|
-
if (
|
|
56800
|
+
if (!isFixedMaxMin)
|
|
56786
56801
|
{
|
|
56787
|
-
|
|
56788
|
-
|
|
56789
|
-
|
|
56790
|
-
|
|
56791
|
-
|
|
56792
|
-
|
|
56793
|
-
|
|
56794
|
-
|
|
56795
|
-
|
|
56802
|
+
if (this.YClose==max && this.YClose==min)
|
|
56803
|
+
{
|
|
56804
|
+
max=this.YClose+this.YClose*0.1;
|
|
56805
|
+
min=this.YClose-this.YClose*0.1
|
|
56806
|
+
}
|
|
56807
|
+
else
|
|
56808
|
+
{
|
|
56809
|
+
var distanceValue=Math.max(Math.abs(this.YClose-max),Math.abs(this.YClose-min));
|
|
56810
|
+
max=this.YClose+distanceValue;
|
|
56811
|
+
min=this.YClose-distanceValue;
|
|
56812
|
+
if (min<0) min=range.Min;
|
|
56813
|
+
}
|
|
56796
56814
|
}
|
|
56797
56815
|
|
|
56798
56816
|
var pixelTatio = GetDevicePixelRatio(); //获取设备的分辨率
|
|
@@ -56805,13 +56823,34 @@ function FrameSplitMinutePriceY()
|
|
|
56805
56823
|
const minDistance=[1, 0.1, 0.01, 0.001, 0.0001];
|
|
56806
56824
|
var defaultfloatPrecision=GetfloatPrecision(this.Symbol);
|
|
56807
56825
|
if (isPhoneModel && MARKET_SUFFIX_NAME.IsSHSZIndex(this.Symbol)) defaultfloatPrecision = 0; //手机端指数不显示小数位数,太长了
|
|
56808
|
-
if (distance<minDistance[defaultfloatPrecision])
|
|
56826
|
+
if (distance<minDistance[defaultfloatPrecision] && !isFixedMaxMin)
|
|
56809
56827
|
{
|
|
56810
56828
|
distance=minDistance[defaultfloatPrecision];
|
|
56811
56829
|
max=this.YClose+(distance*(showCount-1)/2);
|
|
56812
56830
|
min=this.YClose-(distance*(showCount-1)/2);
|
|
56813
56831
|
}
|
|
56814
56832
|
|
|
56833
|
+
var aryCoordinate=[];
|
|
56834
|
+
var extendValue=distance*0.5;
|
|
56835
|
+
for(var price=this.YClose, i=0; price<=max+extendValue && i<30; price+=distance, ++i)
|
|
56836
|
+
{
|
|
56837
|
+
var coordinate=new CoordinateInfo();
|
|
56838
|
+
coordinate.Value=price;
|
|
56839
|
+
this.FormatCoordinate(coordinate,defaultfloatPrecision);
|
|
56840
|
+
aryCoordinate.push(coordinate);
|
|
56841
|
+
}
|
|
56842
|
+
|
|
56843
|
+
for(var price=this.YClose-distance, i=0; price>=min-extendValue && i<30; price-=distance, ++i)
|
|
56844
|
+
{
|
|
56845
|
+
var coordinate=new CoordinateInfo();
|
|
56846
|
+
coordinate.Value=price;
|
|
56847
|
+
this.FormatCoordinate(coordinate,defaultfloatPrecision);
|
|
56848
|
+
aryCoordinate.push(coordinate);
|
|
56849
|
+
}
|
|
56850
|
+
|
|
56851
|
+
aryCoordinate.sort((left,right)=>{ return left.Value-right.Value; })
|
|
56852
|
+
|
|
56853
|
+
/*
|
|
56815
56854
|
for(var i=0;i<showCount;++i)
|
|
56816
56855
|
{
|
|
56817
56856
|
var price=min+(distance*i);
|
|
@@ -56826,11 +56865,21 @@ function FrameSplitMinutePriceY()
|
|
|
56826
56865
|
var per=(price/this.YClose-1)*100;
|
|
56827
56866
|
if (per>0) coordinate.TextColor=g_JSChartResource.UpTextColor;
|
|
56828
56867
|
else if (per<0) coordinate.TextColor=g_JSChartResource.DownTextColor;
|
|
56829
|
-
|
|
56868
|
+
var strPer=`${IFrameSplitOperator.FormatValueString(per,2)}%`;
|
|
56830
56869
|
if (this.IsShowRightText)
|
|
56831
56870
|
{
|
|
56832
|
-
if (this.RightTextFormat==1)
|
|
56833
|
-
|
|
56871
|
+
if (this.RightTextFormat==1)
|
|
56872
|
+
{
|
|
56873
|
+
coordinate.Message[1]=strPrice;
|
|
56874
|
+
}
|
|
56875
|
+
else if (this.RightTextFormat==2) //价格/百分比
|
|
56876
|
+
{
|
|
56877
|
+
coordinate.Message[1]=[strPer,strPrice];
|
|
56878
|
+
}
|
|
56879
|
+
else
|
|
56880
|
+
{
|
|
56881
|
+
coordinate.Message[1]=strPer; //百分比
|
|
56882
|
+
}
|
|
56834
56883
|
}
|
|
56835
56884
|
|
|
56836
56885
|
if (Math.abs(price-this.YClose) <0.00000000001) //小数有精度问题 使用差值
|
|
@@ -56840,13 +56889,51 @@ function FrameSplitMinutePriceY()
|
|
|
56840
56889
|
if (g_JSChartResource.FrameDotSplitPen) coordinate.LineColor=g_JSChartResource.FrameDotSplitPen;
|
|
56841
56890
|
}
|
|
56842
56891
|
}
|
|
56843
|
-
|
|
56844
|
-
}
|
|
56892
|
+
}*/
|
|
56845
56893
|
|
|
56894
|
+
this.Frame.HorizontalInfo=aryCoordinate;
|
|
56846
56895
|
this.Frame.HorizontalMax=max;
|
|
56847
56896
|
this.Frame.HorizontalMin=min;
|
|
56848
56897
|
}
|
|
56849
56898
|
|
|
56899
|
+
this.FormatCoordinate=function(coordinate, defaultfloatPrecision)
|
|
56900
|
+
{
|
|
56901
|
+
var price=coordinate.Value;
|
|
56902
|
+
var strPrice=price.toFixed(defaultfloatPrecision); //价格刻度字符串
|
|
56903
|
+
if (this.IsShowLeftText) coordinate.Message[0]=strPrice;
|
|
56904
|
+
|
|
56905
|
+
if (IFrameSplitOperator.IsNumber(this.YClose) && this.YClose!=0)
|
|
56906
|
+
{
|
|
56907
|
+
var per=(price/this.YClose-1)*100;
|
|
56908
|
+
if (per>0) coordinate.TextColor=g_JSChartResource.UpTextColor;
|
|
56909
|
+
else if (per<0) coordinate.TextColor=g_JSChartResource.DownTextColor;
|
|
56910
|
+
var strPer=`${IFrameSplitOperator.FormatValueString(per,2)}%`;
|
|
56911
|
+
|
|
56912
|
+
if (this.IsShowRightText)
|
|
56913
|
+
{
|
|
56914
|
+
if (this.RightTextFormat==1)
|
|
56915
|
+
{
|
|
56916
|
+
coordinate.Message[1]=strPrice;
|
|
56917
|
+
}
|
|
56918
|
+
else if (this.RightTextFormat==2) //价格/百分比
|
|
56919
|
+
{
|
|
56920
|
+
coordinate.Message[1]=[strPer,strPrice];
|
|
56921
|
+
}
|
|
56922
|
+
else
|
|
56923
|
+
{
|
|
56924
|
+
coordinate.Message[1]=strPer; //百分比
|
|
56925
|
+
}
|
|
56926
|
+
}
|
|
56927
|
+
|
|
56928
|
+
if (Math.abs(price-this.YClose) <0.00000000001) //小数有精度问题 使用差值
|
|
56929
|
+
{
|
|
56930
|
+
coordinate.LineType=2;//中间的线画虚线
|
|
56931
|
+
coordinate.TextColor=g_JSChartResource.UnchagneTextColor;
|
|
56932
|
+
if (g_JSChartResource.FrameDotSplitPen) coordinate.LineColor=g_JSChartResource.FrameDotSplitPen;
|
|
56933
|
+
}
|
|
56934
|
+
}
|
|
56935
|
+
}
|
|
56936
|
+
|
|
56850
56937
|
}
|
|
56851
56938
|
|
|
56852
56939
|
function FrameSplitMinuteX()
|
|
@@ -87544,14 +87631,30 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
87544
87631
|
var moveSetp=moveData.X;
|
|
87545
87632
|
var yMoveSetp=moveData.Y;
|
|
87546
87633
|
|
|
87547
|
-
|
|
87634
|
+
var bNeedDraw=true;
|
|
87635
|
+
if (this.UpDownDrag && this.UpDownDrag.Index>=0)
|
|
87636
|
+
{
|
|
87637
|
+
if (yMoveSetp>=5)
|
|
87638
|
+
{
|
|
87639
|
+
var yMove=e.clientY-drag.LastMove.Y;
|
|
87640
|
+
JSConsole.Chart.Log("[MinuteChartContainer::OnDragMode_One] UpDownDrag ",this.UpDownDrag,yMove);
|
|
87641
|
+
//this.UIElement.style.cursor="pointer";
|
|
87642
|
+
this.SetCursor({Cursor:"pointer"});
|
|
87643
|
+
if (this.OnUpDonwFrameY(this.UpDownDrag, yMove))
|
|
87644
|
+
{
|
|
87645
|
+
drag.LastMove.Y=e.clientY;
|
|
87646
|
+
bNeedDraw=true;
|
|
87647
|
+
}
|
|
87648
|
+
}
|
|
87649
|
+
}
|
|
87650
|
+
else if (this.RectSelectDrag && this.RectSelectDrag.Index>=0) //区间选择
|
|
87548
87651
|
{
|
|
87549
87652
|
if (moveSetp<5) return;
|
|
87550
87653
|
var obj={ X:e.clientX, Y:e.clientY, PointIndex:this.RectSelectDrag.Index, Name:"MoveRectSelectLine" };
|
|
87551
87654
|
if (this.MoveRectSelectPoint(obj))
|
|
87552
87655
|
{
|
|
87553
87656
|
drag.LastMove.X=e.clientX;
|
|
87554
|
-
|
|
87657
|
+
bNeedDraw=true;
|
|
87555
87658
|
}
|
|
87556
87659
|
}
|
|
87557
87660
|
else
|
|
@@ -87569,6 +87672,8 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
87569
87672
|
drag.LastMove.X=e.clientX;
|
|
87570
87673
|
drag.LastMove.Y=e.clientY;
|
|
87571
87674
|
}
|
|
87675
|
+
|
|
87676
|
+
if (bNeedDraw) this.Draw();
|
|
87572
87677
|
}
|
|
87573
87678
|
|
|
87574
87679
|
this.OnMinuteSelectRectMouseUp=function(e)
|
|
@@ -87586,8 +87691,12 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
87586
87691
|
selectData.YEnd=(drag.LastMove.Y-uielement.getBoundingClientRect().top)*pixelTatio;
|
|
87587
87692
|
selectData.JSChartContainer=this;
|
|
87588
87693
|
selectData.Stock={Symbol:this.Symbol, Name:this.Name};
|
|
87694
|
+
|
|
87695
|
+
if (this.UpDownDrag)
|
|
87696
|
+
{
|
|
87589
87697
|
|
|
87590
|
-
|
|
87698
|
+
}
|
|
87699
|
+
else if (this.EnableSelectRect && !this.BorderDrag && this.GetSelectRectData(selectData))
|
|
87591
87700
|
{
|
|
87592
87701
|
var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_SELECT_RECT);
|
|
87593
87702
|
var paint=this.GetRectSelectPaint();
|
|
@@ -87958,25 +88067,83 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
87958
88067
|
}
|
|
87959
88068
|
}
|
|
87960
88069
|
|
|
88070
|
+
|
|
88071
|
+
this.GetDataIndexByDatTime=function(date, time)
|
|
88072
|
+
{
|
|
88073
|
+
var result={ DayIndex:-1, DataIndex:-1, Index:-1 };
|
|
88074
|
+
var frame=this.Frame.SubFrame[0].Frame;
|
|
88075
|
+
var minCount=frame.MinuteCount; //每天的分钟个数
|
|
88076
|
+
var kData=this.GetKData();
|
|
88077
|
+
for(var i=0;i<kData.Data.length;++i)
|
|
88078
|
+
{
|
|
88079
|
+
var minItem=kData.Data[i];
|
|
88080
|
+
if (!minItem) continue;
|
|
88081
|
+
|
|
88082
|
+
if (minItem.Date==date && minItem.Time==time)
|
|
88083
|
+
{
|
|
88084
|
+
result.Index=i;
|
|
88085
|
+
result.DayIndex=parseInt(i/minCount);
|
|
88086
|
+
result.DataIndex=i%minCount;
|
|
88087
|
+
break;
|
|
88088
|
+
}
|
|
88089
|
+
}
|
|
88090
|
+
|
|
88091
|
+
return result;
|
|
88092
|
+
}
|
|
88093
|
+
|
|
88094
|
+
//获取十字光标位置 通过日期和时间 目前只支持连续交易时间段
|
|
88095
|
+
this.GetCorssCursorIndexByDateTime=function(date, time)
|
|
88096
|
+
{
|
|
88097
|
+
var border=this.Frame.ChartBorder.GetBorder();
|
|
88098
|
+
|
|
88099
|
+
if (border.DayBorder) //多日分时主图+多日集合竞价
|
|
88100
|
+
{
|
|
88101
|
+
var corssCursorIndex=this.GetDataIndexByDatTime(date, time);
|
|
88102
|
+
corssCursorIndex.Type=10;
|
|
88103
|
+
}
|
|
88104
|
+
else //单日,多日
|
|
88105
|
+
{
|
|
88106
|
+
var corssCursorIndex=this.GetDataIndexByDatTime(date, time);
|
|
88107
|
+
corssCursorIndex.Type=1;
|
|
88108
|
+
corssCursorIndex.DayIndex=0;
|
|
88109
|
+
corssCursorIndex.DataIndex=corssCursorIndex.Index;
|
|
88110
|
+
}
|
|
88111
|
+
|
|
88112
|
+
return corssCursorIndex;
|
|
88113
|
+
}
|
|
88114
|
+
|
|
87961
88115
|
this.LockCorssCursor=function(option)
|
|
87962
88116
|
{
|
|
87963
88117
|
var xItem=this.GlobalOption.LockCorssCursor.X;
|
|
88118
|
+
|
|
88119
|
+
var corssCursorIndex={ DayIndex:-1, DataIndex:-1, Type:-1, Index:this.CursorIndex };
|
|
88120
|
+
if (this.EnableNewIndex)
|
|
88121
|
+
{
|
|
88122
|
+
corssCursorIndex.Type=this.CorssCursorIndex.Type;
|
|
88123
|
+
corssCursorIndex.DayIndex=this.CorssCursorIndex.DayIndex;
|
|
88124
|
+
corssCursorIndex.DataIndex=this.CorssCursorIndex.DataIndex;
|
|
88125
|
+
}
|
|
88126
|
+
|
|
88127
|
+
if (option && option.KItem) //指定日期时间
|
|
88128
|
+
{
|
|
88129
|
+
corssCursorIndex=this.GetCorssCursorIndexByDateTime(option.KItem.Date, option.KItem.Time);
|
|
88130
|
+
}
|
|
87964
88131
|
|
|
87965
88132
|
if (this.EnableNewIndex)
|
|
87966
88133
|
{
|
|
87967
|
-
if (
|
|
88134
|
+
if (corssCursorIndex.Type!=1 && corssCursorIndex.Type!=10) return false; //目前只支持连续交易时间段
|
|
87968
88135
|
|
|
87969
88136
|
xItem.Minute=
|
|
87970
88137
|
{
|
|
87971
|
-
DayIndex:
|
|
87972
|
-
DataIndex:
|
|
87973
|
-
Type:
|
|
87974
|
-
CursorIndex:
|
|
88138
|
+
DayIndex:corssCursorIndex.DayIndex,
|
|
88139
|
+
DataIndex:corssCursorIndex.DataIndex,
|
|
88140
|
+
Type:corssCursorIndex.Type,
|
|
88141
|
+
CursorIndex:corssCursorIndex.Index,
|
|
87975
88142
|
};
|
|
87976
88143
|
}
|
|
87977
88144
|
else
|
|
87978
88145
|
{
|
|
87979
|
-
xItem.Minute={ CursorIndex:
|
|
88146
|
+
xItem.Minute={ CursorIndex:corssCursorIndex.Index };
|
|
87980
88147
|
}
|
|
87981
88148
|
|
|
87982
88149
|
xItem.Enable=true;
|
|
@@ -88052,12 +88219,16 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
88052
88219
|
var x=null;
|
|
88053
88220
|
var dayIndex=corssCursorIndex.DayIndex;
|
|
88054
88221
|
var dataIndex=corssCursorIndex.DataIndex;
|
|
88055
|
-
|
|
88222
|
+
var frame=this.Frame.SubFrame[0].Frame;
|
|
88223
|
+
switch(corssCursorIndex.Type) //单日,多日 1=主图 2=盘前 3=盘后 //多日+多日集合竞价 10=主图 20=盘前 30=盘后
|
|
88056
88224
|
{
|
|
88057
|
-
case 1:
|
|
88058
|
-
case 10: //多日 10=主图
|
|
88225
|
+
case 1: //单日,多日 1=主图
|
|
88059
88226
|
x=this.Frame.GetXFromIndex(dataIndex)
|
|
88060
88227
|
break;
|
|
88228
|
+
case 10: //多日+多日集合竞价 10=主图
|
|
88229
|
+
var cursorIndex=frame.MinuteCount*dayIndex+dataIndex;
|
|
88230
|
+
x=this.Frame.GetXFromIndex(cursorIndex);
|
|
88231
|
+
break;
|
|
88061
88232
|
/*
|
|
88062
88233
|
case 2: //单日 2=盘前
|
|
88063
88234
|
x=this.Frame.SubFrame[0].Frame.GetLeftExtendXFromIndex(dataIndex,this.GetBeforeOpenData());
|
|
@@ -88855,6 +89026,17 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
88855
89026
|
var bShowCorss=false; //十字光标十字线
|
|
88856
89027
|
if (this.ChartCorssCursor) bShowCorss=this.ChartCorssCursor.IsShowCorss;
|
|
88857
89028
|
|
|
89029
|
+
var minItem=null;
|
|
89030
|
+
if (frameID>=0 && option && IFrameSplitOperator.IsNumber(option.CursorIndex))
|
|
89031
|
+
{
|
|
89032
|
+
var kData=this.GetKData();
|
|
89033
|
+
if (kData && IFrameSplitOperator.IsNonEmptyArray(kData.Data))
|
|
89034
|
+
{
|
|
89035
|
+
var dataIndex=kData.DataOffset+parseInt(option.CursorIndex.toFixed(0));
|
|
89036
|
+
if (dataIndex>=0 && dataIndex<kData.Data.length) minItem=kData.Data[dataIndex];
|
|
89037
|
+
}
|
|
89038
|
+
}
|
|
89039
|
+
|
|
88858
89040
|
var aryMenu=
|
|
88859
89041
|
[
|
|
88860
89042
|
{
|
|
@@ -88986,7 +89168,14 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
88986
89168
|
}
|
|
88987
89169
|
else if (item.Name=="其他设置")
|
|
88988
89170
|
{
|
|
88989
|
-
|
|
89171
|
+
if (minItem)
|
|
89172
|
+
{
|
|
89173
|
+
var bLocked=this.IsLockCorssCursor();
|
|
89174
|
+
if (bLocked)
|
|
89175
|
+
item.SubMenu.push({ Name:"锁十字光标", Data:{ ID: JSCHART_MENU_ID.CMD_UNLOCK_CROSSCURSOR }, Checked:bLocked });
|
|
89176
|
+
else
|
|
89177
|
+
item.SubMenu.push({ Name:"锁十字光标", Data:{ ID: JSCHART_MENU_ID.CMD_LOCK_CROSSCURSOR, Args:[{ KItem:{Date:minItem.Date, Time:minItem.Time}, Draw:true }] }, Checked:bLocked });
|
|
89178
|
+
}
|
|
88990
89179
|
}
|
|
88991
89180
|
}
|
|
88992
89181
|
|
|
@@ -89002,6 +89191,18 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
89002
89191
|
{
|
|
89003
89192
|
JSConsole.Chart.Log("[MinuteChartContainer::OnDoubleClick]", e);
|
|
89004
89193
|
|
|
89194
|
+
if (this.EnableYDrag && (this.EnableYDrag.Left || this.EnableYDrag.Right) && this.Frame && this.Frame.PtInFrameY)
|
|
89195
|
+
{
|
|
89196
|
+
var pixelTatio = GetDevicePixelRatio();
|
|
89197
|
+
var x = (e.clientX-this.UIElement.getBoundingClientRect().left)*pixelTatio;
|
|
89198
|
+
var y = (e.clientY-this.UIElement.getBoundingClientRect().top)*pixelTatio;
|
|
89199
|
+
var dragY=this.Frame.PtInFrameY(x,y);
|
|
89200
|
+
if (dragY && dragY.Index>=0)
|
|
89201
|
+
{
|
|
89202
|
+
this.CancelZoomUpDownFrameY(dragY);
|
|
89203
|
+
}
|
|
89204
|
+
}
|
|
89205
|
+
|
|
89005
89206
|
if (this.ClickChartTimer!=null)
|
|
89006
89207
|
{
|
|
89007
89208
|
clearTimeout(this.ClickChartTimer);
|
|
@@ -152986,7 +153187,7 @@ function HQChartScriptWorker()
|
|
|
152986
153187
|
|
|
152987
153188
|
|
|
152988
153189
|
|
|
152989
|
-
var HQCHART_VERSION="1.1.
|
|
153190
|
+
var HQCHART_VERSION="1.1.14405";
|
|
152990
153191
|
|
|
152991
153192
|
function PrintHQChartVersion()
|
|
152992
153193
|
{
|