hqchart 1.1.14691 → 1.1.14705

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.
@@ -4569,6 +4569,15 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
4569
4569
  }
4570
4570
  }
4571
4571
 
4572
+ if (option.FastSlide)
4573
+ {
4574
+ var item=option.FastSlide;
4575
+ if (IFrameSplitOperator.IsNumber(item.MinDistance)) chart.FastSlideConfig.MinDistance=item.MinDistance;
4576
+ if (IFrameSplitOperator.IsNumber(item.MinSpeed)) chart.FastSlideConfig.MinSpeed=item.MinSpeed;
4577
+ if (IFrameSplitOperator.IsNumber(item.MaxTime)) chart.FastSlideConfig.MaxTime=item.MaxTime;
4578
+ if (IFrameSplitOperator.IsBool(item.Enable)) chart.FastSlideConfig.Enable=item.Enable;
4579
+ }
4580
+
4572
4581
  if (chart.ClassName=="KLineChartContainer")
4573
4582
  {
4574
4583
  if (!option.DragSelectRect)
@@ -4637,6 +4646,12 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
4637
4646
  if (IFrameSplitOperator.IsBool(item.RightButton.Enable)) chart.ChartCorssCursor.RightButton.Enable=item.RightButton.Enable;
4638
4647
  }
4639
4648
 
4649
+ if (item.BottomButton)
4650
+ {
4651
+ var subItem=item.BottomButton;
4652
+ if (IFrameSplitOperator.IsBool(subItem.Enable)) chart.ChartCorssCursor.BottomButton.Enable=subItem.Enable;
4653
+ }
4654
+
4640
4655
  if (IFrameSplitOperator.IsNumber(item.PriceFormatType)) chart.ChartCorssCursor.StringFormatY.PriceFormatType=item.PriceFormatType;
4641
4656
  if (IFrameSplitOperator.IsNumber(item.DataFormatType)) chart.ChartCorssCursor.StringFormatY.DataFormatType=item.DataFormatType;
4642
4657
  if (IFrameSplitOperator.IsBool(item.EnableKeyboard)) chart.ChartCorssCursor.EnableKeyboard=item.EnableKeyboard;
@@ -5121,6 +5136,15 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
5121
5136
  if (IFrameSplitOperator.IsNumber(item.WheelYMove)) chart.EnableYDrag.WheelYMove=item.WheelYMove;
5122
5137
  }
5123
5138
 
5139
+ if (option.FastSlide)
5140
+ {
5141
+ var item=option.FastSlide;
5142
+ if (IFrameSplitOperator.IsNumber(item.MinDistance)) chart.FastSlideConfig.MinDistance=item.MinDistance;
5143
+ if (IFrameSplitOperator.IsNumber(item.MinSpeed)) chart.FastSlideConfig.MinSpeed=item.MinSpeed;
5144
+ if (IFrameSplitOperator.IsNumber(item.MaxTime)) chart.FastSlideConfig.MaxTime=item.MaxTime;
5145
+ if (IFrameSplitOperator.IsBool(item.Enable)) chart.FastSlideConfig.Enable=item.Enable;
5146
+ }
5147
+
5124
5148
  //分页
5125
5149
  if (option.PageInfo) chart.SetPageInfo(option.PageInfo);
5126
5150
 
@@ -5142,6 +5166,12 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
5142
5166
  if (IFrameSplitOperator.IsBool(item.RightButton.Enable)) chart.ChartCorssCursor.RightButton.Enable=item.RightButton.Enable;
5143
5167
  }
5144
5168
 
5169
+ if (item.BottomButton)
5170
+ {
5171
+ var subItem=item.BottomButton;
5172
+ if (IFrameSplitOperator.IsBool(subItem.Enable)) chart.ChartCorssCursor.BottomButton.Enable=subItem.Enable;
5173
+ }
5174
+
5145
5175
  if (IFrameSplitOperator.IsNumber(item.PriceFormatType)) chart.ChartCorssCursor.StringFormatY.PriceFormatType=item.PriceFormatType;
5146
5176
  if (IFrameSplitOperator.IsNumber(item.DataFormatType)) chart.ChartCorssCursor.StringFormatY.DataFormatType=item.DataFormatType;
5147
5177
 
@@ -6878,6 +6908,10 @@ var JSCHART_EVENT_ID=
6878
6908
  ON_DBCLICK_DEAL_ROW:167,
6879
6909
 
6880
6910
  ON_FORMAT_OVERLAY_INDEX_OUT_TEXT:168, //格式化叠指标标题
6911
+
6912
+ ON_TOUCH_FAST_SLIDE:169, //快速滑动
6913
+
6914
+ ON_CLICK_CROSSCURSOR_BOTTOM:170, //十字光标底部文字点击
6881
6915
  }
6882
6916
 
6883
6917
  var JSCHART_OPERATOR_ID=
@@ -6906,6 +6940,8 @@ var JSCHART_OPERATOR_ID=
6906
6940
 
6907
6941
  OP_GOTO:16, //移动到某一个天或某一个分钟
6908
6942
  OP_GOTO_BY_DATAINDEX:17, //的移动到某一个数据起始位置
6943
+
6944
+ OP_MOVE_CORSSCURSOR:18, //移动十字光标 { Step, Start:{ Date:, Time: } }
6909
6945
  }
