hqchart 1.1.14814 → 1.1.14820

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hqchart",
3
- "version": "1.1.14814",
3
+ "version": "1.1.14820",
4
4
  "description": "HQChart - H5, 微信小程序 沪深/港股/数字货币/期货/美股 K线图(kline),走势图,缩放,拖拽,十字光标,画图工具,截图,筹码图. 分析家语法,通达信语法,(麦语法),第3方数据对接",
5
5
  "main": "lib/main.js",
6
6
  "scripts": {
@@ -673,7 +673,7 @@ function JSDialogModifyDraw()
673
673
  this.ColorButton=null;
674
674
  if (this.DivDialog)
675
675
  {
676
- document.body.remove(this.DivDialog);
676
+ document.body.removeChild(this.DivDialog);
677
677
  this.DivDialog=null;
678
678
  }
679
679
  }
@@ -899,7 +899,7 @@ function JSDialogModifyIndexParam()
899
899
 
900
900
  if (this.DivDialog)
901
901
  {
902
- document.body.removeChild(this.DivDialog);
902
+ if (document && document.body && document.body.removeChild) document.body.removeChild(this.DivDialog);
903
903
  this.DivDialog=null;
904
904
  }
905
905
  }
@@ -403,6 +403,12 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
403
403
  if (option.DrawTool.StorageKey && chart.ChartDrawStorage) chart.ChartDrawStorage.Load(option.DrawTool.StorageKey);
404
404
  }
405
405
 
406
+ if (option.KeyboardMove)
407
+ {
408
+ var item=option.KeyboardMove;
409
+ if (IFrameSplitOperator.IsPlusNumber(item.Delay)) chart.KeyboardMove.Delay=item.Delay;
410
+ }
411
+
406
412
  if (IFrameSplitOperator.IsNumber(option.StepPixel)) chart.StepPixel=option.StepPixel;
407
413
  if (option.ZoomStepPixel>0) chart.ZoomStepPixel=option.ZoomStepPixel;
408
414
  if (option.IsApiPeriod==true) chart.IsApiPeriod=option.IsApiPeriod;
@@ -3180,7 +3186,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
3180
3186
  this.DisableMouse=false; //禁止鼠标事件
3181
3187
  this.LanguageID=JSCHART_LANGUAGE_ID.LANGUAGE_CHINESE_ID;
3182
3188
  this.PressTime=500;
3183
- this.IsPress=false; //是否长按
3189
+ this.IsPress=false; //是否长按
3190
+ this.IsPressKeyboard=false; //是否键盘按键
3184
3191
 
3185
3192
  this.NetworkFilter; //网络请求回调 function(data, callback);
3186
3193
  this.LastMouseStatus={ MouseOnToolbar:null }; // MouseOnToolbar={ Rect:{}, Title: }
@@ -3264,6 +3271,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
3264
3271
  this.AryHotKey=[]; //热键 { KeyID:87, SecondKeyID:1, CMD:JSCHART_MENU_ID.CMD_FULLSCREEN_SUMMARY_ID, Args:null, Description:"Alt+W 全屏区间统计" },
3265
3272
 
3266
3273
  this.FastSlideConfig={ MinDistance:500, MinSpeed:3, MaxTime:250, Enable:false }; //快速滑动配置 MinDistance=最小的距离 MinSpeed=最小速度 MaxTime=最大间隔时间(ms)
3274
+ this.KeyboardMove={ Timer:null, Delay:100 , Enable:false, Event:null }; //键盘左右移动
3267
3275
 
3268
3276
  this.RestoreFocus=function(delay)
3269
3277
  {
@@ -7433,6 +7441,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7433
7441
  if (this.ChartSplashPaint && this.ChartSplashPaint.IsEnableSplash == true) return;
7434
7442
 
7435
7443
  var keyID = e.keyCode ? e.keyCode :e.which;
7444
+ this.IsPressKeyboard=true;
7436
7445
 
7437
7446
  //回调事件
7438
7447
  var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_KEYDOWN);
@@ -7467,6 +7476,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7467
7476
  switch(keyID)
