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.
@@ -429,6 +429,15 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
429
429
  }
430
430
  }
431
431
 
432
+ if (option.FastSlide)
433
+ {
434
+ var item=option.FastSlide;
435
+ if (IFrameSplitOperator.IsNumber(item.MinDistance)) chart.FastSlideConfig.MinDistance=item.MinDistance;
436
+ if (IFrameSplitOperator.IsNumber(item.MinSpeed)) chart.FastSlideConfig.MinSpeed=item.MinSpeed;
437
+ if (IFrameSplitOperator.IsNumber(item.MaxTime)) chart.FastSlideConfig.MaxTime=item.MaxTime;
438
+ if (IFrameSplitOperator.IsBool(item.Enable)) chart.FastSlideConfig.Enable=item.Enable;
439
+ }
440
+
432
441
  if (chart.ClassName=="KLineChartContainer")
433
442
  {
434
443
  if (!option.DragSelectRect)
@@ -497,6 +506,12 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
497
506
  if (IFrameSplitOperator.IsBool(item.RightButton.Enable)) chart.ChartCorssCursor.RightButton.Enable=item.RightButton.Enable;
498
507
  }
499
508
 
509
+ if (item.BottomButton)
510
+ {
511
+ var subItem=item.BottomButton;
512
+ if (IFrameSplitOperator.IsBool(subItem.Enable)) chart.ChartCorssCursor.BottomButton.Enable=subItem.Enable;
513
+ }
514
+
500
515
  if (IFrameSplitOperator.IsNumber(item.PriceFormatType)) chart.ChartCorssCursor.StringFormatY.PriceFormatType=item.PriceFormatType;
501
516
  if (IFrameSplitOperator.IsNumber(item.DataFormatType)) chart.ChartCorssCursor.StringFormatY.DataFormatType=item.DataFormatType;
502
517
  if (IFrameSplitOperator.IsBool(item.EnableKeyboard)) chart.ChartCorssCursor.EnableKeyboard=item.EnableKeyboard;
@@ -981,6 +996,15 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
981
996
  if (IFrameSplitOperator.IsNumber(item.WheelYMove)) chart.EnableYDrag.WheelYMove=item.WheelYMove;
982
997
  }
983
998
 
999
+ if (option.FastSlide)
1000
+ {
1001
+ var item=option.FastSlide;
1002
+ if (IFrameSplitOperator.IsNumber(item.MinDistance)) chart.FastSlideConfig.MinDistance=item.MinDistance;
1003
+ if (IFrameSplitOperator.IsNumber(item.MinSpeed)) chart.FastSlideConfig.MinSpeed=item.MinSpeed;
1004
+ if (IFrameSplitOperator.IsNumber(item.MaxTime)) chart.FastSlideConfig.MaxTime=item.MaxTime;
1005
+ if (IFrameSplitOperator.IsBool(item.Enable)) chart.FastSlideConfig.Enable=item.Enable;
1006
+ }
1007
+
984
1008
  //分页
985
1009
  if (option.PageInfo) chart.SetPageInfo(option.PageInfo);
986
1010
 
@@ -1002,6 +1026,12 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
1002
1026
  if (IFrameSplitOperator.IsBool(item.RightButton.Enable)) chart.ChartCorssCursor.RightButton.Enable=item.RightButton.Enable;
1003
1027
  }
1004
1028
 
1029
+ if (item.BottomButton)
1030
+ {
1031
+ var subItem=item.BottomButton;
1032
+ if (IFrameSplitOperator.IsBool(subItem.Enable)) chart.ChartCorssCursor.BottomButton.Enable=subItem.Enable;
1033
+ }
1034
+
1005
1035
  if (IFrameSplitOperator.IsNumber(item.PriceFormatType)) chart.ChartCorssCursor.StringFormatY.PriceFormatType=item.PriceFormatType;
1006
1036
  if (IFrameSplitOperator.IsNumber(item.DataFormatType)) chart.ChartCorssCursor.StringFormatY.DataFormatType=item.DataFormatType;
1007
1037
 
@@ -2738,6 +2768,10 @@ var JSCHART_EVENT_ID=
2738
2768
  ON_DBCLICK_DEAL_ROW:167,
2739
2769
 
2740
2770
  ON_FORMAT_OVERLAY_INDEX_OUT_TEXT:168, //格式化叠指标标题
2771
+
2772
+ ON_TOUCH_FAST_SLIDE:169, //快速滑动
2773
+
2774
+ ON_CLICK_CROSSCURSOR_BOTTOM:170, //十字光标底部文字点击
2741
2775
  }
2742
2776
 
2743
2777
  var JSCHART_OPERATOR_ID=
@@ -2766,6 +2800,8 @@ var JSCHART_OPERATOR_ID=
2766
2800
 
2767
2801
  OP_GOTO:16, //移动到某一个天或某一个分钟
2768
2802
  OP_GOTO_BY_DATAINDEX:17, //的移动到某一个数据起始位置
2803
+
2804
+ OP_MOVE_CORSSCURSOR:18, //移动十字光标 { Step, Start:{ Date:, Time: } }
2769
2805
  }
2770
2806
 
2771
2807
  var JSCHART_DRAG_ID=