6910
6946
 
6911
6947
  var JSCHART_DRAG_ID=
@@ -7251,6 +7287,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7251
7287
  this.mapEvent=new Map(); //通知外部调用 key:JSCHART_EVENT_ID value:{Callback:回调,}
7252
7288
 
7253
7289
  this.PhonePinch=null; //手机双指操作信息
7290
+ this.TouchDrag=null; //手势拖动操作信息
7254
7291
  this.IsOnTouch = false; //是否再操作数据
7255
7292
  this.TouchDrawCount = 0; //手势绘制次数
7256
7293
  this.DisableMouse=false; //禁止鼠标事件
@@ -7306,7 +7343,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7306
7343
  this.EnableVerticalDrag=false;
7307
7344
 
7308
7345
  //十字光标长留(手势才有)
7309
- this.ClickModel={ IsShowCorssCursor:false };
7346
+ this.ClickModel={ IsShowCorssCursor:false, PreventHide:false }; //PreventHide 阻止隐藏十字光标
7310
7347
  this.EnableClickModel=false;
7311
7348
 
7312
7349
  //标题栏显示最新数据
@@ -7337,6 +7374,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7337
7374
  //SecondKeyID 1=shiftKey 2=ctrlKey 3=altKey
7338
7375
  this.AryHotKey=[]; //热键 { KeyID:87, SecondKeyID:1, CMD:JSCHART_MENU_ID.CMD_FULLSCREEN_SUMMARY_ID, Args:null, Description:"Alt+W 全屏区间统计" },
7339
7376
 
7377
+ this.FastSlideConfig={ MinDistance:500, MinSpeed:3, MaxTime:250, Enable:false }; //快速滑动配置 MinDistance=最小的距离 MinSpeed=最小速度 MaxTime=最大间隔时间(ms)
7378
+
7340
7379
  this.RestoreFocus=function(delay)
7341
7380
  {
7342
7381
  var value=1000;
@@ -7929,11 +7968,23 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7929
7968
  var button=this.ChartCorssCursor.PtInButton(x,y);
7930
7969
  if (!button) return false;
7931
7970
 
7932
- var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_CROSSCURSOR_RIGHT);
7933
- if (event && event.Callback)
7971
+ if (button.Type==1)
7934
7972
  {
7935
- var sendData={ Button:button, e };
7936
- event.Callback(event,sendData,this);
7973
+ var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_CROSSCURSOR_RIGHT);
7974
+ if (event && event.Callback)
7975
+ {
7976
+ var sendData={ Button:button, e };
7977
+ event.Callback(event,sendData,this);
7978
+ }
7979
+ }
7980
+ else if (button.Type==2)
7981
+ {
7982
+ var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_CROSSCURSOR_BOTTOM);
7983
+ if (event && event.Callback)
7984
+ {
7985
+ var sendData={ Button:button, e };
7986
+ event.Callback(event,sendData,this);
7987
+ }
7937
7988
  }
7938
7989
 
7939
7990
  return true;
@@ -9443,6 +9494,11 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9443
9494
  return true;
9444
9495
  }
9445
9496
 
9497
+ if (this.TryClickCrossCursor(x,y))
9498
+ {
9499
+ return true;
9500
+ }
9501
+
9446
9502
  return false;
9447
9503
  }
9448
9504
 
@@ -9454,6 +9510,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9454
9510
  this.IsOnTouch=true;
9455
9511
  this.TouchDrawCount=0;
9456
9512
  this.PhonePinch=null;
9513
+ this.TouchDrag=null;
9514
+ if (this.ClickModel) this.ClickModel.PreventHide=false;
9457
9515
  this.StopDragTimer();
9458
9516
 
9459
9517
  var isSingleTouch=this.IsSingleTouch(e);
@@ -9468,7 +9526,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9468
9526
  var touches = this.GetToucheData(e, this.IsForceLandscape);
9469
9527
  var pt=this.PointAbsoluteToRelative(touches[0].clientX, touches[0].clientY, true);
9470
9528
 
9471
- if (this.TryPhoneClickButton(pt.X, pt.Y, e)) return;
9529
+ if (this.TryPhoneClickButton(pt.X, pt.Y, e))
9530
+ return;
9472
9531
 
9473
9532
  if (this.EnableVerticalDrag )
9474
9533
  {
@@ -9499,11 +9558,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9499
9558
 
9500
9559
  if (this.EnableClickModel && this.ClickModel.IsShowCorssCursor==true) bStartTimer=false;
9501
9560
 
9502
- var drag=
9503
- {
9504
- "Click":{},
9505
- "LastMove":{} //最后移动的位置
9506
- };
9561
+ var drag= { Click:{}, LastMove:{}, StartTime:Date.now() }; //LastMove 最后移动的位置
9562
+ var touchDrag={ Click:{}, LastMove:{}, StartTime:Date.now() };
9507
9563
 
9508
9564
  //var touches=this.GetToucheData(e,this.IsForceLandscape);
9509
9565
 
@@ -9511,8 +9567,14 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9511
9567
  drag.Click.Y=touches[0].clientY;
9512
9568
  drag.LastMove.X=touches[0].clientX;
9513
9569
  drag.LastMove.Y=touches[0].clientY;
9514
-
9515
9570
  this.MouseDrag=drag;
9571
+
9572
+ touchDrag.Click.X=touches[0].clientX;
9573
+ touchDrag.Click.Y=touches[0].clientY;
9574
+ touchDrag.LastMove.X=touches[0].clientX;
9575
+ touchDrag.LastMove.Y=touches[0].clientY;
9576
+ this.TouchDrag=touchDrag;
9577
+
9516
9578
  var drawPictureActive=this.GetActiveDrawPicture(); //上一次选中的
9517
9579
  var selectedChart={ Chart:this.SelectedChart.Selected.Chart, Identify:this.SelectedChart.Selected.Identify }; //上一次选中的图形
9518
9580
  this.PhoneTouchInfo={ Start:{X:touches[0].clientX, Y:touches[0].clientY }, End:{ X:touches[0].clientX, Y:touches[0].clientY } };
@@ -9634,11 +9696,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9634
9696
  }