7468
7477
  {
7469
7478
  case 37: //left
7479
+ if (this.KeyboardMove.Enable) break;
7470
7480
  if ((e.ctrlKey||e.shiftKey) && this.OnCustomKeyDown)
7471
7481
  {
7472
7482
  if (this.OnCustomKeyDown(keyID, e))
@@ -7506,6 +7516,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7506
7516
  }
7507
7517
  break;
7508
7518
  case 39: //right
7519
+ if (this.KeyboardMove.Enable) break;
7509
7520
  if ((e.ctrlKey|| e.shiftKey) && this.OnCustomKeyDown)
7510
7521
  {
7511
7522
  if (this.OnCustomKeyDown(keyID, e))
@@ -7640,11 +7651,167 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7640
7651
 
7641
7652
  if (draw) this.DrawDynamicInfo();
7642
7653
 
7654
+ if (keyID==37 || keyID==39)
7655
+ this.StartKeyboardMoveTimer(e);
7656
+
7643
7657
  //不让滚动条滚动
7644
7658
  if(e.preventDefault) e.preventDefault();
7645
7659
  else e.returnValue = false;
7646
7660
  }
7647
7661
 
7662
+
7663
+ this.ClearKeyboardMoveTimer=function()
7664
+ {
7665
+ if (!this.KeyboardMove) return;
7666
+
7667
+ this.KeyboardMove.Event=null;
7668
+
7669
+ if (this.KeyboardMove.Timer)
7670
+ {
7671
+ clearTimeout(this.KeyboardMove.Timer);
7672
+ this.KeyboardMove.Timer=null;
7673
+ JSConsole.Chart.Log(`[JSChartContainer::ClearKeyboardMoveTimer] Stop` );
7674
+ }
7675
+
7676
+ this.KeyboardMove.Enable=false;
7677
+ }
7678
+
7679
+ this.StartKeyboardMoveTimer=function(e)
7680
+ {
7681
+ if (!this.KeyboardMove) return;
7682
+ if (this.KeyboardMove.Enable) return; //已启动
7683
+
7684
+ this.KeyboardMove.Event=e;
7685
+ this.KeyboardMove.Enable=true;
7686
+
7687
+ JSConsole.Chart.Log(`[JSChartContainer::StartKeyboardMoveTimer] Start` );
7688
+
7689
+ this.AutoKeyboardMove();
7690
+ }
7691
+
7692
+ this.AutoKeyboardMove=function()
7693
+ {
7694
+ if (!this.KeyboardMove) return false;
7695
+ if (!this.KeyboardMove.Enable) return false;
7696
+ if (!this.KeyboardMove.Event) return false;
7697
+
7698
+ this.KeyboardMove.Timer=setTimeout(()=>
7699
+ {
7700
+ this.OnKeyboardMoveTimerProc();
7701
+ },this.KeyboardMove.Delay);
7702
+ }
7703
+
7704
+
7705
+ this.OnKeyboardMoveTimerProc=function()
7706
+ {
7707
+ if (!this.KeyboardMove) return false;
7708
+ if (!this.KeyboardMove.Enable) return false;
7709
+ if (!this.KeyboardMove.Event) return false;
7710
+
7711
+ var e=this.KeyboardMove.Event;
7712
+ var keyID = e.keyCode ? e.keyCode :e.which;
7713
+ var bStop=false;
7714
+ switch(keyID)
7715
+ {
7716
+ case 37: //left
7717
+ if ((e.ctrlKey||e.shiftKey) && this.OnCustomKeyDown)
7718
+ {
7719
+ if (this.OnCustomKeyDown(keyID, e))
7720
+ break;
7721
+ }
7722
+
7723
+ //K线 如果超出K线数据了 调整到最后一个数据
7724
+ if (this.FixCursorIndexValid && this.FixCursorIndexValid())
7725
+ {
7726
+ this.UpdatePointByCursorIndex();
7727
+ this.DrawDynamicInfo();
7728
+ this.ShowTooltipByKeyDown();
7729
+ break;
7730
+ }
7731
+
7732
+ if (this.CursorIndex<=0.99999)
7733
+ {
7734
+ if (!this.DataMoveLeft())
7735
+ { //左移数据到头了 触发下载新数据
7736
+ if (this.DragDownloadData) this.DragDownloadData();
7737
+ break;
7738
+ }
7739
+ this.UpdataDataoffset();
7740
+ this.UpdatePointByCursorIndex();
7741
+ this.UpdateFrameMaxMin();
7742
+ this.ResetFrameXSplit();
7743
+ this.Draw();
7744
+ this.ShowTooltipByKeyDown();
7745
+ this.OnKLinePageChange("keydown");
7746
+ }
7747
+ else
7748
+ {
7749
+ --this.CursorIndex;
7750
+ this.UpdatePointByCursorIndex();
7751
+ this.DrawDynamicInfo();
7752
+ this.ShowTooltipByKeyDown();
7753
+ }
7754
+ break;
7755
+
7756
+ case 39: //right
7757
+ if ((e.ctrlKey|| e.shiftKey) && this.OnCustomKeyDown)
7758
+ {
7759
+ if (this.OnCustomKeyDown(keyID, e))
7760
+ break;
7761
+ }
7762
+
7763
+ //K线 如果超出K线数据了 调整到最后一个数据
7764
+ if (this.FixCursorIndexValid && this.FixCursorIndexValid())
7765
+ {
7766
+ this.UpdatePointByCursorIndex();
7767
+ this.DrawDynamicInfo();
7768
+ this.ShowTooltipByKeyDown();
7769
+ break;
7770
+ }
7771
+
7772
+ var xPointcount=0;
7773
+ if (this.Frame.XPointCount) xPointcount=this.Frame.XPointCount;
7774
+ else xPointcount=this.Frame.SubFrame[0].Frame.XPointCount;
7775
+ if (this.CursorIndex+1>=xPointcount)
7776
+ {
7777
+ if (!this.DataMoveRight()) break;
7778
+ this.UpdataDataoffset();
7779
+ this.UpdatePointByCursorIndex();
7780
+ this.UpdateFrameMaxMin();
7781
+ this.ResetFrameXSplit();
7782
+ this.Draw();
7783
+ this.ShowTooltipByKeyDown();
7784
+ this.OnKLinePageChange("keydown");
7785
+ }
7786
+ else
7787
+ {
7788
+ //判断是否在最后一个数据上
7789
+ var data=null;
7790
+ if (this.Frame.Data) data=this.Frame.Data;
7791
+ else data=this.Frame.SubFrame[0].Frame.Data;
7792
+ if (!data) break;
7793
+ if (this.CursorIndex+data.DataOffset+1>=data.Data.length) break;
7794
+
7795
+ ++this.CursorIndex;
7796
+ this.UpdatePointByCursorIndex();
7797
+ this.DrawDynamicInfo();
7798
+ this.ShowTooltipByKeyDown();
7799
+ }
7800
+ break;
7801
+ }
7802
+
7803
+
7804
+ if (!bStop) this.AutoKeyboardMove();
7805
+ return true;
7806
+ }
7807
+
7808
+
7809
+ this.OnKeyUp=function(e)
7810
+ {
7811
+ this.IsPressKeyboard=false;
7812
+ this.ClearKeyboardMoveTimer();
7813
+ }
7814
+
7648
7815
  this.OnDoubleClick=function(x,y,e)
7649
7816
  {
7650
7817
 
@@ -11821,6 +11988,12 @@ function OnKeyDown(e) //键盘事件
11821
11988
  this.JSChartContainer.OnKeyDown(e);
11822
11989
  }
11823
11990
 
11991
+ function OnKeyUp(e) //键盘事件
11992
+ {
11993
+ if(this.JSChartContainer && this.JSChartContainer.OnKeyUp)
11994
+ this.JSChartContainer.OnKeyUp(e);
11995
+ }
11996
+
11824
11997
  function OnWheel(e) //上下滚动事件
11825
11998
  {
11826
11999
  if(this.JSChartContainer && this.JSChartContainer.OnWheel)
@@ -79759,7 +79932,12 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
79759
79932
  }
79760
79933
  }