@@ -3111,6 +3147,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
3111
3147
  this.mapEvent=new Map(); //通知外部调用 key:JSCHART_EVENT_ID value:{Callback:回调,}
3112
3148
 
3113
3149
  this.PhonePinch=null; //手机双指操作信息
3150
+ this.TouchDrag=null; //手势拖动操作信息
3114
3151
  this.IsOnTouch = false; //是否再操作数据
3115
3152
  this.TouchDrawCount = 0; //手势绘制次数
3116
3153
  this.DisableMouse=false; //禁止鼠标事件
@@ -3166,7 +3203,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
3166
3203
  this.EnableVerticalDrag=false;
3167
3204
 
3168
3205
  //十字光标长留(手势才有)
3169
- this.ClickModel={ IsShowCorssCursor:false };
3206
+ this.ClickModel={ IsShowCorssCursor:false, PreventHide:false }; //PreventHide 阻止隐藏十字光标
3170
3207
  this.EnableClickModel=false;
3171
3208
 
3172
3209
  //标题栏显示最新数据
@@ -3197,6 +3234,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
3197
3234
  //SecondKeyID 1=shiftKey 2=ctrlKey 3=altKey
3198
3235
  this.AryHotKey=[]; //热键 { KeyID:87, SecondKeyID:1, CMD:JSCHART_MENU_ID.CMD_FULLSCREEN_SUMMARY_ID, Args:null, Description:"Alt+W 全屏区间统计" },
3199
3236
 
3237
+ this.FastSlideConfig={ MinDistance:500, MinSpeed:3, MaxTime:250, Enable:false }; //快速滑动配置 MinDistance=最小的距离 MinSpeed=最小速度 MaxTime=最大间隔时间(ms)
3238
+
3200
3239
  this.RestoreFocus=function(delay)
3201
3240
  {
3202
3241
  var value=1000;
@@ -3789,11 +3828,23 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
3789
3828
  var button=this.ChartCorssCursor.PtInButton(x,y);
3790
3829
  if (!button) return false;
3791
3830
 
3792
- var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_CROSSCURSOR_RIGHT);
3793
- if (event && event.Callback)
3831
+ if (button.Type==1)
3794
3832
  {
3795
- var sendData={ Button:button, e };
3796
- event.Callback(event,sendData,this);
3833
+ var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_CROSSCURSOR_RIGHT);
3834
+ if (event && event.Callback)
3835
+ {
3836
+ var sendData={ Button:button, e };
3837
+ event.Callback(event,sendData,this);
3838
+ }
3839
+ }
3840
+ else if (button.Type==2)
3841
+ {
3842
+ var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_CROSSCURSOR_BOTTOM);
3843
+ if (event && event.Callback)
3844
+ {
3845
+ var sendData={ Button:button, e };
3846
+ event.Callback(event,sendData,this);
3847
+ }
3797
3848
  }
3798
3849
 
3799
3850
  return true;
@@ -5303,6 +5354,11 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
5303
5354
  return true;
5304
5355
  }
5305
5356
 
5357
+ if (this.TryClickCrossCursor(x,y))
5358
+ {
5359
+ return true;
5360
+ }
5361
+
5306
5362
  return false;
5307
5363
  }
5308
5364
 
@@ -5314,6 +5370,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
5314
5370
  this.IsOnTouch=true;
5315
5371
  this.TouchDrawCount=0;
5316
5372
  this.PhonePinch=null;
5373
+ this.TouchDrag=null;
5374
+ if (this.ClickModel) this.ClickModel.PreventHide=false;
5317
5375
  this.StopDragTimer();
5318
5376
 
5319
5377
  var isSingleTouch=this.IsSingleTouch(e);
@@ -5328,7 +5386,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
5328
5386
  var touches = this.GetToucheData(e, this.IsForceLandscape);
5329
5387
  var pt=this.PointAbsoluteToRelative(touches[0].clientX, touches[0].clientY, true);
5330
5388
 
5331
- if (this.TryPhoneClickButton(pt.X, pt.Y, e)) return;
5389
+ if (this.TryPhoneClickButton(pt.X, pt.Y, e))
5390
+ return;
5332
5391
 
5333
5392
  if (this.EnableVerticalDrag )
5334
5393
  {
@@ -5359,11 +5418,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
5359
5418
 
5360
5419
  if (this.EnableClickModel && this.ClickModel.IsShowCorssCursor==true) bStartTimer=false;
5361
5420
 
5362
- var drag=
5363
- {
5364
- "Click":{},
5365
- "LastMove":{} //最后移动的位置
5366
- };
5421
+ var drag= { Click:{}, LastMove:{}, StartTime:Date.now() }; //LastMove 最后移动的位置
5422
+ var touchDrag={ Click:{}, LastMove:{}, StartTime:Date.now() };
5367
5423
 
5368
5424
  //var touches=this.GetToucheData(e,this.IsForceLandscape);
5369
5425
 
@@ -5371,8 +5427,14 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
5371
5427
  drag.Click.Y=touches[0].clientY;
5372
5428
  drag.LastMove.X=touches[0].clientX;
5373
5429
  drag.LastMove.Y=touches[0].clientY;
5374
-
5375
5430
  this.MouseDrag=drag;
5431
+
5432
+ touchDrag.Click.X=touches[0].clientX;
5433
+ touchDrag.Click.Y=touches[0].clientY;
5434
+ touchDrag.LastMove.X=touches[0].clientX;
5435
+ touchDrag.LastMove.Y=touches[0].clientY;
5436
+ this.TouchDrag=touchDrag;
5437
+
5376
5438
  var drawPictureActive=this.GetActiveDrawPicture(); //上一次选中的
5377
5439
  var selectedChart={ Chart:this.SelectedChart.Selected.Chart, Identify:this.SelectedChart.Selected.Identify }; //上一次选中的图形
5378
5440
  this.PhoneTouchInfo={ Start:{X:touches[0].clientX, Y:touches[0].clientY }, End:{ X:touches[0].clientX, Y:touches[0].clientY } };
@@ -5494,11 +5556,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
5494
5556
  }