9635
9697
  else if (this.IsPhonePinching(e))
9636
9698
  {
9637
- var phonePinch=
9638
- {
9639
- "Start":{},
9640
- "Last":{}
9641
- };
9699
+ var phonePinch={ Start:{}, Last:{}, StartTime:Date.now() };
9642
9700
 
9643
9701
  var touches=this.GetToucheData(e,this.IsForceLandscape);
9644
9702
 
@@ -9773,6 +9831,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9773
9831
  this.PhoneTouchInfo.End.X=touches[0].clientX;
9774
9832
  this.PhoneTouchInfo.End.Y=touches[0].clientY;
9775
9833
  }
9834
+
9835
+ if (this.TouchDrag)
9836
+ {
9837
+ var touchDrag=this.TouchDrag;
9838
+ touchDrag.LastMove.X=touches[0].clientX;
9839
+ touchDrag.LastMove.Y=touches[0].clientY;
9840
+ }
9776
9841
  }
9777
9842
  else if (this.IsPhonePinching(e))
9778
9843
  {
@@ -9839,6 +9904,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9839
9904
  JSConsole.Chart.Log('[KLineChartContainer:OnTouchEnd]',e);
9840
9905
  if (this.ChartSplashPaint && this.ChartSplashPaint.IsEnableSplash == true) return;
9841
9906
 
9907
+ this.FastSlideEvent();
9908
+
9842
9909
  var bClearDrawPicture=true;
9843
9910
  if (this.CurrentChartDrawPicture)
9844
9911
  {
@@ -9877,6 +9944,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9877
9944
  this.OnTouchFinished();
9878
9945
  this.TouchDrawCount=0;
9879
9946
  this.PhonePinch=null;
9947
+ this.TouchDrag=null;
9880
9948
  }
9881
9949
 
9882
9950
  this.OnTouchDBClick=function(points)
@@ -10831,6 +10899,10 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
10831
10899
  {
10832
10900
  if (this.TouchStatus.CorssCursorShow==true) this.ChartCorssCursor.Draw();
10833
10901
  }
10902
+ else if (this.EnableClickModel)
10903
+ {
10904
+ if (this.ClickModel.IsShowCorssCursor===true) this.ChartCorssCursor.Draw();
10905
+ }
10834
10906
  else if (this.IsOnTouch===false && this.CurrentChartDrawPicture && this.CurrentChartDrawPicture.IsShowCorssCursor===true) //开始绘图
10835
10907
  {
10836
10908
  this.ChartCorssCursor.Draw();
@@ -15690,6 +15762,43 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
15690
15762
 
15691
15763
  return true;
15692
15764
  }
15765
+
15766
+ //快速滑动
15767
+ this.FastSlideEvent=function()
15768
+ {
15769
+ if (!this.TouchDrag) return false;
15770
+ if (!this.FastSlideConfig) return false;
15771
+ var config=this.FastSlideConfig;
15772
+ if (!config.Enable) return false;
15773
+
15774
+ var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_TOUCH_FAST_SLIDE);
15775
+ if (!event || !event.Callback) return false;
15776
+
15777
+
15778
+ var drag=this.TouchDrag;
15779
+ var time=Date.now();
15780
+ var spanTime=time-drag.StartTime;
15781
+ if (spanTime>config.MaxTime) return false;
15782
+
15783
+ if (!drag.Click || !drag.LastMove) return false;
15784
+
15785
+ var xStart=drag.Click.X;
15786
+ var xEnd=drag.LastMove.X;
15787
+
15788
+ if (!IFrameSplitOperator.IsNumber(xStart) || !IFrameSplitOperator.IsNumber(xEnd)) return false;
15789
+
15790
+ var distance=xEnd-xStart;
15791
+ var speed=Math.abs(distance)/spanTime;
15792
+ JSConsole.Chart.Log(`[JSChartContainer:FastSlideEvent] speed=${speed}, distance=${distance}, spanTime=${spanTime}`);
15793
+
15794
+ if (Math.abs(distance)<config.MinDistance) return false;
15795
+ if (speed<config.MinSpeed) return false;
15796
+
15797
+ var sendData={ Speed:speed, Distance:distance, IsLeft:distance<0?true:false }
15798
+ event.Callback(event, sendData, this);
15799
+
15800
+ return true;
15801
+ }
15693
15802
  }
15694
15803
 
15695
15804
  function GetDevicePixelRatio()