79761
79934
 
79762
- if (bRegisterKeydown) this.UIElement.addEventListener("keydown", (e)=>{ this.OnKeyDown(e); }, true); //键盘消息
79935
+ if (bRegisterKeydown)
79936
+ {
79937
+ this.UIElement.addEventListener("keydown", (e)=>{ this.OnKeyDown(e); }, true); //键盘消息
79938
+ this.UIElement.addEventListener("keyup", (e)=>{ this.OnKeyUp(e);}, true);
79939
+ }
79940
+
79763
79941
  if (bRegisterWheel) this.UIElement.addEventListener("wheel", (e)=>{ this.OnWheel(e); }, true); //上下滚动消息
79764
79942
 
79765
79943
  this.InitalPopMinuteChart(option);
@@ -81539,7 +81717,8 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
81539
81717
 
81540
81718
  this.RecvRealtimeData=function(data)
81541
81719
  {
81542
- if (this.IsOnTouch==true) return; //正在操作中不更新数据
81720
+ if (this.IsOnTouch==true) return; //正在操作手势不更新数据
81721
+ if (this.IsPressKeyboard==true) return; //正在操作键盘不更新数据
81543
81722
 
81544
81723
  if (data.Ver==3.0)
81545
81724
  {
@@ -81879,6 +82058,8 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
81879
82058
  this.RecvMinuteRealtimeDataV2=function(data) //新版本的
81880
82059
  {
81881
82060
  if (this.IsOnTouch==true) return; //正在操作中不更新数据
82061
+ if (this.IsPressKeyboard==true) return; //正在操作键盘不更新数据
82062
+
81882
82063
  if (this.EnableVerifyRecvData && data.symbol!=this.Symbol)
81883
82064
  {
81884
82065
  JSConsole.Chart.Warn(`[KLineChartContainer::RecvMinuteRealtimeDataV2] recv data symbol not match. HQChart[${this.Symbol}] , Recv[${data.symbol}]`);
@@ -89658,7 +89839,11 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
89658
89839
  }
89659
89840
  }
89660
89841
 
89661
- if (bRegisterKeydown) this.UIElement.addEventListener("keydown", (e)=>{ this.OnKeyDown(e);} , true); //键盘消息
89842
+ if (bRegisterKeydown)
89843
+ {
89844
+ this.UIElement.addEventListener("keydown", (e)=>{ this.OnKeyDown(e);} , true); //键盘消息
89845
+ this.UIElement.addEventListener("keyup", (e)=>{ this.OnKeyUp(e);}, true);
89846
+ }
89662
89847
  if (bRegisterWheel) this.UIElement.addEventListener("wheel", (e)=>{ this.OnWheel(e); }, true); //上下滚动消息
89663
89848
  }
89664
89849
 
@@ -91555,7 +91740,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
91555
91740
  return;
91556
91741
  }