5495
5557
  else if (this.IsPhonePinching(e))
5496
5558
  {
5497
- var phonePinch=
5498
- {
5499
- "Start":{},
5500
- "Last":{}
5501
- };
5559
+ var phonePinch={ Start:{}, Last:{}, StartTime:Date.now() };
5502
5560
 
5503
5561
  var touches=this.GetToucheData(e,this.IsForceLandscape);
5504
5562
 
@@ -5633,6 +5691,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
5633
5691
  this.PhoneTouchInfo.End.X=touches[0].clientX;
5634
5692
  this.PhoneTouchInfo.End.Y=touches[0].clientY;
5635
5693
  }
5694
+
5695
+ if (this.TouchDrag)
5696
+ {
5697
+ var touchDrag=this.TouchDrag;
5698
+ touchDrag.LastMove.X=touches[0].clientX;
5699
+ touchDrag.LastMove.Y=touches[0].clientY;
5700
+ }
5636
5701
  }
5637
5702
  else if (this.IsPhonePinching(e))
5638
5703
  {
@@ -5699,6 +5764,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
5699
5764
  JSConsole.Chart.Log('[KLineChartContainer:OnTouchEnd]',e);
5700
5765
  if (this.ChartSplashPaint && this.ChartSplashPaint.IsEnableSplash == true) return;
5701
5766
 
5767
+ this.FastSlideEvent();
5768
+
5702
5769
  var bClearDrawPicture=true;
5703
5770
  if (this.CurrentChartDrawPicture)
5704
5771
  {
@@ -5737,6 +5804,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
5737
5804
  this.OnTouchFinished();
5738
5805
  this.TouchDrawCount=0;
5739
5806
  this.PhonePinch=null;
5807
+ this.TouchDrag=null;
5740
5808
  }
5741
5809
 
5742
5810
  this.OnTouchDBClick=function(points)
@@ -6691,6 +6759,10 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
6691
6759
  {
6692
6760
  if (this.TouchStatus.CorssCursorShow==true) this.ChartCorssCursor.Draw();
6693
6761
  }
6762
+ else if (this.EnableClickModel)
6763
+ {
6764
+ if (this.ClickModel.IsShowCorssCursor===true) this.ChartCorssCursor.Draw();
6765
+ }
6694
6766
  else if (this.IsOnTouch===false && this.CurrentChartDrawPicture && this.CurrentChartDrawPicture.IsShowCorssCursor===true) //开始绘图
6695
6767
  {
6696
6768
  this.ChartCorssCursor.Draw();
@@ -11550,6 +11622,43 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
11550
11622
 
11551
11623
  return true;
11552
11624
  }
11625
+
11626
+ //快速滑动
11627
+ this.FastSlideEvent=function()
11628
+ {
11629
+ if (!this.TouchDrag) return false;
11630
+ if (!this.FastSlideConfig) return false;
11631
+ var config=this.FastSlideConfig;
11632
+ if (!config.Enable) return false;
11633
+
11634
+ var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_TOUCH_FAST_SLIDE);
11635
+ if (!event || !event.Callback) return false;
11636
+
11637
+
11638
+ var drag=this.TouchDrag;
11639
+ var time=Date.now();
11640
+ var spanTime=time-drag.StartTime;
11641
+ if (spanTime>config.MaxTime) return false;
11642
+
11643
+ if (!drag.Click || !drag.LastMove) return false;
11644
+
11645
+ var xStart=drag.Click.X;
11646
+ var xEnd=drag.LastMove.X;
11647
+
11648
+ if (!IFrameSplitOperator.IsNumber(xStart) || !IFrameSplitOperator.IsNumber(xEnd)) return false;
11649
+
11650
+ var distance=xEnd-xStart;
11651
+ var speed=Math.abs(distance)/spanTime;
11652
+ JSConsole.Chart.Log(`[JSChartContainer:FastSlideEvent] speed=${speed}, distance=${distance}, spanTime=${spanTime}`);
11653
+
11654
+ if (Math.abs(distance)<config.MinDistance) return false;
11655
+ if (speed<config.MinSpeed) return false;
11656
+
11657
+ var sendData={ Speed:speed, Distance:distance, IsLeft:distance<0?true:false }
11658
+ event.Callback(event, sendData, this);
11659
+
11660
+ return true;
11661
+ }
11553
11662
  }
11554
11663
 
11555
11664
  function GetDevicePixelRatio()