@@ -44248,7 +44357,7 @@ function ChartMinuteBuySellBar()
44248
44357
  this.BuyColor=g_JSChartResource.Minute.BuySellBar.BuyColor;
44249
44358
  this.SellColor=g_JSChartResource.Minute.BuySellBar.SellColor;
44250
44359
  this.BarWidth=g_JSChartResource.Minute.BuySellBar.BarWidth;
44251
- this.MaxBarWidth=g_JSChartResource.Minute.BuySellBar.MaxBarWidth;
44360
+ this.AryBarRange=g_JSChartResource.Minute.BuySellBar.AryBarRange;
44252
44361
  this.YOffset=g_JSChartResource.Minute.BuySellBar.YOffset;
44253
44362
  this.Font=g_JSChartResource.Minute.BuySellBar.Font;
44254
44363
  this.TextColor=g_JSChartResource.Minute.BuySellBar.TextColor;
@@ -44263,7 +44372,7 @@ function ChartMinuteBuySellBar()
44263
44372
  this.BuyColor=g_JSChartResource.Minute.BuySellBar.BuyColor;
44264
44373
  this.SellColor=g_JSChartResource.Minute.BuySellBar.SellColor;
44265
44374
  this.BarWidth=g_JSChartResource.Minute.BuySellBar.BarWidth;
44266
- this.MaxBarWidth=g_JSChartResource.Minute.BuySellBar.MaxBarWidth;
44375
+ this.AryBarRange=g_JSChartResource.Minute.BuySellBar.AryBarRange;
44267
44376
  this.YOffset=g_JSChartResource.Minute.BuySellBar.YOffset;
44268
44377
  this.Font=g_JSChartResource.Minute.BuySellBar.Font;
44269
44378
  this.TextColor=g_JSChartResource.Minute.BuySellBar.TextColor;
@@ -44279,11 +44388,29 @@ function ChartMinuteBuySellBar()
44279
44388
  var volRange=this.GetVolRange();
44280
44389
  if (!volRange) return;
44281
44390
 
44391
+ var minData=this.HQChart.GetKData();
44392
+ if (!minData || !IFrameSplitOperator.IsNonEmptyArray(minData.Data)) return;
44393
+
44282
44394
  var bHScreen=(this.ChartFrame.IsHScreen===true);
44283
44395
  var xPointCount=this.ChartFrame.XPointCount;
44396
+ var minuteCount=this.ChartFrame.MinuteCount;
44397
+ var minIndex=(minData.Data.length-1)%minuteCount;
44398
+
44399
+ var startIndex=xPointCount-1-120;
44400
+ var endIndex=xPointCount-1;
44401
+ for(var i=0;i<this.AryBarRange.length;++i)
44402
+ {
44403
+ var item=this.AryBarRange[i];
44404
+ if (minIndex<(minuteCount-1-item.End))
44405
+ {
44406
+ startIndex=xPointCount-1-item.Start;
44407
+ endIndex=xPointCount-1-item.End;
44408
+ break;
44409
+ }
44410
+ }
44284
44411
 
44285
- var xStart=this.ChartFrame.GetXFromIndex(xPointCount-this.MaxBarWidth);
44286
- var xEnd=this.ChartFrame.GetXFromIndex(xPointCount-1);
44412
+ var xStart=this.ChartFrame.GetXFromIndex(startIndex);
44413
+ var xEnd=this.ChartFrame.GetXFromIndex(endIndex);
44287
44414
 
44288
44415
  function _Temp_GetXFromData(value)
44289
44416
  {
@@ -59879,6 +60006,12 @@ function ChartCorssCursor()
59879
60006
  Icon:g_JSChartResource.CorssCursor.RightButton.Icon
59880
60007
  };
59881
60008
 
60009
+ //底部按钮
60010
+ this.BottomButton=
60011
+ {
60012
+ Enable:false, Rect:null,
60013
+ }
60014
+
59882
60015
  this.RightMargin=CloneData(g_JSChartResource.CorssCursor.RightMargin);
59883
60016
  this.BottomConfig=CloneData(g_JSChartResource.CorssCursor.BottomText); //底部输出配置
59884
60017
  this.LeftConfig=CloneData(g_JSChartResource.CorssCursor.LeftText);
@@ -60082,6 +60215,7 @@ function ChartCorssCursor()
60082
60215
  {
60083
60216
  this.Status=0;
60084
60217
  this.RightButton.Rect=null;
60218
+ this.BottomButton.Rect=null;
60085
60219
  this.LastValue=null;
60086
60220
 
60087
60221
  if (!this.LastPoint) return;
@@ -60487,6 +60621,11 @@ function ChartCorssCursor()
60487
60621
  this.Canvas.textBaseline="bottom";
60488
60622
  this.Canvas.fillStyle=this.TextColor;
60489
60623
  this.Canvas.fillText(text,rtBG.Left+textOffset.X,rtBG.Bottom+textOffset.Y,textWidth);
60624
+
60625
+ var buttonData={X:x, Y:y, XValue:xValue, FrameID:yValueExtend.FrameID };
60626
+ if (this.StringFormatX.KItem) buttonData.KItem=this.StringFormatX.KItem;
60627
+ this.BottomButton.Rect=rtBG;
60628
+ this.BottomButton.Data=buttonData;
60490
60629
  }
60491
60630
  }
60492
60631
 