91557
91742
 
91558
- if (this.IsOnTouch==true) //正在操作中不更新数据
91743
+ if (this.IsOnTouch==true || this.IsPressKeyboard==true) //正在操作中不更新数据
91559
91744
  {
91560
91745
  if (this.SourceData && IFrameSplitOperator.IsNonEmptyArray(this.SourceData.Data))
91561
91746
  {
@@ -95189,6 +95374,7 @@ function KLineChartHScreenContainer(uielement)
95189
95374
  }
95190
95375
 
95191
95376
  this.UIElement.addEventListener("keydown", OnKeyDown, true); //键盘消息
95377
+ this.UIElement.addEventListener("keyup", OnKeyUp, true);
95192
95378
  }
95193
95379
 
95194
95380
  //创建子窗口
@@ -95377,6 +95563,7 @@ function MinuteChartHScreenContainer(uielement)
95377
95563
  this.ChartCorssCursor.CallAcutionXOperator.Frame=this.Frame.SubFrame[0].Frame;
95378
95564
 
95379
95565
  this.UIElement.addEventListener("keydown", OnKeyDown, true); //键盘消息
95566
+ this.UIElement.addEventListener("keyup", OnKeyUp, true);
95380
95567
  }
95381
95568
 
95382
95569
  //创建子窗口
@@ -95545,7 +95732,11 @@ function DepthChartContainer(uielement)
95545
95732
  }
95546
95733
  }
95547
95734
 