@@ -40108,7 +40217,7 @@ function ChartMinuteBuySellBar()
40108
40217
  this.BuyColor=g_JSChartResource.Minute.BuySellBar.BuyColor;
40109
40218
  this.SellColor=g_JSChartResource.Minute.BuySellBar.SellColor;
40110
40219
  this.BarWidth=g_JSChartResource.Minute.BuySellBar.BarWidth;
40111
- this.MaxBarWidth=g_JSChartResource.Minute.BuySellBar.MaxBarWidth;
40220
+ this.AryBarRange=g_JSChartResource.Minute.BuySellBar.AryBarRange;
40112
40221
  this.YOffset=g_JSChartResource.Minute.BuySellBar.YOffset;
40113
40222
  this.Font=g_JSChartResource.Minute.BuySellBar.Font;
40114
40223
  this.TextColor=g_JSChartResource.Minute.BuySellBar.TextColor;
@@ -40123,7 +40232,7 @@ function ChartMinuteBuySellBar()
40123
40232
  this.BuyColor=g_JSChartResource.Minute.BuySellBar.BuyColor;
40124
40233
  this.SellColor=g_JSChartResource.Minute.BuySellBar.SellColor;
40125
40234
  this.BarWidth=g_JSChartResource.Minute.BuySellBar.BarWidth;
40126
- this.MaxBarWidth=g_JSChartResource.Minute.BuySellBar.MaxBarWidth;
40235
+ this.AryBarRange=g_JSChartResource.Minute.BuySellBar.AryBarRange;
40127
40236
  this.YOffset=g_JSChartResource.Minute.BuySellBar.YOffset;
40128
40237
  this.Font=g_JSChartResource.Minute.BuySellBar.Font;
40129
40238
  this.TextColor=g_JSChartResource.Minute.BuySellBar.TextColor;
@@ -40139,11 +40248,29 @@ function ChartMinuteBuySellBar()
40139
40248
  var volRange=this.GetVolRange();
40140
40249
  if (!volRange) return;
40141
40250
 
40251
+ var minData=this.HQChart.GetKData();
40252
+ if (!minData || !IFrameSplitOperator.IsNonEmptyArray(minData.Data)) return;
40253
+
40142
40254
  var bHScreen=(this.ChartFrame.IsHScreen===true);
40143
40255
  var xPointCount=this.ChartFrame.XPointCount;
40256
+ var minuteCount=this.ChartFrame.MinuteCount;
40257
+ var minIndex=(minData.Data.length-1)%minuteCount;
40144
40258
 
40145
- var xStart=this.ChartFrame.GetXFromIndex(xPointCount-this.MaxBarWidth);
40146
- var xEnd=this.ChartFrame.GetXFromIndex(xPointCount-1);
40259
+ var startIndex=xPointCount-1-120;
40260
+ var endIndex=xPointCount-1;
40261
+ for(var i=0;i<this.AryBarRange.length;++i)
40262
+ {
40263
+ var item=this.AryBarRange[i];
40264
+ if (minIndex<(minuteCount-1-item.End))
40265
+ {
40266
+ startIndex=xPointCount-1-item.Start;
40267
+ endIndex=xPointCount-1-item.End;
40268
+ break;
40269
+ }
40270
+ }
40271
+
40272
+ var xStart=this.ChartFrame.GetXFromIndex(startIndex);
40273
+ var xEnd=this.ChartFrame.GetXFromIndex(endIndex);
40147
40274
 
40148
40275
  function _Temp_GetXFromData(value)
40149
40276
  {
@@ -55739,6 +55866,12 @@ function ChartCorssCursor()
55739
55866
  Icon:g_JSChartResource.CorssCursor.RightButton.Icon
55740
55867
  };
55741
55868
 
55869
+ //底部按钮
55870
+ this.BottomButton=
55871
+ {
55872
+ Enable:false, Rect:null,
55873
+ }
55874
+
55742
55875
  this.RightMargin=CloneData(g_JSChartResource.CorssCursor.RightMargin);
55743
55876
  this.BottomConfig=CloneData(g_JSChartResource.CorssCursor.BottomText); //底部输出配置
55744
55877
  this.LeftConfig=CloneData(g_JSChartResource.CorssCursor.LeftText);
@@ -55942,6 +56075,7 @@ function ChartCorssCursor()
55942
56075
  {
55943
56076
  this.Status=0;
55944
56077
  this.RightButton.Rect=null;
56078
+ this.BottomButton.Rect=null;
55945
56079
  this.LastValue=null;
55946
56080
 
55947
56081
  if (!this.LastPoint) return;
@@ -56347,6 +56481,11 @@ function ChartCorssCursor()
56347
56481
  this.Canvas.textBaseline="bottom";
56348
56482
  this.Canvas.fillStyle=this.TextColor;
56349
56483
  this.Canvas.fillText(text,rtBG.Left+textOffset.X,rtBG.Bottom+textOffset.Y,textWidth);
56484
+
56485
+ var buttonData={X:x, Y:y, XValue:xValue, FrameID:yValueExtend.FrameID };
56486
+ if (this.StringFormatX.KItem) buttonData.KItem=this.StringFormatX.KItem;
56487
+ this.BottomButton.Rect=rtBG;
56488
+ this.BottomButton.Data=buttonData;
56350
56489
  }