@@ -60706,17 +60845,42 @@ function ChartCorssCursor()
60706
60845
  }
60707
60846
 
60708
60847
  this.PtInButton=function(x,y)
60848
+ {
60849
+ var item=this.PtInRightButton(x,y);
60850
+ if (item) return item;
60851
+
60852
+ item=this.PtInButtomButton(x,y);
60853
+ if (item) return item;
60854
+
60855
+ return null;
60856
+ }
60857
+
60858
+ this.PtInRightButton=function(x,y)
60709
60859
  {
60710
60860
  if (!this.RightButton.Enable) return null;
60711
60861
  if (!this.RightButton.Rect) return null;
60712
60862
 
60713
60863
  var rect=this.RightButton.Rect;
60714
- this.Canvas.beginPath();
60715
- this.Canvas.rect(rect.Left,rect.Top,rect.Width,rect.Height);
60716
- if (this.Canvas.isPointInPath(x,y))
60864
+ if (x>=rect.Left && x<=rect.Right && y>=rect.Top && y<=rect.Bottom)
60717
60865
  {
60718
- return { Data:this.RightButton.Data, Rect:rect };
60866
+ return { Data:this.RightButton.Data, Rect:rect, Type:1 }; //Type:1=右侧 2=底部
60719
60867
  }
60868
+
60869
+ return null;
60870
+ }
60871
+
60872
+ this.PtInButtomButton=function(x,y)
60873
+ {
60874
+ if (!this.BottomButton.Enable) return null;
60875
+ if (!this.BottomButton.Rect) return null;
60876
+
60877
+ var rect=this.BottomButton.Rect;
60878
+ if (x>=rect.Left && x<=rect.Right && y>=rect.Top && y<=rect.Bottom)
60879
+ {
60880
+ return { Data:this.BottomButton.Data, Rect:rect , Type:2 }; //Type:1=右侧 2=底部
60881
+ }
60882
+
60883
+ return null;
60720
60884
  }
60721
60885
 
60722
60886
  this.DrawTextBGRect=function(x,y, height, width)
@@ -61764,9 +61928,11 @@ function HQDateStringFormat()
61764
61928
 
61765
61929
  this.DateFormatType=0; //0=YYYY-MM-DD 1=YYYY/MM/DD 2=YYYY/MM/DD/W 3=DD/MM/YYYY
61766
61930
  this.LanguageID=0;
61931
+ this.KItem=null; //缓存当前的K线
61767
61932
 
61768
61933
  this.Operator=function()
61769
61934
  {
61935
+ this.KItem=null;
61770
61936
  if (!IFrameSplitOperator.IsNumber(this.Value)) return false;
61771
61937
  if (!this.Data) return false;
61772
61938
 
@@ -61774,6 +61940,7 @@ function HQDateStringFormat()
61774
61940
  index=parseInt(index.toFixed(0));
61775
61941
  if (this.Data.DataOffset+index>=this.Data.Data.length) return false;
61776
61942
  var currentData = this.Data.Data[this.Data.DataOffset+index];
61943
+ this.KItem=currentData;
61777
61944
  var dateFormatString="YYYY-MM-DD";
61778
61945
  if (this.DateFormatType==1) dateFormatString="YYYY/MM/DD";
61779
61946
  else if (this.DateFormatType==2) dateFormatString="YYYY/MM/DD/W";
@@ -77953,6 +78120,8 @@ function JSChartResource()
77953
78120
  YOffset:1,
77954
78121
  Font:`${12*GetDevicePixelRatio()}px 微软雅黑`,
77955
78122
  TextColor:"rgb(128,128,128)",
78123
+
78124
+ AryBarRange:[{ Start:240, End:120 }, { Start:120, End:0}],
77956
78125
  }
77957
78126
 
77958
78127
  this.DefaultTextColor="rgb(43,54,69)"; //图形中默认的字体颜色
@@ -79503,7 +79672,7 @@ function JSChartResource()
79503
79672
  if (item.Font) dest.Font=item.Font;
79504
79673
  if (item.TextColor) dest.TextColor=item.TextColor;
79505
79674
  if (IFrameSplitOperator.IsNumber(item.BarWidth)) dest.BarWidth=item.BarWidth;
79506
- if (IFrameSplitOperator.IsNumber(item.MaxBarWidth)) dest.MaxBarWidth=item.MaxBarWidth;
79675
+ if (IFrameSplitOperator.IsNonEmptyArray(item.AryBarRange)) dest.AryBarRange=item.AryBarRange;
79507
79676
  if (IFrameSplitOperator.IsNumber(item.YOffset)) dest.YOffset=item.YOffset;
79508
79677
  }
79509
79678
  }
@@ -82716,33 +82885,179 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
82716
82885
  return;
82717
82886
  }
82718
82887
 