95548
- if (bRegisterKeydown) this.UIElement.addEventListener("keydown", (e)=>{ this.OnKeyDown(e); }, true); //键盘消息
95735
+ if (bRegisterKeydown)
95736
+ {
95737
+ this.UIElement.addEventListener("keydown", (e)=>{ this.OnKeyDown(e); }, true); //键盘消息
95738
+ this.UIElement.addEventListener("keyup", (e)=>{ this.OnKeyUp(e);}, true);
95739
+ }
95549
95740
  if (bRegisterWheel) this.UIElement.addEventListener("wheel", (e)=>{ this.OnWheel(e); }, true); //上下滚动消息
95550
95741
  }
95551
95742
 
@@ -4499,6 +4499,12 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
4499
4499
  if (option.DrawTool.StorageKey && chart.ChartDrawStorage) chart.ChartDrawStorage.Load(option.DrawTool.StorageKey);
4500
4500
  }
4501
4501
 
4502
+ if (option.KeyboardMove)
4503
+ {
4504
+ var item=option.KeyboardMove;
4505
+ if (IFrameSplitOperator.IsPlusNumber(item.Delay)) chart.KeyboardMove.Delay=item.Delay;
4506
+ }
4507
+
4502
4508
  if (IFrameSplitOperator.IsNumber(option.StepPixel)) chart.StepPixel=option.StepPixel;
4503
4509
  if (option.ZoomStepPixel>0) chart.ZoomStepPixel=option.ZoomStepPixel;
4504
4510
  if (option.IsApiPeriod==true) chart.IsApiPeriod=option.IsApiPeriod;
@@ -7276,7 +7282,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7276
7282
  this.DisableMouse=false; //禁止鼠标事件
7277
7283
  this.LanguageID=JSCHART_LANGUAGE_ID.LANGUAGE_CHINESE_ID;
7278
7284
  this.PressTime=500;
7279
- this.IsPress=false; //是否长按
7285
+ this.IsPress=false; //是否长按
7286
+ this.IsPressKeyboard=false; //是否键盘按键
7280
7287
 
7281
7288
  this.NetworkFilter; //网络请求回调 function(data, callback);
7282
7289
  this.LastMouseStatus={ MouseOnToolbar:null }; // MouseOnToolbar={ Rect:{}, Title: }
@@ -7360,6 +7367,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7360
7367
  this.AryHotKey=[]; //热键 { KeyID:87, SecondKeyID:1, CMD:JSCHART_MENU_ID.CMD_FULLSCREEN_SUMMARY_ID, Args:null, Description:"Alt+W 全屏区间统计" },
7361
7368
 
7362
7369
  this.FastSlideConfig={ MinDistance:500, MinSpeed:3, MaxTime:250, Enable:false }; //快速滑动配置 MinDistance=最小的距离 MinSpeed=最小速度 MaxTime=最大间隔时间(ms)
7370
+ this.KeyboardMove={ Timer:null, Delay:100 , Enable:false, Event:null }; //键盘左右移动
7363
7371
 
7364
7372
  this.RestoreFocus=function(delay)
7365
7373
  {
@@ -11529,6 +11537,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
11529
11537
  if (this.ChartSplashPaint && this.ChartSplashPaint.IsEnableSplash == true) return;
11530
11538
 
11531
11539
  var keyID = e.keyCode ? e.keyCode :e.which;
11540
+ this.IsPressKeyboard=true;
11532
11541
 
11533
11542
  //回调事件
11534
11543
  var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_KEYDOWN);
@@ -11563,6 +11572,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
11563
11572
  switch(keyID)