56351
56490
  }
56352
56491
 
@@ -56566,17 +56705,42 @@ function ChartCorssCursor()
56566
56705
  }
56567
56706
 
56568
56707
  this.PtInButton=function(x,y)
56708
+ {
56709
+ var item=this.PtInRightButton(x,y);
56710
+ if (item) return item;
56711
+
56712
+ item=this.PtInButtomButton(x,y);
56713
+ if (item) return item;
56714
+
56715
+ return null;
56716
+ }
56717
+
56718
+ this.PtInRightButton=function(x,y)
56569
56719
  {
56570
56720
  if (!this.RightButton.Enable) return null;
56571
56721
  if (!this.RightButton.Rect) return null;
56572
56722
 
56573
56723
  var rect=this.RightButton.Rect;
56574
- this.Canvas.beginPath();
56575
- this.Canvas.rect(rect.Left,rect.Top,rect.Width,rect.Height);
56576
- if (this.Canvas.isPointInPath(x,y))
56724
+ if (x>=rect.Left && x<=rect.Right && y>=rect.Top && y<=rect.Bottom)
56577
56725
  {
56578
- return { Data:this.RightButton.Data, Rect:rect };
56726
+ return { Data:this.RightButton.Data, Rect:rect, Type:1 }; //Type:1=右侧 2=底部
56579
56727
  }
56728
+
56729
+ return null;
56730
+ }
56731
+
56732
+ this.PtInButtomButton=function(x,y)
56733
+ {
56734
+ if (!this.BottomButton.Enable) return null;
56735
+ if (!this.BottomButton.Rect) return null;
56736
+
56737
+ var rect=this.BottomButton.Rect;
56738
+ if (x>=rect.Left && x<=rect.Right && y>=rect.Top && y<=rect.Bottom)
56739
+ {
56740
+ return { Data:this.BottomButton.Data, Rect:rect , Type:2 }; //Type:1=右侧 2=底部
56741
+ }
56742
+
56743
+ return null;
56580
56744
  }
56581
56745
 
56582
56746
  this.DrawTextBGRect=function(x,y, height, width)
@@ -57624,9 +57788,11 @@ function HQDateStringFormat()
57624
57788
 
57625
57789
  this.DateFormatType=0; //0=YYYY-MM-DD 1=YYYY/MM/DD 2=YYYY/MM/DD/W 3=DD/MM/YYYY
57626
57790
  this.LanguageID=0;
57791
+ this.KItem=null; //缓存当前的K线
57627
57792
 
57628
57793
  this.Operator=function()
57629
57794
  {
57795
+ this.KItem=null;
57630
57796
  if (!IFrameSplitOperator.IsNumber(this.Value)) return false;
57631
57797
  if (!this.Data) return false;
57632
57798
 
@@ -57634,6 +57800,7 @@ function HQDateStringFormat()
57634
57800
  index=parseInt(index.toFixed(0));
57635
57801
  if (this.Data.DataOffset+index>=this.Data.Data.length) return false;
57636
57802
  var currentData = this.Data.Data[this.Data.DataOffset+index];
57803
+ this.KItem=currentData;
57637
57804
  var dateFormatString="YYYY-MM-DD";
57638
57805
  if (this.DateFormatType==1) dateFormatString="YYYY/MM/DD";
57639
57806
  else if (this.DateFormatType==2) dateFormatString="YYYY/MM/DD/W";
@@ -73813,6 +73980,8 @@ function JSChartResource()
73813
73980
  YOffset:1,
73814
73981
  Font:`${12*GetDevicePixelRatio()}px 微软雅黑`,
73815
73982
  TextColor:"rgb(128,128,128)",
73983
+
73984
+ AryBarRange:[{ Start:240, End:120 }, { Start:120, End:0}],
73816
73985
  }
73817
73986
 
73818
73987
  this.DefaultTextColor="rgb(43,54,69)"; //图形中默认的字体颜色
@@ -75363,7 +75532,7 @@ function JSChartResource()
75363
75532
  if (item.Font) dest.Font=item.Font;
75364
75533
  if (item.TextColor) dest.TextColor=item.TextColor;
75365
75534
  if (IFrameSplitOperator.IsNumber(item.BarWidth)) dest.BarWidth=item.BarWidth;
75366
- if (IFrameSplitOperator.IsNumber(item.MaxBarWidth)) dest.MaxBarWidth=item.MaxBarWidth;
75535
+ if (IFrameSplitOperator.IsNonEmptyArray(item.AryBarRange)) dest.AryBarRange=item.AryBarRange;
75367
75536
  if (IFrameSplitOperator.IsNumber(item.YOffset)) dest.YOffset=item.YOffset;
75368
75537
  }
75369
75538
  }
@@ -78576,33 +78745,179 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
78576
78745
  return;
78577
78746
  }
78578
78747
 
