hqchart 1.1.14696 → 1.1.14711
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.
|
@@ -4525,6 +4525,15 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
4525
4525
|
}
|
|
4526
4526
|
}
|
|
4527
4527
|
|
|
4528
|
+
if (option.FastSlide)
|
|
4529
|
+
{
|
|
4530
|
+
var item=option.FastSlide;
|
|
4531
|
+
if (IFrameSplitOperator.IsNumber(item.MinDistance)) chart.FastSlideConfig.MinDistance=item.MinDistance;
|
|
4532
|
+
if (IFrameSplitOperator.IsNumber(item.MinSpeed)) chart.FastSlideConfig.MinSpeed=item.MinSpeed;
|
|
4533
|
+
if (IFrameSplitOperator.IsNumber(item.MaxTime)) chart.FastSlideConfig.MaxTime=item.MaxTime;
|
|
4534
|
+
if (IFrameSplitOperator.IsBool(item.Enable)) chart.FastSlideConfig.Enable=item.Enable;
|
|
4535
|
+
}
|
|
4536
|
+
|
|
4528
4537
|
if (chart.ClassName=="KLineChartContainer")
|
|
4529
4538
|
{
|
|
4530
4539
|
if (!option.DragSelectRect)
|
|
@@ -4593,6 +4602,12 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
4593
4602
|
if (IFrameSplitOperator.IsBool(item.RightButton.Enable)) chart.ChartCorssCursor.RightButton.Enable=item.RightButton.Enable;
|
|
4594
4603
|
}
|
|
4595
4604
|
|
|
4605
|
+
if (item.BottomButton)
|
|
4606
|
+
{
|
|
4607
|
+
var subItem=item.BottomButton;
|
|
4608
|
+
if (IFrameSplitOperator.IsBool(subItem.Enable)) chart.ChartCorssCursor.BottomButton.Enable=subItem.Enable;
|
|
4609
|
+
}
|
|
4610
|
+
|
|
4596
4611
|
if (IFrameSplitOperator.IsNumber(item.PriceFormatType)) chart.ChartCorssCursor.StringFormatY.PriceFormatType=item.PriceFormatType;
|
|
4597
4612
|
if (IFrameSplitOperator.IsNumber(item.DataFormatType)) chart.ChartCorssCursor.StringFormatY.DataFormatType=item.DataFormatType;
|
|
4598
4613
|
if (IFrameSplitOperator.IsBool(item.EnableKeyboard)) chart.ChartCorssCursor.EnableKeyboard=item.EnableKeyboard;
|
|
@@ -4694,7 +4709,8 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
4694
4709
|
if(option.KLineTitle.IsShowName==false) chart.TitlePaint[0].IsShowName=false;
|
|
4695
4710
|
if(option.KLineTitle.IsShowSettingInfo==false) chart.TitlePaint[0].IsShowSettingInfo=false;
|
|
4696
4711
|
if(option.KLineTitle.IsShow == false) chart.TitlePaint[0].IsShow = false;
|
|
4697
|
-
if(IFrameSplitOperator.IsBool(item.
|
|
4712
|
+
if (IFrameSplitOperator.IsBool(item.IsShowDateTime)) chartTitle.IsShowDateTime=item.IsShowDateTime;
|
|
4713
|
+
if (IFrameSplitOperator.IsBool(item.IsTitleShowLatestData)) chart.IsTitleShowLatestData=item.IsTitleShowLatestData;
|
|
4698
4714
|
|
|
4699
4715
|
if (item.ShowPosition || item.ShowPostion) //显示位置高级配置
|
|
4700
4716
|
{
|
|
@@ -5077,6 +5093,15 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
5077
5093
|
if (IFrameSplitOperator.IsNumber(item.WheelYMove)) chart.EnableYDrag.WheelYMove=item.WheelYMove;
|
|
5078
5094
|
}
|
|
5079
5095
|
|
|
5096
|
+
if (option.FastSlide)
|
|
5097
|
+
{
|
|
5098
|
+
var item=option.FastSlide;
|
|
5099
|
+
if (IFrameSplitOperator.IsNumber(item.MinDistance)) chart.FastSlideConfig.MinDistance=item.MinDistance;
|
|
5100
|
+
if (IFrameSplitOperator.IsNumber(item.MinSpeed)) chart.FastSlideConfig.MinSpeed=item.MinSpeed;
|
|
5101
|
+
if (IFrameSplitOperator.IsNumber(item.MaxTime)) chart.FastSlideConfig.MaxTime=item.MaxTime;
|
|
5102
|
+
if (IFrameSplitOperator.IsBool(item.Enable)) chart.FastSlideConfig.Enable=item.Enable;
|
|
5103
|
+
}
|
|
5104
|
+
|
|
5080
5105
|
//分页
|
|
5081
5106
|
if (option.PageInfo) chart.SetPageInfo(option.PageInfo);
|
|
5082
5107
|
|
|
@@ -5098,6 +5123,12 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
5098
5123
|
if (IFrameSplitOperator.IsBool(item.RightButton.Enable)) chart.ChartCorssCursor.RightButton.Enable=item.RightButton.Enable;
|
|
5099
5124
|
}
|
|
5100
5125
|
|
|
5126
|
+
if (item.BottomButton)
|
|
5127
|
+
{
|
|
5128
|
+
var subItem=item.BottomButton;
|
|
5129
|
+
if (IFrameSplitOperator.IsBool(subItem.Enable)) chart.ChartCorssCursor.BottomButton.Enable=subItem.Enable;
|
|
5130
|
+
}
|
|
5131
|
+
|
|
5101
5132
|
if (IFrameSplitOperator.IsNumber(item.PriceFormatType)) chart.ChartCorssCursor.StringFormatY.PriceFormatType=item.PriceFormatType;
|
|
5102
5133
|
if (IFrameSplitOperator.IsNumber(item.DataFormatType)) chart.ChartCorssCursor.StringFormatY.DataFormatType=item.DataFormatType;
|
|
5103
5134
|
|
|
@@ -6835,7 +6866,9 @@ var JSCHART_EVENT_ID=
|
|
|
6835
6866
|
|
|
6836
6867
|
ON_FORMAT_OVERLAY_INDEX_OUT_TEXT:168, //格式化叠指标标题
|
|
6837
6868
|
|
|
6838
|
-
ON_TOUCH_FAST_SLIDE:169 //快速滑动
|
|
6869
|
+
ON_TOUCH_FAST_SLIDE:169, //快速滑动
|
|
6870
|
+
|
|
6871
|
+
ON_CLICK_CROSSCURSOR_BOTTOM:170, //十字光标底部文字点击
|
|
6839
6872
|
}
|
|
6840
6873
|
|
|
6841
6874
|
var JSCHART_OPERATOR_ID=
|
|
@@ -6864,6 +6897,8 @@ var JSCHART_OPERATOR_ID=
|
|
|
6864
6897
|
|
|
6865
6898
|
OP_GOTO:16, //移动到某一个天或某一个分钟
|
|
6866
6899
|
OP_GOTO_BY_DATAINDEX:17, //的移动到某一个数据起始位置
|
|
6900
|
+
|
|
6901
|
+
OP_MOVE_CORSSCURSOR:18, //移动十字光标 { Step, Start:{ Date:, Time: } }
|
|
6867
6902
|
}
|
|
6868
6903
|
|
|
6869
6904
|
var JSCHART_DRAG_ID=
|
|
@@ -7265,7 +7300,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
7265
7300
|
this.EnableVerticalDrag=false;
|
|
7266
7301
|
|
|
7267
7302
|
//十字光标长留(手势才有)
|
|
7268
|
-
this.ClickModel={ IsShowCorssCursor:false };
|
|
7303
|
+
this.ClickModel={ IsShowCorssCursor:false, PreventHide:false }; //PreventHide 阻止隐藏十字光标
|
|
7269
7304
|
this.EnableClickModel=false;
|
|
7270
7305
|
|
|
7271
7306
|
//标题栏显示最新数据
|
|
@@ -7296,7 +7331,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
7296
7331
|
//SecondKeyID 1=shiftKey 2=ctrlKey 3=altKey
|
|
7297
7332
|
this.AryHotKey=[]; //热键 { KeyID:87, SecondKeyID:1, CMD:JSCHART_MENU_ID.CMD_FULLSCREEN_SUMMARY_ID, Args:null, Description:"Alt+W 全屏区间统计" },
|
|
7298
7333
|
|
|
7299
|
-
this.FastSlideConfig={ MinDistance:500, MinSpeed:3, MaxTime:250 }; //快速滑动配置 MinDistance=最小的距离 MinSpeed=最小速度 MaxTime=最大间隔时间(ms)
|
|
7334
|
+
this.FastSlideConfig={ MinDistance:500, MinSpeed:3, MaxTime:250, Enable:false }; //快速滑动配置 MinDistance=最小的距离 MinSpeed=最小速度 MaxTime=最大间隔时间(ms)
|
|
7300
7335
|
|
|
7301
7336
|
this.RestoreFocus=function(delay)
|
|
7302
7337
|
{
|
|
@@ -7890,11 +7925,23 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
7890
7925
|
var button=this.ChartCorssCursor.PtInButton(x,y);
|
|
7891
7926
|
if (!button) return false;
|
|
7892
7927
|
|
|
7893
|
-
|
|
7894
|
-
if (event && event.Callback)
|
|
7928
|
+
if (button.Type==1)
|
|
7895
7929
|
{
|
|
7896
|
-
var
|
|
7897
|
-
event.Callback
|
|
7930
|
+
var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_CROSSCURSOR_RIGHT);
|
|
7931
|
+
if (event && event.Callback)
|
|
7932
|
+
{
|
|
7933
|
+
var sendData={ Button:button, e };
|
|
7934
|
+
event.Callback(event,sendData,this);
|
|
7935
|
+
}
|
|
7936
|
+
}
|
|
7937
|
+
else if (button.Type==2)
|
|
7938
|
+
{
|
|
7939
|
+
var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_CROSSCURSOR_BOTTOM);
|
|
7940
|
+
if (event && event.Callback)
|
|
7941
|
+
{
|
|
7942
|
+
var sendData={ Button:button, e };
|
|
7943
|
+
event.Callback(event,sendData,this);
|
|
7944
|
+
}
|
|
7898
7945
|
}
|
|
7899
7946
|
|
|
7900
7947
|
return true;
|
|
@@ -9404,6 +9451,11 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
9404
9451
|
return true;
|
|
9405
9452
|
}
|
|
9406
9453
|
|
|
9454
|
+
if (this.TryClickCrossCursor(x,y))
|
|
9455
|
+
{
|
|
9456
|
+
return true;
|
|
9457
|
+
}
|
|
9458
|
+
|
|
9407
9459
|
return false;
|
|
9408
9460
|
}
|
|
9409
9461
|
|
|
@@ -9416,6 +9468,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
9416
9468
|
this.TouchDrawCount=0;
|
|
9417
9469
|
this.PhonePinch=null;
|
|
9418
9470
|
this.TouchDrag=null;
|
|
9471
|
+
if (this.ClickModel) this.ClickModel.PreventHide=false;
|
|
9419
9472
|
this.StopDragTimer();
|
|
9420
9473
|
|
|
9421
9474
|
var isSingleTouch=this.IsSingleTouch(e);
|
|
@@ -9430,7 +9483,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
9430
9483
|
var touches = this.GetToucheData(e, this.IsForceLandscape);
|
|
9431
9484
|
var pt=this.PointAbsoluteToRelative(touches[0].clientX, touches[0].clientY, true);
|
|
9432
9485
|
|
|
9433
|
-
if (this.TryPhoneClickButton(pt.X, pt.Y, e))
|
|
9486
|
+
if (this.TryPhoneClickButton(pt.X, pt.Y, e))
|
|
9487
|
+
return;
|
|
9434
9488
|
|
|
9435
9489
|
if (this.EnableVerticalDrag )
|
|
9436
9490
|
{
|
|
@@ -10802,6 +10856,10 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
10802
10856
|
{
|
|
10803
10857
|
if (this.TouchStatus.CorssCursorShow==true) this.ChartCorssCursor.Draw();
|
|
10804
10858
|
}
|
|
10859
|
+
else if (this.EnableClickModel)
|
|
10860
|
+
{
|
|
10861
|
+
if (this.ClickModel.IsShowCorssCursor===true) this.ChartCorssCursor.Draw();
|
|
10862
|
+
}
|
|
10805
10863
|
else if (this.IsOnTouch===false && this.CurrentChartDrawPicture && this.CurrentChartDrawPicture.IsShowCorssCursor===true) //开始绘图
|
|
10806
10864
|
{
|
|
10807
10865
|
this.ChartCorssCursor.Draw();
|
|
@@ -13807,6 +13865,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
13807
13865
|
titlePaint.Canvas=this.Canvas;
|
|
13808
13866
|
titlePaint.LanguageID=this.LanguageID;
|
|
13809
13867
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
13868
|
+
titlePaint.HQChart=this;
|
|
13810
13869
|
this.TitlePaint[index+1]=titlePaint;
|
|
13811
13870
|
|
|
13812
13871
|
this.SetSubFrameOption(subFrame,option);
|
|
@@ -14300,6 +14359,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
14300
14359
|
titlePaint.LanguageID=this.LanguageID;
|
|
14301
14360
|
titlePaint.SelectedChart=this.SelectedChart;
|
|
14302
14361
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
14362
|
+
titlePaint.HQChart=this;
|
|
14303
14363
|
this.TitlePaint[index+1]=titlePaint;
|
|
14304
14364
|
|
|
14305
14365
|
this.SetSubFrameOption(subFrame, option);
|
|
@@ -15667,11 +15727,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
15667
15727
|
{
|
|
15668
15728
|
if (!this.TouchDrag) return false;
|
|
15669
15729
|
if (!this.FastSlideConfig) return false;
|
|
15730
|
+
var config=this.FastSlideConfig;
|
|
15731
|
+
if (!config.Enable) return false;
|
|
15670
15732
|
|
|
15671
15733
|
var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_TOUCH_FAST_SLIDE);
|
|
15672
15734
|
if (!event || !event.Callback) return false;
|
|
15673
15735
|
|
|
15674
|
-
|
|
15736
|
+
|
|
15675
15737
|
var drag=this.TouchDrag;
|
|
15676
15738
|
var time=Date.now();
|
|
15677
15739
|
var spanTime=time-drag.StartTime;
|
|
@@ -44254,7 +44316,7 @@ function ChartMinuteBuySellBar()
|
|
|
44254
44316
|
this.BuyColor=g_JSChartResource.Minute.BuySellBar.BuyColor;
|
|
44255
44317
|
this.SellColor=g_JSChartResource.Minute.BuySellBar.SellColor;
|
|
44256
44318
|
this.BarWidth=g_JSChartResource.Minute.BuySellBar.BarWidth;
|
|
44257
|
-
this.
|
|
44319
|
+
this.AryBarRange=g_JSChartResource.Minute.BuySellBar.AryBarRange;
|
|
44258
44320
|
this.YOffset=g_JSChartResource.Minute.BuySellBar.YOffset;
|
|
44259
44321
|
this.Font=g_JSChartResource.Minute.BuySellBar.Font;
|
|
44260
44322
|
this.TextColor=g_JSChartResource.Minute.BuySellBar.TextColor;
|
|
@@ -44269,7 +44331,7 @@ function ChartMinuteBuySellBar()
|
|
|
44269
44331
|
this.BuyColor=g_JSChartResource.Minute.BuySellBar.BuyColor;
|
|
44270
44332
|
this.SellColor=g_JSChartResource.Minute.BuySellBar.SellColor;
|
|
44271
44333
|
this.BarWidth=g_JSChartResource.Minute.BuySellBar.BarWidth;
|
|
44272
|
-
this.
|
|
44334
|
+
this.AryBarRange=g_JSChartResource.Minute.BuySellBar.AryBarRange;
|
|
44273
44335
|
this.YOffset=g_JSChartResource.Minute.BuySellBar.YOffset;
|
|
44274
44336
|
this.Font=g_JSChartResource.Minute.BuySellBar.Font;
|
|
44275
44337
|
this.TextColor=g_JSChartResource.Minute.BuySellBar.TextColor;
|
|
@@ -44285,11 +44347,29 @@ function ChartMinuteBuySellBar()
|
|
|
44285
44347
|
var volRange=this.GetVolRange();
|
|
44286
44348
|
if (!volRange) return;
|
|
44287
44349
|
|
|
44350
|
+
var minData=this.HQChart.GetKData();
|
|
44351
|
+
if (!minData || !IFrameSplitOperator.IsNonEmptyArray(minData.Data)) return;
|
|
44352
|
+
|
|
44288
44353
|
var bHScreen=(this.ChartFrame.IsHScreen===true);
|
|
44289
44354
|
var xPointCount=this.ChartFrame.XPointCount;
|
|
44355
|
+
var minuteCount=this.ChartFrame.MinuteCount;
|
|
44356
|
+
var minIndex=(minData.Data.length-1)%minuteCount;
|
|
44357
|
+
|
|
44358
|
+
var startIndex=xPointCount-1-120;
|
|
44359
|
+
var endIndex=xPointCount-1;
|
|
44360
|
+
for(var i=0;i<this.AryBarRange.length;++i)
|
|
44361
|
+
{
|
|
44362
|
+
var item=this.AryBarRange[i];
|
|
44363
|
+
if (minIndex<(minuteCount-1-item.End))
|
|
44364
|
+
{
|
|
44365
|
+
startIndex=xPointCount-1-item.Start;
|
|
44366
|
+
endIndex=xPointCount-1-item.End;
|
|
44367
|
+
break;
|
|
44368
|
+
}
|
|
44369
|
+
}
|
|
44290
44370
|
|
|
44291
|
-
var xStart=this.ChartFrame.GetXFromIndex(
|
|
44292
|
-
var xEnd=this.ChartFrame.GetXFromIndex(
|
|
44371
|
+
var xStart=this.ChartFrame.GetXFromIndex(startIndex);
|
|
44372
|
+
var xEnd=this.ChartFrame.GetXFromIndex(endIndex);
|
|
44293
44373
|
|
|
44294
44374
|
function _Temp_GetXFromData(value)
|
|
44295
44375
|
{
|
|
@@ -59885,6 +59965,12 @@ function ChartCorssCursor()
|
|
|
59885
59965
|
Icon:g_JSChartResource.CorssCursor.RightButton.Icon
|
|
59886
59966
|
};
|
|
59887
59967
|
|
|
59968
|
+
//底部按钮
|
|
59969
|
+
this.BottomButton=
|
|
59970
|
+
{
|
|
59971
|
+
Enable:false, Rect:null,
|
|
59972
|
+
}
|
|
59973
|
+
|
|
59888
59974
|
this.RightMargin=CloneData(g_JSChartResource.CorssCursor.RightMargin);
|
|
59889
59975
|
this.BottomConfig=CloneData(g_JSChartResource.CorssCursor.BottomText); //底部输出配置
|
|
59890
59976
|
this.LeftConfig=CloneData(g_JSChartResource.CorssCursor.LeftText);
|
|
@@ -60088,6 +60174,7 @@ function ChartCorssCursor()
|
|
|
60088
60174
|
{
|
|
60089
60175
|
this.Status=0;
|
|
60090
60176
|
this.RightButton.Rect=null;
|
|
60177
|
+
this.BottomButton.Rect=null;
|
|
60091
60178
|
this.LastValue=null;
|
|
60092
60179
|
|
|
60093
60180
|
if (!this.LastPoint) return;
|
|
@@ -60493,6 +60580,11 @@ function ChartCorssCursor()
|
|
|
60493
60580
|
this.Canvas.textBaseline="bottom";
|
|
60494
60581
|
this.Canvas.fillStyle=this.TextColor;
|
|
60495
60582
|
this.Canvas.fillText(text,rtBG.Left+textOffset.X,rtBG.Bottom+textOffset.Y,textWidth);
|
|
60583
|
+
|
|
60584
|
+
var buttonData={X:x, Y:y, XValue:xValue, FrameID:yValueExtend.FrameID };
|
|
60585
|
+
if (this.StringFormatX.KItem) buttonData.KItem=this.StringFormatX.KItem;
|
|
60586
|
+
this.BottomButton.Rect=rtBG;
|
|
60587
|
+
this.BottomButton.Data=buttonData;
|
|
60496
60588
|
}
|
|
60497
60589
|
}
|
|
60498
60590
|
|
|
@@ -60712,17 +60804,42 @@ function ChartCorssCursor()
|
|
|
60712
60804
|
}
|
|
60713
60805
|
|
|
60714
60806
|
this.PtInButton=function(x,y)
|
|
60807
|
+
{
|
|
60808
|
+
var item=this.PtInRightButton(x,y);
|
|
60809
|
+
if (item) return item;
|
|
60810
|
+
|
|
60811
|
+
item=this.PtInButtomButton(x,y);
|
|
60812
|
+
if (item) return item;
|
|
60813
|
+
|
|
60814
|
+
return null;
|
|
60815
|
+
}
|
|
60816
|
+
|
|
60817
|
+
this.PtInRightButton=function(x,y)
|
|
60715
60818
|
{
|
|
60716
60819
|
if (!this.RightButton.Enable) return null;
|
|
60717
60820
|
if (!this.RightButton.Rect) return null;
|
|
60718
60821
|
|
|
60719
60822
|
var rect=this.RightButton.Rect;
|
|
60720
|
-
|
|
60721
|
-
|
|
60722
|
-
|
|
60823
|
+
if (x>=rect.Left && x<=rect.Right && y>=rect.Top && y<=rect.Bottom)
|
|
60824
|
+
{
|
|
60825
|
+
return { Data:this.RightButton.Data, Rect:rect, Type:1 }; //Type:1=右侧 2=底部
|
|
60826
|
+
}
|
|
60827
|
+
|
|
60828
|
+
return null;
|
|
60829
|
+
}
|
|
60830
|
+
|
|
60831
|
+
this.PtInButtomButton=function(x,y)
|
|
60832
|
+
{
|
|
60833
|
+
if (!this.BottomButton.Enable) return null;
|
|
60834
|
+
if (!this.BottomButton.Rect) return null;
|
|
60835
|
+
|
|
60836
|
+
var rect=this.BottomButton.Rect;
|
|
60837
|
+
if (x>=rect.Left && x<=rect.Right && y>=rect.Top && y<=rect.Bottom)
|
|
60723
60838
|
{
|
|
60724
|
-
return { Data:this.
|
|
60839
|
+
return { Data:this.BottomButton.Data, Rect:rect , Type:2 }; //Type:1=右侧 2=底部
|
|
60725
60840
|
}
|
|
60841
|
+
|
|
60842
|
+
return null;
|
|
60726
60843
|
}
|
|
60727
60844
|
|
|
60728
60845
|
this.DrawTextBGRect=function(x,y, height, width)
|
|
@@ -61770,9 +61887,11 @@ function HQDateStringFormat()
|
|
|
61770
61887
|
|
|
61771
61888
|
this.DateFormatType=0; //0=YYYY-MM-DD 1=YYYY/MM/DD 2=YYYY/MM/DD/W 3=DD/MM/YYYY
|
|
61772
61889
|
this.LanguageID=0;
|
|
61890
|
+
this.KItem=null; //缓存当前的K线
|
|
61773
61891
|
|
|
61774
61892
|
this.Operator=function()
|
|
61775
61893
|
{
|
|
61894
|
+
this.KItem=null;
|
|
61776
61895
|
if (!IFrameSplitOperator.IsNumber(this.Value)) return false;
|
|
61777
61896
|
if (!this.Data) return false;
|
|
61778
61897
|
|
|
@@ -61780,6 +61899,7 @@ function HQDateStringFormat()
|
|
|
61780
61899
|
index=parseInt(index.toFixed(0));
|
|
61781
61900
|
if (this.Data.DataOffset+index>=this.Data.Data.length) return false;
|
|
61782
61901
|
var currentData = this.Data.Data[this.Data.DataOffset+index];
|
|
61902
|
+
this.KItem=currentData;
|
|
61783
61903
|
var dateFormatString="YYYY-MM-DD";
|
|
61784
61904
|
if (this.DateFormatType==1) dateFormatString="YYYY/MM/DD";
|
|
61785
61905
|
else if (this.DateFormatType==2) dateFormatString="YYYY/MM/DD/W";
|
|
@@ -63336,7 +63456,14 @@ function DynamicKLineTitlePainting()
|
|
|
63336
63456
|
|
|
63337
63457
|
this.IsShowLastData=function()
|
|
63338
63458
|
{
|
|
63459
|
+
if (this.HQChart && this.HQChart.EnableClickModel && this.HQChart.ClickModel)
|
|
63460
|
+
{
|
|
63461
|
+
var clickModel=this.HQChart.ClickModel;
|
|
63462
|
+
if (clickModel.IsShowCorssCursor) return false;
|
|
63463
|
+
}
|
|
63464
|
+
|
|
63339
63465
|
var isShow=false;
|
|
63466
|
+
|
|
63340
63467
|
if (this.DrawStatus && this.DrawStatus.IsTitleShowLatestData)
|
|
63341
63468
|
{
|
|
63342
63469
|
var status=this.DrawStatus;
|
|
@@ -64681,6 +64808,12 @@ function DynamicChartTitlePainting()
|
|
|
64681
64808
|
|
|
64682
64809
|
this.IsShowLastData=function()
|
|
64683
64810
|
{
|
|
64811
|
+
if (this.HQChart && this.HQChart.EnableClickModel && this.HQChart.ClickModel)
|
|
64812
|
+
{
|
|
64813
|
+
var clickModel=this.HQChart.ClickModel;
|
|
64814
|
+
if (clickModel.IsShowCorssCursor) return false;
|
|
64815
|
+
}
|
|
64816
|
+
|
|
64684
64817
|
var isShowLastData=false;
|
|
64685
64818
|
if (this.DrawStatus && this.DrawStatus.IsTitleShowLatestData)
|
|
64686
64819
|
{
|
|
@@ -77959,6 +78092,8 @@ function JSChartResource()
|
|
|
77959
78092
|
YOffset:1,
|
|
77960
78093
|
Font:`${12*GetDevicePixelRatio()}px 微软雅黑`,
|
|
77961
78094
|
TextColor:"rgb(128,128,128)",
|
|
78095
|
+
|
|
78096
|
+
AryBarRange:[{ Start:240, End:120 }, { Start:120, End:0}],
|
|
77962
78097
|
}
|
|
77963
78098
|
|
|
77964
78099
|
this.DefaultTextColor="rgb(43,54,69)"; //图形中默认的字体颜色
|
|
@@ -79509,7 +79644,7 @@ function JSChartResource()
|
|
|
79509
79644
|
if (item.Font) dest.Font=item.Font;
|
|
79510
79645
|
if (item.TextColor) dest.TextColor=item.TextColor;
|
|
79511
79646
|
if (IFrameSplitOperator.IsNumber(item.BarWidth)) dest.BarWidth=item.BarWidth;
|
|
79512
|
-
if (IFrameSplitOperator.
|
|
79647
|
+
if (IFrameSplitOperator.IsNonEmptyArray(item.AryBarRange)) dest.AryBarRange=item.AryBarRange;
|
|
79513
79648
|
if (IFrameSplitOperator.IsNumber(item.YOffset)) dest.YOffset=item.YOffset;
|
|
79514
79649
|
}
|
|
79515
79650
|
}
|
|
@@ -82722,33 +82857,179 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
82722
82857
|
return;
|
|
82723
82858
|
}
|
|
82724
82859
|
|
|
82860
|
+
return this.ChartOperator_Temp_SetChartCorssCursor(findIndex, item);
|
|
82861
|
+
}
|
|
82862
|
+
else if (id==JSCHART_OPERATOR_ID.OP_MOVE_CORSSCURSOR) //移动十字光标 { Step, Start:{ Date, Time }}
|
|
82863
|
+
{
|
|
82864
|
+
if (!IFrameSplitOperator.IsNumber(obj.Step)) return false;
|
|
82865
|
+
if (obj.Step==0) return false;
|
|
82866
|
+
var step=obj.Step;
|
|
82867
|
+
|
|
82725
82868
|
if (!this.Frame || !this.Frame.SubFrame[0] || !this.Frame.SubFrame[0].Frame) return false;
|
|
82726
|
-
var
|
|
82869
|
+
var showCount=this.Frame.SubFrame[0].Frame.XPointCount; //一屏显示个数
|
|
82727
82870
|
|
|
82728
|
-
var
|
|
82729
|
-
|
|
82871
|
+
var kData=this.GetKData();
|
|
82872
|
+
if (!kData || !IFrameSplitOperator.IsNonEmptyArray(kData.Data)) return false; //数据还没有到达
|
|
82730
82873
|
|
|
82731
|
-
|
|
82732
|
-
var
|
|
82733
|
-
|
|
82734
|
-
|
|
82874
|
+
var start=kData.DataOffset;
|
|
82875
|
+
var bDayPeriod=ChartData.IsDayPeriod(this.Period,true);
|
|
82876
|
+
var findItem=null, dataIndex=-1;
|
|
82877
|
+
for(var i=0; i<kData.Data.length; ++i)
|
|
82878
|
+
{
|
|
82879
|
+
var item=kData.Data[i];
|
|
82880
|
+
if (!item) continue;
|
|
82735
82881
|
|
|
82736
|
-
|
|
82737
|
-
|
|
82738
|
-
|
|
82882
|
+
if (bDayPeriod)
|
|
82883
|
+
{
|
|
82884
|
+
if (item.Date==obj.Start.Date)
|
|
82885
|
+
{
|
|
82886
|
+
findItem=item;
|
|
82887
|
+
dataIndex=i;
|
|
82888
|
+
break;
|
|
82889
|
+
}
|
|
82890
|
+
}
|
|
82891
|
+
else
|
|
82892
|
+
{
|
|
82893
|
+
if (item.Date==obj.Start.Date && item.Time==obj.Start.Time)
|
|
82894
|
+
{
|
|
82895
|
+
findItem=item;
|
|
82896
|
+
dataIndex=i;
|
|
82897
|
+
break;
|
|
82898
|
+
}
|
|
82899
|
+
}
|
|
82900
|
+
}
|
|
82739
82901
|
|
|
82740
|
-
|
|
82902
|
+
if (!findItem) return false;
|
|
82741
82903
|
|
|
82742
|
-
var
|
|
82743
|
-
|
|
82744
|
-
|
|
82745
|
-
|
|
82746
|
-
|
|
82747
|
-
|
|
82748
|
-
|
|
82904
|
+
var index=-1;
|
|
82905
|
+
var dataOffset=kData.DataOffset;
|
|
82906
|
+
if (dataIndex>=start && dataIndex<=start+(showCount-1))
|
|
82907
|
+
{
|
|
82908
|
+
index=dataIndex-start;
|
|
82909
|
+
}
|
|
82910
|
+
else //需要调整当前屏范围
|
|
82911
|
+
{
|
|
82912
|
+
if (step>0)
|
|
82913
|
+
{
|
|
82914
|
+
if (dataIndex+showCount>=kData.Data.length)
|
|
82915
|
+
{
|
|
82916
|
+
dataOffset=kData.Data.length-showCount;
|
|
82917
|
+
index=dataIndex-dataOffset;
|
|
82918
|
+
}
|
|
82919
|
+
else
|
|
82920
|
+
{
|
|
82921
|
+
index=0;
|
|
82922
|
+
dataOffset=dataIndex;
|
|
82923
|
+
}
|
|
82924
|
+
}
|
|
82925
|
+
else
|
|
82926
|
+
{
|
|
82927
|
+
if (dataIndex-showCount<0)
|
|
82928
|
+
{
|
|
82929
|
+
dataOffset=0;
|
|
82930
|
+
index=dataIndex;
|
|
82931
|
+
}
|
|
82932
|
+
else if (dataIndex+showCount>=kData.Data.length)
|
|
82933
|
+
{
|
|
82934
|
+
dataOffset=kData.Data.length-showCount;
|
|
82935
|
+
index=dataIndex-dataOffset;
|
|
82936
|
+
}
|
|
82937
|
+
else
|
|
82938
|
+
{
|
|
82939
|
+
index=showCount;
|
|
82940
|
+
dataOffset=dataIndex-showCount;
|
|
82941
|
+
}
|
|
82942
|
+
}
|
|
82943
|
+
}
|
|
82944
|
+
|
|
82945
|
+
var kItem=findItem;
|
|
82946
|
+
if (step>0)
|
|
82947
|
+
{
|
|
82948
|
+
for(var i=dataIndex+1, j=0; i<kData.Data.length && j<step; ++i, ++j)
|
|
82949
|
+
{
|
|
82950
|
+
++index;
|
|
82951
|
+
dataIndex=i;
|
|
82952
|
+
if (index>=(showCount-1))
|
|
82953
|
+
{
|
|
82954
|
+
index=showCount-1;
|
|
82955
|
+
dataOffset+=1;
|
|
82956
|
+
}
|
|
82957
|
+
|
|
82958
|
+
var item=kData.Data[i];
|
|
82959
|
+
if (!item) continue;
|
|
82960
|
+
|
|
82961
|
+
var kItem=item;
|
|
82962
|
+
}
|
|
82963
|
+
}
|
|
82964
|
+
else if (step<0)
|
|
82965
|
+
{
|
|
82966
|
+
for(var i=dataIndex-1, j=0;i>=0 && j<Math.abs(step);--i, ++j)
|
|
82967
|
+
{
|
|
82968
|
+
--index
|
|
82969
|
+
dataIndex=i;
|
|
82970
|
+
if (index<=0)
|
|
82971
|
+
{
|
|
82972
|
+
index=0;
|
|
82973
|
+
dataOffset-=1;
|
|
82974
|
+
}
|
|
82975
|
+
|
|
82976
|
+
var item=kData.Data[i];
|
|
82977
|
+
if (!item) continue;
|
|
82978
|
+
var kItem=item;
|
|
82979
|
+
}
|
|
82980
|
+
}
|
|
82981
|
+
|
|
82982
|
+
if (!kItem) return false;
|
|
82983
|
+
|
|
82984
|
+
obj.KItem=kItem;
|
|
82985
|
+
if (kData.DataOffset==dataOffset)
|
|
82986
|
+
{
|
|
82987
|
+
return this.ChartOperator_Temp_SetChartCorssCursor(index, kItem);
|
|
82988
|
+
}
|
|
82989
|
+
else
|
|
82990
|
+
{
|
|
82991
|
+
kData.DataOffset=dataOffset
|
|
82992
|
+
this.UpdataDataoffset(); //更新数据偏移
|
|
82993
|
+
this.UpdateFrameMaxMin(); //调整坐标最大 最小值
|
|
82994
|
+
this.ResetFrameXSplit();
|
|
82995
|
+
this.Frame.SetSizeChage(true);
|
|
82996
|
+
this.Draw();
|
|
82997
|
+
this.ChartOperator_Temp_SetChartCorssCursor(index, kItem);
|
|
82998
|
+
return true;
|
|
82999
|
+
}
|
|
82749
83000
|
}
|
|
82750
83001
|
}
|
|
82751
83002
|
|
|
83003
|
+
|
|
83004
|
+
this.ChartOperator_Temp_SetChartCorssCursor=function(index, kItem)
|
|
83005
|
+
{
|
|
83006
|
+
if (!this.Frame || !this.Frame.SubFrame[0] || !this.Frame.SubFrame[0].Frame) return false;
|
|
83007
|
+
var frame=this.Frame.SubFrame[0].Frame;
|
|
83008
|
+
|
|
83009
|
+
var x=frame.GetXFromIndex(index);
|
|
83010
|
+
var y=frame.GetYFromData(kItem.Close);
|
|
83011
|
+
|
|
83012
|
+
//保存最后一次鼠标移动信息
|
|
83013
|
+
var MoveStatus={ X:x, Y:y, IsInClient: this.IsMouseOnClient(x,y) };
|
|
83014
|
+
this.LastMouseStatus.OnMouseMove=MoveStatus;
|
|
83015
|
+
this.LastMouseStatus.MoveOnPoint={X:x, Y:y}; //鼠标移动的位置
|
|
83016
|
+
|
|
83017
|
+
var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_MOUSE_MOVE);
|
|
83018
|
+
var titleChart=this.TitlePaint[0];
|
|
83019
|
+
if (event && titleChart) titleChart.OnMouseMoveEvent=event;
|
|
83020
|
+
|
|
83021
|
+
var pixelTatio = GetDevicePixelRatio();
|
|
83022
|
+
var e={ };
|
|
83023
|
+
e.clientX=(x/pixelTatio)+this.UIElement.getBoundingClientRect().left;
|
|
83024
|
+
e.clientY=(y/pixelTatio)+this.UIElement.getBoundingClientRect().top;
|
|
83025
|
+
this.MoveOnPoint={X:x, Y:y};
|
|
83026
|
+
this.OnMouseMove(x,y,e);
|
|
83027
|
+
this.LastMouseStatus.MoveOnPoint=null;
|
|
83028
|
+
if (titleChart) titleChart.OnMouseMoveEvent=null;
|
|
83029
|
+
|
|
83030
|
+
return true;
|
|
83031
|
+
}
|
|
83032
|
+
|
|
82752
83033
|
//内部函数
|
|
82753
83034
|
this.ChartOperator_Temp_GetHistoryData=function()
|
|
82754
83035
|
{
|
|
@@ -82996,7 +83277,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
82996
83277
|
titlePaint.LanguageID=this.LanguageID;
|
|
82997
83278
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
82998
83279
|
titlePaint.SelectedChart=this.SelectedChart;
|
|
82999
|
-
|
|
83280
|
+
titlePaint.HQChart=this;
|
|
83000
83281
|
this.TitlePaint.push(titlePaint);
|
|
83001
83282
|
}
|
|
83002
83283
|
|
|
@@ -86484,6 +86765,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
86484
86765
|
titlePaint.LanguageID=this.LanguageID;
|
|
86485
86766
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
86486
86767
|
titlePaint.SelectedChart=this.SelectedChart;
|
|
86768
|
+
titlePaint.HQChart=this;
|
|
86487
86769
|
this.TitlePaint[i+1]=titlePaint;
|
|
86488
86770
|
}
|
|
86489
86771
|
|
|
@@ -86628,6 +86910,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
86628
86910
|
titlePaint.LanguageID=this.LanguageID;
|
|
86629
86911
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
86630
86912
|
titlePaint.SelectedChart=this.SelectedChart;
|
|
86913
|
+
titlePaint.HQChart=this;
|
|
86631
86914
|
this.TitlePaint[i+1]=titlePaint;
|
|
86632
86915
|
}
|
|
86633
86916
|
}
|
|
@@ -86932,7 +87215,8 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
86932
87215
|
{
|
|
86933
87216
|
if (this.DragMode==JSCHART_DRAG_ID.CLICK_TOUCH_MODE_ID)
|
|
86934
87217
|
{
|
|
86935
|
-
if (this.
|
|
87218
|
+
if (this.ClickModel.IsShowCorssCursor==true && this.ClickModel.PreventHide) return;
|
|
87219
|
+
if (this.ClickModel.IsShowCorssCursor==true && this.TouchDrawCount>0 ) return;
|
|
86936
87220
|
|
|
86937
87221
|
this.TouchStatus.CorssCursorShow=false;
|
|
86938
87222
|
this.DrawDynamicInfo();
|
|
@@ -86941,7 +87225,8 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
86941
87225
|
|
|
86942
87226
|
if (this.EnableClickModel===true)
|
|
86943
87227
|
{
|
|
86944
|
-
if (this.ClickModel.IsShowCorssCursor==true && this.
|
|
87228
|
+
if (this.ClickModel.IsShowCorssCursor==true && this.ClickModel.PreventHide) return; //阻止隐藏
|
|
87229
|
+
if (this.ClickModel.IsShowCorssCursor==true && this.TouchDrawCount>0 ) return;
|
|
86945
87230
|
|
|
86946
87231
|
this.ClickModel.IsShowCorssCursor=false;
|
|
86947
87232
|
this.DrawDynamicInfo();
|
|
@@ -91743,6 +92028,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
91743
92028
|
this.TouchDrawCount=0;
|
|
91744
92029
|
this.PhonePinch=null;
|
|
91745
92030
|
this.TouchDrag=null;
|
|
92031
|
+
if (this.ClickModel) this.ClickModel.PreventHide=false;
|
|
91746
92032
|
this.StopDragTimer();
|
|
91747
92033
|
|
|
91748
92034
|
if (this.EnableScrollUpDown==false) e.preventDefault(); //上下拖动图形不能阻止事件
|
|
@@ -92862,6 +93148,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
92862
93148
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
92863
93149
|
titlePaint.SelectedChart=this.SelectedChart;
|
|
92864
93150
|
titlePaint.MainTitlePaint=this.TitlePaint[0];
|
|
93151
|
+
titlePaint.HQChart=this;
|
|
92865
93152
|
this.TitlePaint.push(titlePaint);
|
|
92866
93153
|
}
|
|
92867
93154
|
|
|
@@ -93073,6 +93360,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
93073
93360
|
titlePaint.LanguageID=this.LanguageID;
|
|
93074
93361
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); };
|
|
93075
93362
|
titlePaint.MainTitlePaint=this.TitlePaint[0];
|
|
93363
|
+
titlePaint.HQChart=this;
|
|
93076
93364
|
this.TitlePaint[index+1]=titlePaint;
|
|
93077
93365
|
|
|
93078
93366
|
this.SetSubFrameOption(subFrame,option);
|
|
@@ -93211,6 +93499,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
93211
93499
|
buySellBar.Name="Minute-BuySell-Bar";
|
|
93212
93500
|
buySellBar.Identify="Minute-BuySell-Bar";
|
|
93213
93501
|
buySellBar.BuySellData=this.BuySellData;
|
|
93502
|
+
buySellBar.HQChart=this;
|
|
93214
93503
|
this.ChartPaint[3]=buySellBar;
|
|
93215
93504
|
|
|
93216
93505
|
|
|
@@ -93322,6 +93611,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
93322
93611
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
93323
93612
|
titlePaint.SelectedChart=this.SelectedChart;
|
|
93324
93613
|
titlePaint.MainTitlePaint=this.TitlePaint[0];
|
|
93614
|
+
titlePaint.HQChart=this;
|
|
93325
93615
|
this.TitlePaint[i+1]=titlePaint;
|
|
93326
93616
|
}
|
|
93327
93617
|
|
|
@@ -93409,6 +93699,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
93409
93699
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
93410
93700
|
titlePaint.SelectedChart=this.SelectedChart;
|
|
93411
93701
|
titlePaint.MainTitlePaint=this.TitlePaint[0];
|
|
93702
|
+
titlePaint.HQChart=this;
|
|
93412
93703
|
this.TitlePaint[i+1]=titlePaint;
|
|
93413
93704
|
}
|
|
93414
93705
|
}
|
|
@@ -95811,6 +96102,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
95811
96102
|
{
|
|
95812
96103
|
if (this.EnableClickModel===true)
|
|
95813
96104
|
{
|
|
96105
|
+
if (this.ClickModel.IsShowCorssCursor==true && this.ClickModel.PreventHide) return; //阻止隐藏
|
|
95814
96106
|
if (this.ClickModel.IsShowCorssCursor==true && this.TouchDrawCount>0) return;
|
|
95815
96107
|
|
|
95816
96108
|
this.ClickModel.IsShowCorssCursor=false;
|
|
@@ -98370,6 +98662,7 @@ function KLineChartHScreenContainer(uielement)
|
|
|
98370
98662
|
titlePaint.LanguageID=this.LanguageID;
|
|
98371
98663
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
98372
98664
|
titlePaint.SelectedChart=this.SelectedChart;
|
|
98665
|
+
titlePaint.HQChart=this;
|
|
98373
98666
|
this.TitlePaint.push(titlePaint);
|
|
98374
98667
|
}
|
|
98375
98668
|
|
|
@@ -98551,6 +98844,7 @@ function MinuteChartHScreenContainer(uielement)
|
|
|
98551
98844
|
titlePaint.LanguageID=this.LanguageID;
|
|
98552
98845
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
98553
98846
|
titlePaint.SelectedChart=this.SelectedChart;
|
|
98847
|
+
titlePaint.HQChart=this;
|
|
98554
98848
|
this.TitlePaint.push(titlePaint);
|
|
98555
98849
|
}
|
|
98556
98850
|
|
|
@@ -147592,7 +147886,7 @@ function ScrollBarBGChart()
|
|
|
147592
147886
|
|
|
147593
147887
|
|
|
147594
147888
|
|
|
147595
|
-
var HQCHART_VERSION="1.1.
|
|
147889
|
+
var HQCHART_VERSION="1.1.14710";
|
|
147596
147890
|
|
|
147597
147891
|
function PrintHQChartVersion()
|
|
147598
147892
|
{
|