82888
+ return this.ChartOperator_Temp_SetChartCorssCursor(findIndex, item);
82889
+ }
82890
+ else if (id==JSCHART_OPERATOR_ID.OP_MOVE_CORSSCURSOR) //移动十字光标 { Step, Start:{ Date, Time }}
82891
+ {
82892
+ if (!IFrameSplitOperator.IsNumber(obj.Step)) return false;
82893
+ if (obj.Step==0) return false;
82894
+ var step=obj.Step;
82895
+
82719
82896
  if (!this.Frame || !this.Frame.SubFrame[0] || !this.Frame.SubFrame[0].Frame) return false;
82720
- var frame=this.Frame.SubFrame[0].Frame;
82897
+ var showCount=this.Frame.SubFrame[0].Frame.XPointCount; //一屏显示个数
82721
82898
 
82722
- var x=frame.GetXFromIndex(findIndex);
82723
- var y=frame.GetYFromData(item.Close);
82899
+ var kData=this.GetKData();
82900
+ if (!kData || !IFrameSplitOperator.IsNonEmptyArray(kData.Data)) return false; //数据还没有到达
82724
82901
 
82725
- //保存最后一次鼠标移动信息
82726
- var MoveStatus={ X:x, Y:y, IsInClient: this.IsMouseOnClient(x,y) };
82727
- this.LastMouseStatus.OnMouseMove=MoveStatus;
82728
- this.LastMouseStatus.MoveOnPoint={X:x, Y:y}; //鼠标移动的位置
82902
+ var start=kData.DataOffset;
82903
+ var bDayPeriod=ChartData.IsDayPeriod(this.Period,true);
82904
+ var findItem=null, dataIndex=-1;
82905
+ for(var i=0; i<kData.Data.length; ++i)
82906
+ {
82907
+ var item=kData.Data[i];
82908
+ if (!item) continue;
82729
82909
 
82730
- var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_MOUSE_MOVE);
82731
- var titleChart=this.TitlePaint[0];
82732
- if (event && titleChart) titleChart.OnMouseMoveEvent=event;
82910
+ if (bDayPeriod)
82911
+ {
82912
+ if (item.Date==obj.Start.Date)
82913
+ {
82914
+ findItem=item;
82915
+ dataIndex=i;
82916
+ break;
82917
+ }
82918
+ }
82919
+ else
82920
+ {
82921
+ if (item.Date==obj.Start.Date && item.Time==obj.Start.Time)
82922
+ {
82923
+ findItem=item;
82924
+ dataIndex=i;
82925
+ break;
82926
+ }
82927
+ }
82928
+ }
82733
82929
 
82734
- var pixelTatio = GetDevicePixelRatio();
82930
+ if (!findItem) return false;
82735
82931
 
82736
- var e={};
82737
- e.clientX=(x/pixelTatio)+this.UIElement.getBoundingClientRect().left;
82738
- e.clientY=(y/pixelTatio)+this.UIElement.getBoundingClientRect().top;
82739
- this.MoveOnPoint={X:x, Y:y};
82740
- this.OnMouseMove(x,y,e);
82741
- this.LastMouseStatus.MoveOnPoint=null;
82742
- if (titleChart) titleChart.OnMouseMoveEvent=null;
82932
+ var index=-1;
82933
+ var dataOffset=kData.DataOffset;
82934
+ if (dataIndex>=start && dataIndex<=start+(showCount-1))
82935
+ {
82936
+ index=dataIndex-start;
82937
+ }
82938
+ else //需要调整当前屏范围
82939
+ {
82940
+ if (step>0)
82941
+ {
82942
+ if (dataIndex+showCount>=kData.Data.length)
82943
+ {
82944
+ dataOffset=kData.Data.length-showCount;
82945
+ index=dataIndex-dataOffset;
82946
+ }
82947
+ else
82948
+ {
82949
+ index=0;
82950
+ dataOffset=dataIndex;
82951
+ }
82952
+ }
82953
+ else
82954
+ {
82955
+ if (dataIndex-showCount<0)
82956
+ {
82957
+ dataOffset=0;
82958
+ index=dataIndex;
82959
+ }
82960
+ else if (dataIndex+showCount>=kData.Data.length)
82961
+ {
82962
+ dataOffset=kData.Data.length-showCount;
82963
+ index=dataIndex-dataOffset;
82964
+ }
82965
+ else
82966
+ {
82967
+ index=showCount;
82968
+ dataOffset=dataIndex-showCount;
82969
+ }
82970
+ }
82971
+ }
82972
+
82973
+ var kItem=findItem;
82974
+ if (step>0)
82975
+ {
82976
+ for(var i=dataIndex+1, j=0; i<kData.Data.length && j<step; ++i, ++j)
82977
+ {
82978
+ ++index;
82979
+ dataIndex=i;
82980
+ if (index>=(showCount-1))
82981
+ {
82982
+ index=showCount-1;
82983
+ dataOffset+=1;
82984
+ }
82985
+
82986
+ var item=kData.Data[i];
82987
+ if (!item) continue;
82988
+
82989
+ var kItem=item;
82990
+ }
82991
+ }
82992
+ else if (step<0)
82993
+ {
82994
+ for(var i=dataIndex-1, j=0;i>=0 && j<Math.abs(step);--i, ++j)
82995
+ {
82996
+ --index
82997
+ dataIndex=i;
82998
+ if (index<=0)
82999
+ {
83000
+ index=0;
83001
+ dataOffset-=1;
83002
+ }
83003
+
83004
+ var item=kData.Data[i];
83005
+ if (!item) continue;
83006
+ var kItem=item;
83007
+ }
83008
+ }
83009
+
83010
+ if (!kItem) return false;
83011
+
83012
+ obj.KItem=kItem;
83013
+ if (kData.DataOffset==dataOffset)
83014
+ {
83015
+ return this.ChartOperator_Temp_SetChartCorssCursor(index, kItem);
83016
+ }
83017
+ else
83018
+ {
83019
+ kData.DataOffset=dataOffset
83020
+ this.UpdataDataoffset(); //更新数据偏移
83021
+ this.UpdateFrameMaxMin(); //调整坐标最大 最小值
83022
+ this.ResetFrameXSplit();
83023
+ this.Frame.SetSizeChage(true);
83024
+ this.Draw();
83025
+ this.ChartOperator_Temp_SetChartCorssCursor(index, kItem);
83026
+ return true;
83027
+ }
82743
83028
  }