78748
+ return this.ChartOperator_Temp_SetChartCorssCursor(findIndex, item);
78749
+ }
78750
+ else if (id==JSCHART_OPERATOR_ID.OP_MOVE_CORSSCURSOR) //移动十字光标 { Step, Start:{ Date, Time }}
78751
+ {
78752
+ if (!IFrameSplitOperator.IsNumber(obj.Step)) return false;
78753
+ if (obj.Step==0) return false;
78754
+ var step=obj.Step;
78755
+
78579
78756
  if (!this.Frame || !this.Frame.SubFrame[0] || !this.Frame.SubFrame[0].Frame) return false;
78580
- var frame=this.Frame.SubFrame[0].Frame;
78757
+ var showCount=this.Frame.SubFrame[0].Frame.XPointCount; //一屏显示个数
78581
78758
 
78582
- var x=frame.GetXFromIndex(findIndex);
78583
- var y=frame.GetYFromData(item.Close);
78759
+ var kData=this.GetKData();
78760
+ if (!kData || !IFrameSplitOperator.IsNonEmptyArray(kData.Data)) return false; //数据还没有到达
78584
78761
 
78585
- //保存最后一次鼠标移动信息
78586
- var MoveStatus={ X:x, Y:y, IsInClient: this.IsMouseOnClient(x,y) };
78587
- this.LastMouseStatus.OnMouseMove=MoveStatus;
78588
- this.LastMouseStatus.MoveOnPoint={X:x, Y:y}; //鼠标移动的位置
78762
+ var start=kData.DataOffset;
78763
+ var bDayPeriod=ChartData.IsDayPeriod(this.Period,true);
78764
+ var findItem=null, dataIndex=-1;
78765
+ for(var i=0; i<kData.Data.length; ++i)
78766
+ {
78767
+ var item=kData.Data[i];
78768
+ if (!item) continue;
78589
78769
 
78590
- var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_MOUSE_MOVE);
78591
- var titleChart=this.TitlePaint[0];
78592
- if (event && titleChart) titleChart.OnMouseMoveEvent=event;
78770
+ if (bDayPeriod)
78771
+ {
78772
+ if (item.Date==obj.Start.Date)
78773
+ {
78774
+ findItem=item;
78775
+ dataIndex=i;
78776
+ break;
78777
+ }
78778
+ }
78779
+ else
78780
+ {
78781
+ if (item.Date==obj.Start.Date && item.Time==obj.Start.Time)
78782
+ {
78783
+ findItem=item;
78784
+ dataIndex=i;
78785
+ break;
78786
+ }
78787
+ }
78788
+ }
78593
78789
 
78594
- var pixelTatio = GetDevicePixelRatio();
78790
+ if (!findItem) return false;
78595
78791
 
78596
- var e={};
78597
- e.clientX=(x/pixelTatio)+this.UIElement.getBoundingClientRect().left;
78598
- e.clientY=(y/pixelTatio)+this.UIElement.getBoundingClientRect().top;
78599
- this.MoveOnPoint={X:x, Y:y};
78600
- this.OnMouseMove(x,y,e);
78601
- this.LastMouseStatus.MoveOnPoint=null;
78602
- if (titleChart) titleChart.OnMouseMoveEvent=null;
78792
+ var index=-1;
78793
+ var dataOffset=kData.DataOffset;
78794
+ if (dataIndex>=start && dataIndex<=start+(showCount-1))
78795
+ {
78796
+ index=dataIndex-start;
78797
+ }
78798
+ else //需要调整当前屏范围
78799
+ {
78800
+ if (step>0)
78801
+ {
78802
+ if (dataIndex+showCount>=kData.Data.length)
78803
+ {
78804
+ dataOffset=kData.Data.length-showCount;
78805
+ index=dataIndex-dataOffset;
78806
+ }
78807
+ else
78808
+ {
78809
+ index=0;
78810
+ dataOffset=dataIndex;
78811
+ }
78812
+ }
78813
+ else
78814
+ {
78815
+ if (dataIndex-showCount<0)
78816
+ {
78817
+ dataOffset=0;
78818
+ index=dataIndex;
78819
+ }
78820
+ else if (dataIndex+showCount>=kData.Data.length)
78821
+ {
78822
+ dataOffset=kData.Data.length-showCount;
78823
+ index=dataIndex-dataOffset;
78824
+ }
78825
+ else
78826
+ {
78827
+ index=showCount;
78828
+ dataOffset=dataIndex-showCount;
78829
+ }
78830
+ }
78831
+ }
78832
+
78833
+ var kItem=findItem;
78834
+ if (step>0)
78835
+ {
78836
+ for(var i=dataIndex+1, j=0; i<kData.Data.length && j<step; ++i, ++j)
78837
+ {
78838
+ ++index;
78839
+ dataIndex=i;
78840
+ if (index>=(showCount-1))
78841
+ {
78842
+ index=showCount-1;
78843
+ dataOffset+=1;
78844
+ }
78845
+
78846
+ var item=kData.Data[i];
78847
+ if (!item) continue;
78848
+
78849
+ var kItem=item;
78850
+ }
78851
+ }
78852
+ else if (step<0)
78853
+ {
78854
+ for(var i=dataIndex-1, j=0;i>=0 && j<Math.abs(step);--i, ++j)
78855
+ {
78856
+ --index
78857
+ dataIndex=i;
78858
+ if (index<=0)
78859
+ {
78860
+ index=0;
78861
+ dataOffset-=1;
78862
+ }
78863
+
78864
+ var item=kData.Data[i];
78865
+ if (!item) continue;
78866
+ var kItem=item;
78867
+ }
78868
+ }
78869
+
78870
+ if (!kItem) return false;
78871
+
78872
+ obj.KItem=kItem;
78873
+ if (kData.DataOffset==dataOffset)
78874
+ {
78875
+ return this.ChartOperator_Temp_SetChartCorssCursor(index, kItem);
78876
+ }
78877
+ else
78878
+ {
78879
+ kData.DataOffset=dataOffset
78880
+ this.UpdataDataoffset(); //更新数据偏移
78881
+ this.UpdateFrameMaxMin(); //调整坐标最大 最小值
78882
+ this.ResetFrameXSplit();
78883
+ this.Frame.SetSizeChage(true);
78884
+ this.Draw();
78885
+ this.ChartOperator_Temp_SetChartCorssCursor(index, kItem);
78886
+ return true;
78887
+ }
78603
78888
  }