11564
11573
  {
11565
11574
  case 37: //left
11575
+ if (this.KeyboardMove.Enable) break;
11566
11576
  if ((e.ctrlKey||e.shiftKey) && this.OnCustomKeyDown)
11567
11577
  {
11568
11578
  if (this.OnCustomKeyDown(keyID, e))
@@ -11602,6 +11612,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
11602
11612
  }
11603
11613
  break;
11604
11614
  case 39: //right
11615
+ if (this.KeyboardMove.Enable) break;
11605
11616
  if ((e.ctrlKey|| e.shiftKey) && this.OnCustomKeyDown)
11606
11617
  {
11607
11618
  if (this.OnCustomKeyDown(keyID, e))
@@ -11736,11 +11747,167 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
11736
11747
 
11737
11748
  if (draw) this.DrawDynamicInfo();
11738
11749
 
11750
+ if (keyID==37 || keyID==39)
11751
+ this.StartKeyboardMoveTimer(e);
11752
+
11739
11753
  //不让滚动条滚动
11740
11754
  if(e.preventDefault) e.preventDefault();
11741
11755
  else e.returnValue = false;
11742
11756
  }
11743
11757
 
11758
+
11759
+ this.ClearKeyboardMoveTimer=function()
11760
+ {
11761
+ if (!this.KeyboardMove) return;
11762
+
11763
+ this.KeyboardMove.Event=null;
11764
+
11765
+ if (this.KeyboardMove.Timer)
11766
+ {
11767
+ clearTimeout(this.KeyboardMove.Timer);
11768
+ this.KeyboardMove.Timer=null;
11769
+ JSConsole.Chart.Log(`[JSChartContainer::ClearKeyboardMoveTimer] Stop` );
11770
+ }
11771
+
11772
+ this.KeyboardMove.Enable=false;
11773
+ }
11774
+
11775
+ this.StartKeyboardMoveTimer=function(e)
11776
+ {
11777
+ if (!this.KeyboardMove) return;
11778
+ if (this.KeyboardMove.Enable) return; //已启动
11779
+
11780
+ this.KeyboardMove.Event=e;
11781
+ this.KeyboardMove.Enable=true;
11782
+
11783
+ JSConsole.Chart.Log(`[JSChartContainer::StartKeyboardMoveTimer] Start` );
11784
+
11785
+ this.AutoKeyboardMove();
11786
+ }
11787
+
11788
+ this.AutoKeyboardMove=function()
11789
+ {
11790
+ if (!this.KeyboardMove) return false;
11791
+ if (!this.KeyboardMove.Enable) return false;
11792
+ if (!this.KeyboardMove.Event) return false;
11793
+
11794
+ this.KeyboardMove.Timer=setTimeout(()=>
11795
+ {
11796
+ this.OnKeyboardMoveTimerProc();
11797
+ },this.KeyboardMove.Delay);
11798
+ }
11799
+
11800
+
11801
+ this.OnKeyboardMoveTimerProc=function()
11802
+ {
11803
+ if (!this.KeyboardMove) return false;
11804
+ if (!this.KeyboardMove.Enable) return false;
11805
+ if (!this.KeyboardMove.Event) return false;
11806
+
11807
+ var e=this.KeyboardMove.Event;
11808
+ var keyID = e.keyCode ? e.keyCode :e.which;
11809
+ var bStop=false;
11810
+ switch(keyID)
11811
+ {
11812
+ case 37: //left
11813
+ if ((e.ctrlKey||e.shiftKey) && this.OnCustomKeyDown)
11814
+ {
11815
+ if (this.OnCustomKeyDown(keyID, e))
11816
+ break;
11817
+ }
11818
+
11819
+ //K线 如果超出K线数据了 调整到最后一个数据
11820
+ if (this.FixCursorIndexValid && this.FixCursorIndexValid())
11821
+ {
11822
+ this.UpdatePointByCursorIndex();
11823
+ this.DrawDynamicInfo();
11824
+ this.ShowTooltipByKeyDown();
11825
+ break;
11826
+ }
11827
+
11828
+ if (this.CursorIndex<=0.99999)
11829
+ {
11830
+ if (!this.DataMoveLeft())
11831
+ { //左移数据到头了 触发下载新数据
11832
+ if (this.DragDownloadData) this.DragDownloadData();
11833
+ break;
11834
+ }
11835
+ this.UpdataDataoffset();
11836
+ this.UpdatePointByCursorIndex();
11837
+ this.UpdateFrameMaxMin();
11838
+ this.ResetFrameXSplit();
11839
+ this.Draw();
11840
+ this.ShowTooltipByKeyDown();
11841
+ this.OnKLinePageChange("keydown");
11842
+ }
11843
+ else
11844
+ {
11845
+ --this.CursorIndex;
11846
+ this.UpdatePointByCursorIndex();
11847
+ this.DrawDynamicInfo();
11848
+ this.ShowTooltipByKeyDown();
11849
+ }
11850
+ break;
11851
+
11852
+ case 39: //right
11853
+ if ((e.ctrlKey|| e.shiftKey) && this.OnCustomKeyDown)
11854
+ {
11855
+ if (this.OnCustomKeyDown(keyID, e))
11856
+ break;
11857
+ }
11858
+
11859
+ //K线 如果超出K线数据了 调整到最后一个数据
11860
+ if (this.FixCursorIndexValid && this.FixCursorIndexValid())
11861
+ {
11862
+ this.UpdatePointByCursorIndex();
11863
+ this.DrawDynamicInfo();
11864
+ this.ShowTooltipByKeyDown();
11865
+ break;
11866
+ }
11867
+
11868
+ var xPointcount=0;
11869
+ if (this.Frame.XPointCount) xPointcount=this.Frame.XPointCount;
11870
+ else xPointcount=this.Frame.SubFrame[0].Frame.XPointCount;
11871
+ if (this.CursorIndex+1>=xPointcount)
11872
+ {
11873
+ if (!this.DataMoveRight()) break;
11874
+ this.UpdataDataoffset();
11875
+ this.UpdatePointByCursorIndex();
11876
+ this.UpdateFrameMaxMin();
11877
+ this.ResetFrameXSplit();
11878
+ this.Draw();
11879
+ this.ShowTooltipByKeyDown();
11880
+ this.OnKLinePageChange("keydown");
11881
+ }
11882
+ else
11883
+ {
11884
+ //判断是否在最后一个数据上
11885
+ var data=null;
11886
+ if (this.Frame.Data) data=this.Frame.Data;
11887
+ else data=this.Frame.SubFrame[0].Frame.Data;
11888
+ if (!data) break;
11889
+ if (this.CursorIndex+data.DataOffset+1>=data.Data.length) break;
11890
+
11891
+ ++this.CursorIndex;
11892
+ this.UpdatePointByCursorIndex();
11893
+ this.DrawDynamicInfo();
11894
+ this.ShowTooltipByKeyDown();
11895
+ }
11896
+ break;
11897
+ }
11898
+
11899
+
11900
+ if (!bStop) this.AutoKeyboardMove();
11901
+ return true;
11902
+ }
11903
+
11904
+
11905
+ this.OnKeyUp=function(e)
11906
+ {
11907
+ this.IsPressKeyboard=false;
11908
+ this.ClearKeyboardMoveTimer();
11909
+ }
11910
+
11744
11911
  this.OnDoubleClick=function(x,y,e)
11745
11912
  {
11746
11913
 
@@ -15917,6 +16084,12 @@ function OnKeyDown(e) //键盘事件
15917
16084
  this.JSChartContainer.OnKeyDown(e);
15918
16085
  }
15919
16086
 
16087
+ function OnKeyUp(e) //键盘事件
16088
+ {
16089
+ if(this.JSChartContainer && this.JSChartContainer.OnKeyUp)
16090
+ this.JSChartContainer.OnKeyUp(e);
16091
+ }
16092
+
15920
16093
  function OnWheel(e) //上下滚动事件
15921
16094
  {
15922
16095
  if(this.JSChartContainer && this.JSChartContainer.OnWheel)
@@ -83855,7 +84028,12 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
83855
84028
  }
83856
84029
  }