82744
83029
  }
82745
83030
 
83031
+
83032
+ this.ChartOperator_Temp_SetChartCorssCursor=function(index, kItem)
83033
+ {
83034
+ if (!this.Frame || !this.Frame.SubFrame[0] || !this.Frame.SubFrame[0].Frame) return false;
83035
+ var frame=this.Frame.SubFrame[0].Frame;
83036
+
83037
+ var x=frame.GetXFromIndex(index);
83038
+ var y=frame.GetYFromData(kItem.Close);
83039
+
83040
+ //保存最后一次鼠标移动信息
83041
+ var MoveStatus={ X:x, Y:y, IsInClient: this.IsMouseOnClient(x,y) };
83042
+ this.LastMouseStatus.OnMouseMove=MoveStatus;
83043
+ this.LastMouseStatus.MoveOnPoint={X:x, Y:y}; //鼠标移动的位置
83044
+
83045
+ var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_MOUSE_MOVE);
83046
+ var titleChart=this.TitlePaint[0];
83047
+ if (event && titleChart) titleChart.OnMouseMoveEvent=event;
83048
+
83049
+ var pixelTatio = GetDevicePixelRatio();
83050
+ var e={ };
83051
+ e.clientX=(x/pixelTatio)+this.UIElement.getBoundingClientRect().left;
83052
+ e.clientY=(y/pixelTatio)+this.UIElement.getBoundingClientRect().top;
83053
+ this.MoveOnPoint={X:x, Y:y};
83054
+ this.OnMouseMove(x,y,e);
83055
+ this.LastMouseStatus.MoveOnPoint=null;
83056
+ if (titleChart) titleChart.OnMouseMoveEvent=null;
83057
+
83058
+ return true;
83059
+ }
83060
+
82746
83061
  //内部函数
82747
83062
  this.ChartOperator_Temp_GetHistoryData=function()