78604
78889
  }
78605
78890
 
78891
+
78892
+ this.ChartOperator_Temp_SetChartCorssCursor=function(index, kItem)
78893
+ {
78894
+ if (!this.Frame || !this.Frame.SubFrame[0] || !this.Frame.SubFrame[0].Frame) return false;
78895
+ var frame=this.Frame.SubFrame[0].Frame;
78896
+
78897
+ var x=frame.GetXFromIndex(index);
78898
+ var y=frame.GetYFromData(kItem.Close);
78899
+
78900
+ //保存最后一次鼠标移动信息
78901
+ var MoveStatus={ X:x, Y:y, IsInClient: this.IsMouseOnClient(x,y) };
78902
+ this.LastMouseStatus.OnMouseMove=MoveStatus;
78903
+ this.LastMouseStatus.MoveOnPoint={X:x, Y:y}; //鼠标移动的位置
78904
+
78905
+ var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_MOUSE_MOVE);
78906
+ var titleChart=this.TitlePaint[0];
78907
+ if (event && titleChart) titleChart.OnMouseMoveEvent=event;
78908
+
78909
+ var pixelTatio = GetDevicePixelRatio();
78910
+ var e={ };
78911
+ e.clientX=(x/pixelTatio)+this.UIElement.getBoundingClientRect().left;
78912
+ e.clientY=(y/pixelTatio)+this.UIElement.getBoundingClientRect().top;
78913
+ this.MoveOnPoint={X:x, Y:y};
78914
+ this.OnMouseMove(x,y,e);
78915
+ this.LastMouseStatus.MoveOnPoint=null;
78916
+ if (titleChart) titleChart.OnMouseMoveEvent=null;
78917
+
78918
+ return true;
78919
+ }
78920
+
78606
78921
  //内部函数
78607
78922
  this.ChartOperator_Temp_GetHistoryData=function()