83857
84030
 
83858
- if (bRegisterKeydown) this.UIElement.addEventListener("keydown", (e)=>{ this.OnKeyDown(e); }, true); //键盘消息
84031
+ if (bRegisterKeydown)
84032
+ {
84033
+ this.UIElement.addEventListener("keydown", (e)=>{ this.OnKeyDown(e); }, true); //键盘消息
84034
+ this.UIElement.addEventListener("keyup", (e)=>{ this.OnKeyUp(e);}, true);
84035
+ }
84036
+
83859
84037
  if (bRegisterWheel) this.UIElement.addEventListener("wheel", (e)=>{ this.OnWheel(e); }, true); //上下滚动消息
83860
84038
 
83861
84039
  this.InitalPopMinuteChart(option);
@@ -85635,7 +85813,8 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
85635
85813
 
85636
85814
  this.RecvRealtimeData=function(data)
85637
85815
  {
85638
- if (this.IsOnTouch==true) return; //正在操作中不更新数据
85816
+ if (this.IsOnTouch==true) return; //正在操作手势不更新数据
85817
+ if (this.IsPressKeyboard==true) return; //正在操作键盘不更新数据
85639
85818
 
85640
85819
  if (data.Ver==3.0)
85641
85820
  {
@@ -85975,6 +86154,8 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
85975
86154
  this.RecvMinuteRealtimeDataV2=function(data) //新版本的
85976
86155
  {
85977
86156
  if (this.IsOnTouch==true) return; //正在操作中不更新数据
86157
+ if (this.IsPressKeyboard==true) return; //正在操作键盘不更新数据
86158
+
85978
86159
  if (this.EnableVerifyRecvData && data.symbol!=this.Symbol)
85979
86160
  {
85980
86161
  JSConsole.Chart.Warn(`[KLineChartContainer::RecvMinuteRealtimeDataV2] recv data symbol not match. HQChart[${this.Symbol}] , Recv[${data.symbol}]`);
@@ -93754,7 +93935,11 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
93754
93935
  }
93755
93936
  }
93756
93937
 
93757
- if (bRegisterKeydown) this.UIElement.addEventListener("keydown", (e)=>{ this.OnKeyDown(e);} , true); //键盘消息
93938
+ if (bRegisterKeydown)
93939
+ {
93940
+ this.UIElement.addEventListener("keydown", (e)=>{ this.OnKeyDown(e);} , true); //键盘消息
93941
+ this.UIElement.addEventListener("keyup", (e)=>{ this.OnKeyUp(e);}, true);
93942
+ }
93758
93943
  if (bRegisterWheel) this.UIElement.addEventListener("wheel", (e)=>{ this.OnWheel(e); }, true); //上下滚动消息
93759
93944
  }
93760
93945
 
@@ -95651,7 +95836,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
95651
95836
  return;
95652
95837
  }