82748
83063
  {
@@ -86926,7 +87241,8 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
86926
87241
  {
86927
87242
  if (this.DragMode==JSCHART_DRAG_ID.CLICK_TOUCH_MODE_ID)
86928
87243
  {
86929
- if (this.TouchStatus.CorssCursorShow==true && this.TouchDrawCount>0) return;
87244
+ if (this.ClickModel.IsShowCorssCursor==true && this.ClickModel.PreventHide) return;
87245
+ if (this.ClickModel.IsShowCorssCursor==true && this.TouchDrawCount>0 ) return;
86930
87246
 
86931
87247
  this.TouchStatus.CorssCursorShow=false;
86932
87248
  this.DrawDynamicInfo();
@@ -86935,7 +87251,8 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
86935
87251
 
86936
87252
  if (this.EnableClickModel===true)
86937
87253
  {
86938
- if (this.ClickModel.IsShowCorssCursor==true && this.TouchDrawCount>0) return;
87254
+ if (this.ClickModel.IsShowCorssCursor==true && this.ClickModel.PreventHide) return; //阻止隐藏
87255
+ if (this.ClickModel.IsShowCorssCursor==true && this.TouchDrawCount>0 ) return;
86939
87256
 
86940
87257
  this.ClickModel.IsShowCorssCursor=false;
86941
87258
  this.DrawDynamicInfo();
@@ -91736,13 +92053,16 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
91736
92053
  this.IsOnTouch=true;
91737
92054
  this.TouchDrawCount=0;
91738
92055
  this.PhonePinch=null;
92056
+ this.TouchDrag=null;
92057
+ if (this.ClickModel) this.ClickModel.PreventHide=false;
91739
92058
  this.StopDragTimer();
91740
92059
 
91741
92060
  if (this.EnableScrollUpDown==false) e.preventDefault(); //上下拖动图形不能阻止事件
91742
92061
 
91743
92062
  if (this.IsPhoneDragging(e))
91744
92063
  {
91745
- var drag= { Click:{}, LastMove:{} };//LastMove=最后移动的位置
92064
+ var drag= { Click:{}, LastMove:{}, StartTime:Date.now() };//LastMove=最后移动的位置 StartTime=开始时间
92065
+ var touchDrag={ Click:{}, LastMove:{}, StartTime:Date.now() };
91746
92066
  var touches=this.GetToucheData(e,this.IsForceLandscape);
91747
92067
  var pt=this.PointAbsoluteToRelative(touches[0].clientX, touches[0].clientY, true);
91748
92068
 
@@ -91768,6 +92088,12 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
91768
92088
  drag.Click.Y=touches[0].clientY;
91769
92089
  drag.LastMove.X=touches[0].clientX;
91770
92090
  drag.LastMove.Y=touches[0].clientY;
92091
+
92092
+ touchDrag.Click.X=touches[0].clientX;
92093
+ touchDrag.Click.Y=touches[0].clientY;
92094
+ touchDrag.LastMove.X=touches[0].clientX;
92095
+ touchDrag.LastMove.Y=touches[0].clientY;
92096
+
91771
92097
  var self=this;
91772
92098
 
91773
92099
  var T_ShowCorssCursor=function() //临时函数(Temp_) T_开头
@@ -91848,6 +92174,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
91848
92174
  }
91849
92175
 
91850
92176
  this.MouseDrag=drag;
92177
+ this.TouchDrag=touchDrag;
91851
92178
  this.PhoneTouchInfo={ Start:{X:touches[0].clientX, Y:touches[0].clientY }, End:{ X:touches[0].clientX, Y:touches[0].clientY } };
91852
92179
  this.SelectChartDrawPicture=null;
91853
92180
 
@@ -91894,11 +92221,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
91894
92221
  }
91895
92222
  else if (this.IsPhonePinching(e))
91896
92223
  {
91897
- var phonePinch=
91898
- {
91899
- "Start":{},
91900
- "Last":{}
91901
- };
92224
+ var phonePinch= { Start:{}, Last:{}, StartTime:Date.now() };
91902
92225
 
91903
92226
  var touches=this.GetToucheData(e,this.IsForceLandscape);
91904
92227
 
@@ -91990,6 +92313,13 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
91990
92313
  this.PhoneTouchInfo.End.X=touches[0].clientX;
91991
92314
  this.PhoneTouchInfo.End.Y=touches[0].clientY;
91992
92315
  }
92316
+
92317
+ if (this.TouchDrag)
92318
+ {
92319
+ var touchDrag=this.TouchDrag;
92320
+ touchDrag.LastMove.X=touches[0].clientX;
92321
+ touchDrag.LastMove.Y=touches[0].clientY;
92322
+ }
91993
92323
  }
91994
92324
  else if (this.IsPhonePinching(e))
91995
92325
  {
@@ -92047,6 +92377,8 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
92047
92377
  JSConsole.Chart.Log('[MinuteChartContainer::OnTouchEnd]',e);
92048
92378
  if (this.ChartSplashPaint && this.ChartSplashPaint.IsEnableSplash == true) return;
92049
92379
 
92380
+ this.FastSlideEvent();
92381
+
92050
92382
  var bClearDrawPicture=true;
92051
92383
  if (this.CurrentChartDrawPicture)
92052
92384
  {
@@ -92082,9 +92414,10 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
92082
92414
  this.TouchEvent({ EventID:JSCHART_EVENT_ID.ON_PHONE_TOUCH, FunctionName:"OnTouchEnd"}, e);
92083
92415
  this.OnTouchFinished();
92084
92416
  this.TouchDrawCount=0;
92417
+ this.TouchDrag=null;
92085
92418
  }
92086
92419
 
92087
-
92420
+
92088
92421
  //键盘左右移动十字光标
92089
92422
  this.OnKeyDown=function(e)
92090
92423
  {
@@ -93190,6 +93523,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
93190
93523
  buySellBar.Name="Minute-BuySell-Bar";
93191
93524
  buySellBar.Identify="Minute-BuySell-Bar";
93192
93525
  buySellBar.BuySellData=this.BuySellData;
93526
+ buySellBar.HQChart=this;
93193
93527
  this.ChartPaint[3]=buySellBar;
93194
93528
 
93195
93529
 
@@ -95790,6 +96124,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
95790
96124
  {
95791
96125
  if (this.EnableClickModel===true)
95792
96126
  {
96127
+ if (this.ClickModel.IsShowCorssCursor==true && this.ClickModel.PreventHide) return; //阻止隐藏
95793
96128
  if (this.ClickModel.IsShowCorssCursor==true && this.TouchDrawCount>0) return;
95794
96129
 
95795
96130
  this.ClickModel.IsShowCorssCursor=false;
@@ -98012,7 +98347,7 @@ function KLineChartHScreenContainer(uielement)
98012
98347
 
98013
98348
  if (this.VerticalDrag) bStartTimer=false;
98014
98349
 
98015
- var drag= { Click:{}, LastMove:{} }; //LastMove=最后移动的位置
98350
+ var drag= { Click:{}, LastMove:{}, StartTime:Date.now() }; //LastMove=最后移动的位置
98016
98351
 
98017
98352
 
98018
98353
  //var touches=this.GetToucheData(e,false);
@@ -98109,11 +98444,7 @@ function KLineChartHScreenContainer(uielement)
98109
98444
  }
98110
98445
  else if (this.IsPhonePinching(e))
98111
98446
  {
98112
- var phonePinch=
98113
- {
98114
- "Start":{},
98115
- "Last":{}
98116
- };
98447
+ var phonePinch={ Start:{}, Last:{}, StartTime:Date.now() };
98117
98448
 
98118
98449
  var touches=this.GetToucheData(e,false);
98119
98450
 
@@ -158346,7 +158677,7 @@ function HQChartScriptWorker()
158346
158677
 
158347
158678
 
158348
158679
 
158349
- var HQCHART_VERSION="1.1.14690";
158680
+ var HQCHART_VERSION="1.1.14704";
158350
158681
 
158351
158682
  function PrintHQChartVersion()
158352
158683
  {