78608
78923
  {
@@ -82786,7 +83101,8 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
82786
83101
  {
82787
83102
  if (this.DragMode==JSCHART_DRAG_ID.CLICK_TOUCH_MODE_ID)
82788
83103
  {
82789
- if (this.TouchStatus.CorssCursorShow==true && this.TouchDrawCount>0) return;
83104
+ if (this.ClickModel.IsShowCorssCursor==true && this.ClickModel.PreventHide) return;
83105
+ if (this.ClickModel.IsShowCorssCursor==true && this.TouchDrawCount>0 ) return;
82790
83106
 
82791
83107
  this.TouchStatus.CorssCursorShow=false;
82792
83108
  this.DrawDynamicInfo();
@@ -82795,7 +83111,8 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
82795
83111
 
82796
83112
  if (this.EnableClickModel===true)
82797
83113
  {
82798
- if (this.ClickModel.IsShowCorssCursor==true && this.TouchDrawCount>0) return;
83114
+ if (this.ClickModel.IsShowCorssCursor==true && this.ClickModel.PreventHide) return; //阻止隐藏
83115
+ if (this.ClickModel.IsShowCorssCursor==true && this.TouchDrawCount>0 ) return;
82799
83116
 
82800
83117
  this.ClickModel.IsShowCorssCursor=false;
82801
83118
  this.DrawDynamicInfo();
@@ -87596,13 +87913,16 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
87596
87913
  this.IsOnTouch=true;
87597
87914
  this.TouchDrawCount=0;
87598
87915
  this.PhonePinch=null;
87916
+ this.TouchDrag=null;
87917
+ if (this.ClickModel) this.ClickModel.PreventHide=false;
87599
87918
  this.StopDragTimer();
87600
87919
 
87601
87920
  if (this.EnableScrollUpDown==false) e.preventDefault(); //上下拖动图形不能阻止事件
87602
87921
 
87603
87922
  if (this.IsPhoneDragging(e))
87604
87923
  {
87605
- var drag= { Click:{}, LastMove:{} };//LastMove=最后移动的位置
87924
+ var drag= { Click:{}, LastMove:{}, StartTime:Date.now() };//LastMove=最后移动的位置 StartTime=开始时间
87925
+ var touchDrag={ Click:{}, LastMove:{}, StartTime:Date.now() };
87606
87926
  var touches=this.GetToucheData(e,this.IsForceLandscape);
87607
87927
  var pt=this.PointAbsoluteToRelative(touches[0].clientX, touches[0].clientY, true);
87608
87928
 
@@ -87628,6 +87948,12 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
87628
87948
  drag.Click.Y=touches[0].clientY;
87629
87949
  drag.LastMove.X=touches[0].clientX;
87630
87950
  drag.LastMove.Y=touches[0].clientY;
87951
+
87952
+ touchDrag.Click.X=touches[0].clientX;
87953
+ touchDrag.Click.Y=touches[0].clientY;
87954
+ touchDrag.LastMove.X=touches[0].clientX;
87955
+ touchDrag.LastMove.Y=touches[0].clientY;
87956
+
87631
87957
  var self=this;
87632
87958
 
87633
87959
  var T_ShowCorssCursor=function() //临时函数(Temp_) T_开头
@@ -87708,6 +88034,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
87708
88034
  }
87709
88035
 
87710
88036
  this.MouseDrag=drag;
88037
+ this.TouchDrag=touchDrag;
87711
88038
  this.PhoneTouchInfo={ Start:{X:touches[0].clientX, Y:touches[0].clientY }, End:{ X:touches[0].clientX, Y:touches[0].clientY } };
87712
88039
  this.SelectChartDrawPicture=null;
87713
88040
 
@@ -87754,11 +88081,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
87754
88081
  }
87755
88082
  else if (this.IsPhonePinching(e))
87756
88083
  {
87757
- var phonePinch=
87758
- {
87759
- "Start":{},
87760
- "Last":{}
87761
- };
88084
+ var phonePinch= { Start:{}, Last:{}, StartTime:Date.now() };
87762
88085
 
87763
88086
  var touches=this.GetToucheData(e,this.IsForceLandscape);
87764
88087
 
@@ -87850,6 +88173,13 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
87850
88173
  this.PhoneTouchInfo.End.X=touches[0].clientX;
87851
88174
  this.PhoneTouchInfo.End.Y=touches[0].clientY;
87852
88175
  }
88176
+
88177
+ if (this.TouchDrag)
88178
+ {
88179
+ var touchDrag=this.TouchDrag;
88180
+ touchDrag.LastMove.X=touches[0].clientX;
88181
+ touchDrag.LastMove.Y=touches[0].clientY;
88182
+ }
87853
88183
  }
87854
88184
  else if (this.IsPhonePinching(e))
87855
88185
  {
@@ -87907,6 +88237,8 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
87907
88237
  JSConsole.Chart.Log('[MinuteChartContainer::OnTouchEnd]',e);
87908
88238
  if (this.ChartSplashPaint && this.ChartSplashPaint.IsEnableSplash == true) return;
87909
88239
 
88240
+ this.FastSlideEvent();
88241
+
87910
88242
  var bClearDrawPicture=true;
87911
88243
  if (this.CurrentChartDrawPicture)
87912
88244
  {
@@ -87942,9 +88274,10 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
87942
88274
  this.TouchEvent({ EventID:JSCHART_EVENT_ID.ON_PHONE_TOUCH, FunctionName:"OnTouchEnd"}, e);
87943
88275
  this.OnTouchFinished();
87944
88276
  this.TouchDrawCount=0;
88277
+ this.TouchDrag=null;
87945
88278
  }
87946
88279
 
87947
-
88280
+
87948
88281
  //键盘左右移动十字光标
87949
88282
  this.OnKeyDown=function(e)
87950
88283
  {
@@ -89050,6 +89383,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
89050
89383
  buySellBar.Name="Minute-BuySell-Bar";
89051
89384
  buySellBar.Identify="Minute-BuySell-Bar";
89052
89385
  buySellBar.BuySellData=this.BuySellData;
89386
+ buySellBar.HQChart=this;
89053
89387
  this.ChartPaint[3]=buySellBar;
89054
89388
 
89055
89389
 
@@ -91650,6 +91984,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
91650
91984
  {
91651
91985
  if (this.EnableClickModel===true)
91652
91986
  {
91987
+ if (this.ClickModel.IsShowCorssCursor==true && this.ClickModel.PreventHide) return; //阻止隐藏
91653
91988
  if (this.ClickModel.IsShowCorssCursor==true && this.TouchDrawCount>0) return;
91654
91989
 
91655
91990
  this.ClickModel.IsShowCorssCursor=false;
@@ -93872,7 +94207,7 @@ function KLineChartHScreenContainer(uielement)
93872
94207
 
93873
94208
  if (this.VerticalDrag) bStartTimer=false;
93874
94209
 
93875
- var drag= { Click:{}, LastMove:{} }; //LastMove=最后移动的位置
94210
+ var drag= { Click:{}, LastMove:{}, StartTime:Date.now() }; //LastMove=最后移动的位置
93876
94211
 
93877
94212
 
93878
94213
  //var touches=this.GetToucheData(e,false);
@@ -93969,11 +94304,7 @@ function KLineChartHScreenContainer(uielement)
93969
94304
  }
93970
94305
  else if (this.IsPhonePinching(e))
93971
94306
  {
93972
- var phonePinch=
93973
- {
93974
- "Start":{},
93975
- "Last":{}
93976
- };
94307
+ var phonePinch={ Start:{}, Last:{}, StartTime:Date.now() };
93977
94308
 
93978
94309
  var touches=this.GetToucheData(e,false);
93979
94310