95653
95838
 
95654
- if (this.IsOnTouch==true) //正在操作中不更新数据
95839
+ if (this.IsOnTouch==true || this.IsPressKeyboard==true) //正在操作中不更新数据
95655
95840
  {
95656
95841
  if (this.SourceData && IFrameSplitOperator.IsNonEmptyArray(this.SourceData.Data))
95657
95842
  {
@@ -99285,6 +99470,7 @@ function KLineChartHScreenContainer(uielement)
99285
99470
  }
99286
99471
 
99287
99472
  this.UIElement.addEventListener("keydown", OnKeyDown, true); //键盘消息
99473
+ this.UIElement.addEventListener("keyup", OnKeyUp, true);
99288
99474
  }
99289
99475
 
99290
99476
  //创建子窗口
@@ -99473,6 +99659,7 @@ function MinuteChartHScreenContainer(uielement)
99473
99659
  this.ChartCorssCursor.CallAcutionXOperator.Frame=this.Frame.SubFrame[0].Frame;
99474
99660
 
99475
99661
  this.UIElement.addEventListener("keydown", OnKeyDown, true); //键盘消息
99662
+ this.UIElement.addEventListener("keyup", OnKeyUp, true);
99476
99663
  }
99477
99664
 
99478
99665
  //创建子窗口
@@ -99641,7 +99828,11 @@ function DepthChartContainer(uielement)
99641
99828
  }
99642
99829
  }
99643
99830
 
99644
- if (bRegisterKeydown) this.UIElement.addEventListener("keydown", (e)=>{ this.OnKeyDown(e); }, true); //键盘消息
99831
+ if (bRegisterKeydown)
99832
+ {
99833
+ this.UIElement.addEventListener("keydown", (e)=>{ this.OnKeyDown(e); }, true); //键盘消息
99834
+ this.UIElement.addEventListener("keyup", (e)=>{ this.OnKeyUp(e);}, true);
99835
+ }
99645
99836
  if (bRegisterWheel) this.UIElement.addEventListener("wheel", (e)=>{ this.OnWheel(e); }, true); //上下滚动消息
99646
99837
  }
99647
99838
 
@@ -149378,7 +149569,7 @@ function ScrollBarBGChart()
149378
149569
 
149379
149570
 
149380
149571
 
149381
- var HQCHART_VERSION="1.1.14813";
149572
+ var HQCHART_VERSION="1.1.14819";
149382
149573
 
149383
149574
  function PrintHQChartVersion()
149384
149575
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.14813";
8
+ var HQCHART_VERSION="1.1.14819";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {