hqchart 1.1.14688 → 1.1.14696

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.
@@ -2596,7 +2596,7 @@ var JSCHART_EVENT_ID=
2596
2596
  ON_RCLICK_REPORT_HEADER:52, //右键点击表头
2597
2597
  ON_REPORT_LOCAL_SORT:53, //报价列表本地排序
2598
2598
  ON_DRAW_REPORT_NAME_COLOR:54, //报价列表股票名称列颜色
2599
- ON_DRAW_CUSTOM_TEXT:55, //报价列表自定义列
2599
+ ON_DRAW_CUSTOM_TEXT:55, //报价列表自定义列(废弃)
2600
2600
  ON_CLICK_REPORT_TAB:56, //报价列表标签点击
2601
2601
  ON_CLICK_REPORT_TABMENU:57, //报价列表标签菜单点击
2602
2602
  ON_DRAW_REPORT_FIXEDROW_TEXT:58, //报价列表固定行绘制
@@ -2738,6 +2738,8 @@ var JSCHART_EVENT_ID=
2738
2738
  ON_DBCLICK_DEAL_ROW:167,
2739
2739
 
2740
2740
  ON_FORMAT_OVERLAY_INDEX_OUT_TEXT:168, //格式化叠指标标题
2741
+
2742
+ ON_TOUCH_FAST_SLIDE:169 //快速滑动
2741
2743
  }
2742
2744
 
2743
2745
  var JSCHART_OPERATOR_ID=
@@ -3111,6 +3113,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
3111
3113
  this.mapEvent=new Map(); //通知外部调用 key:JSCHART_EVENT_ID value:{Callback:回调,}
3112
3114
 
3113
3115
  this.PhonePinch=null; //手机双指操作信息
3116
+ this.TouchDrag=null; //手势拖动操作信息
3114
3117
  this.IsOnTouch = false; //是否再操作数据
3115
3118
  this.TouchDrawCount = 0; //手势绘制次数
3116
3119
  this.DisableMouse=false; //禁止鼠标事件
@@ -3197,6 +3200,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
3197
3200
  //SecondKeyID 1=shiftKey 2=ctrlKey 3=altKey
3198
3201
  this.AryHotKey=[]; //热键 { KeyID:87, SecondKeyID:1, CMD:JSCHART_MENU_ID.CMD_FULLSCREEN_SUMMARY_ID, Args:null, Description:"Alt+W 全屏区间统计" },
3199
3202
 
3203
+ this.FastSlideConfig={ MinDistance:500, MinSpeed:3, MaxTime:250 }; //快速滑动配置 MinDistance=最小的距离 MinSpeed=最小速度 MaxTime=最大间隔时间(ms)
3204
+
3200
3205
  this.RestoreFocus=function(delay)
3201
3206
  {
3202
3207
  var value=1000;
@@ -5314,6 +5319,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
5314
5319
  this.IsOnTouch=true;
5315
5320
  this.TouchDrawCount=0;
5316
5321
  this.PhonePinch=null;
5322
+ this.TouchDrag=null;
5317
5323
  this.StopDragTimer();
5318
5324
 
5319
5325
  var isSingleTouch=this.IsSingleTouch(e);
@@ -5359,11 +5365,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
5359
5365
 
5360
5366
  if (this.EnableClickModel && this.ClickModel.IsShowCorssCursor==true) bStartTimer=false;
5361
5367
 
5362
- var drag=
5363
- {
5364
- "Click":{},
5365
- "LastMove":{} //最后移动的位置
5366
- };
5368
+ var drag= { Click:{}, LastMove:{}, StartTime:Date.now() }; //LastMove 最后移动的位置
5369
+ var touchDrag={ Click:{}, LastMove:{}, StartTime:Date.now() };
5367
5370
 
5368
5371
  //var touches=this.GetToucheData(e,this.IsForceLandscape);
5369
5372
 
@@ -5371,8 +5374,14 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
5371
5374
  drag.Click.Y=touches[0].clientY;
5372
5375
  drag.LastMove.X=touches[0].clientX;
5373
5376
  drag.LastMove.Y=touches[0].clientY;
5374
-
5375
5377
  this.MouseDrag=drag;
5378
+
5379
+ touchDrag.Click.X=touches[0].clientX;
5380
+ touchDrag.Click.Y=touches[0].clientY;
5381
+ touchDrag.LastMove.X=touches[0].clientX;
5382
+ touchDrag.LastMove.Y=touches[0].clientY;
5383
+ this.TouchDrag=touchDrag;
5384
+
5376
5385
  var drawPictureActive=this.GetActiveDrawPicture(); //上一次选中的
5377
5386
  var selectedChart={ Chart:this.SelectedChart.Selected.Chart, Identify:this.SelectedChart.Selected.Identify }; //上一次选中的图形
5378
5387
  this.PhoneTouchInfo={ Start:{X:touches[0].clientX, Y:touches[0].clientY }, End:{ X:touches[0].clientX, Y:touches[0].clientY } };
@@ -5494,11 +5503,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
5494
5503
  }
5495
5504
  else if (this.IsPhonePinching(e))
5496
5505
  {
5497
- var phonePinch=
5498
- {
5499
- "Start":{},
5500
- "Last":{}
5501
- };
5506
+ var phonePinch={ Start:{}, Last:{}, StartTime:Date.now() };
5502
5507
 
5503
5508
  var touches=this.GetToucheData(e,this.IsForceLandscape);
5504
5509
 
@@ -5633,6 +5638,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
5633
5638
  this.PhoneTouchInfo.End.X=touches[0].clientX;
5634
5639
  this.PhoneTouchInfo.End.Y=touches[0].clientY;
5635
5640
  }
5641
+
5642
+ if (this.TouchDrag)
5643
+ {
5644
+ var touchDrag=this.TouchDrag;
5645
+ touchDrag.LastMove.X=touches[0].clientX;
5646
+ touchDrag.LastMove.Y=touches[0].clientY;
5647
+ }
5636
5648
  }
5637
5649
  else if (this.IsPhonePinching(e))
5638
5650
  {
@@ -5699,6 +5711,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
5699
5711
  JSConsole.Chart.Log('[KLineChartContainer:OnTouchEnd]',e);
5700
5712
  if (this.ChartSplashPaint && this.ChartSplashPaint.IsEnableSplash == true) return;
5701
5713
 
5714
+ this.FastSlideEvent();
5715
+
5702
5716
  var bClearDrawPicture=true;
5703
5717
  if (this.CurrentChartDrawPicture)
5704
5718
  {
@@ -5737,6 +5751,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
5737
5751
  this.OnTouchFinished();
5738
5752
  this.TouchDrawCount=0;
5739
5753
  this.PhonePinch=null;
5754
+ this.TouchDrag=null;
5740
5755
  }
5741
5756
 
5742
5757
  this.OnTouchDBClick=function(points)
@@ -11550,6 +11565,41 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
11550
11565
 
11551
11566
  return true;
11552
11567
  }
11568
+
11569
+ //快速滑动
11570
+ this.FastSlideEvent=function()
11571
+ {
11572
+ if (!this.TouchDrag) return false;
11573
+ if (!this.FastSlideConfig) return false;
11574
+
11575
+ var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_TOUCH_FAST_SLIDE);
11576
+ if (!event || !event.Callback) return false;
11577
+
11578
+ var config=this.FastSlideConfig;
11579
+ var drag=this.TouchDrag;
11580
+ var time=Date.now();
11581
+ var spanTime=time-drag.StartTime;
11582
+ if (spanTime>config.MaxTime) return false;
11583
+
11584
+ if (!drag.Click || !drag.LastMove) return false;
11585
+
11586
+ var xStart=drag.Click.X;
11587
+ var xEnd=drag.LastMove.X;
11588
+
11589
+ if (!IFrameSplitOperator.IsNumber(xStart) || !IFrameSplitOperator.IsNumber(xEnd)) return false;
11590
+
11591
+ var distance=xEnd-xStart;
11592
+ var speed=Math.abs(distance)/spanTime;
11593
+ JSConsole.Chart.Log(`[JSChartContainer:FastSlideEvent] speed=${speed}, distance=${distance}, spanTime=${spanTime}`);
11594
+
11595
+ if (Math.abs(distance)<config.MinDistance) return false;
11596
+ if (speed<config.MinSpeed) return false;
11597
+
11598
+ var sendData={ Speed:speed, Distance:distance, IsLeft:distance<0?true:false }
11599
+ event.Callback(event, sendData, this);
11600
+
11601
+ return true;
11602
+ }
11553
11603
  }
11554
11604
 
11555
11605
  function GetDevicePixelRatio()
@@ -87596,13 +87646,15 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
87596
87646
  this.IsOnTouch=true;
87597
87647
  this.TouchDrawCount=0;
87598
87648
  this.PhonePinch=null;
87649
+ this.TouchDrag=null;
87599
87650
  this.StopDragTimer();
87600
87651
 
87601
87652
  if (this.EnableScrollUpDown==false) e.preventDefault(); //上下拖动图形不能阻止事件
87602
87653
 
87603
87654
  if (this.IsPhoneDragging(e))
87604
87655
  {
87605
- var drag= { Click:{}, LastMove:{} };//LastMove=最后移动的位置
87656
+ var drag= { Click:{}, LastMove:{}, StartTime:Date.now() };//LastMove=最后移动的位置 StartTime=开始时间
87657
+ var touchDrag={ Click:{}, LastMove:{}, StartTime:Date.now() };
87606
87658
  var touches=this.GetToucheData(e,this.IsForceLandscape);
87607
87659
  var pt=this.PointAbsoluteToRelative(touches[0].clientX, touches[0].clientY, true);
87608
87660
 
@@ -87628,6 +87680,12 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
87628
87680
  drag.Click.Y=touches[0].clientY;
87629
87681
  drag.LastMove.X=touches[0].clientX;
87630
87682
  drag.LastMove.Y=touches[0].clientY;
87683
+
87684
+ touchDrag.Click.X=touches[0].clientX;
87685
+ touchDrag.Click.Y=touches[0].clientY;
87686
+ touchDrag.LastMove.X=touches[0].clientX;
87687
+ touchDrag.LastMove.Y=touches[0].clientY;
87688
+
87631
87689
  var self=this;
87632
87690
 
87633
87691
  var T_ShowCorssCursor=function() //临时函数(Temp_) T_开头
@@ -87708,6 +87766,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
87708
87766
  }
87709
87767
 
87710
87768
  this.MouseDrag=drag;
87769
+ this.TouchDrag=touchDrag;
87711
87770
  this.PhoneTouchInfo={ Start:{X:touches[0].clientX, Y:touches[0].clientY }, End:{ X:touches[0].clientX, Y:touches[0].clientY } };
87712
87771
  this.SelectChartDrawPicture=null;
87713
87772
 
@@ -87754,11 +87813,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
87754
87813
  }
87755
87814
  else if (this.IsPhonePinching(e))
87756
87815
  {
87757
- var phonePinch=
87758
- {
87759
- "Start":{},
87760
- "Last":{}
87761
- };
87816
+ var phonePinch= { Start:{}, Last:{}, StartTime:Date.now() };
87762
87817
 
87763
87818
  var touches=this.GetToucheData(e,this.IsForceLandscape);
87764
87819
 
@@ -87850,6 +87905,13 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
87850
87905
  this.PhoneTouchInfo.End.X=touches[0].clientX;
87851
87906
  this.PhoneTouchInfo.End.Y=touches[0].clientY;
87852
87907
  }
87908
+
87909
+ if (this.TouchDrag)
87910
+ {
87911
+ var touchDrag=this.TouchDrag;
87912
+ touchDrag.LastMove.X=touches[0].clientX;
87913
+ touchDrag.LastMove.Y=touches[0].clientY;
87914
+ }
87853
87915
  }
87854
87916
  else if (this.IsPhonePinching(e))
87855
87917
  {
@@ -87907,6 +87969,8 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
87907
87969
  JSConsole.Chart.Log('[MinuteChartContainer::OnTouchEnd]',e);
87908
87970
  if (this.ChartSplashPaint && this.ChartSplashPaint.IsEnableSplash == true) return;
87909
87971
 
87972
+ this.FastSlideEvent();
87973
+
87910
87974
  var bClearDrawPicture=true;
87911
87975
  if (this.CurrentChartDrawPicture)
87912
87976
  {
@@ -87942,9 +88006,10 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
87942
88006
  this.TouchEvent({ EventID:JSCHART_EVENT_ID.ON_PHONE_TOUCH, FunctionName:"OnTouchEnd"}, e);
87943
88007
  this.OnTouchFinished();
87944
88008
  this.TouchDrawCount=0;
88009
+ this.TouchDrag=null;
87945
88010
  }
87946
88011
 
87947
-
88012
+
87948
88013
  //键盘左右移动十字光标
87949
88014
  this.OnKeyDown=function(e)
87950
88015
  {
@@ -93872,7 +93937,7 @@ function KLineChartHScreenContainer(uielement)
93872
93937
 
93873
93938
  if (this.VerticalDrag) bStartTimer=false;
93874
93939
 
93875
- var drag= { Click:{}, LastMove:{} }; //LastMove=最后移动的位置
93940
+ var drag= { Click:{}, LastMove:{}, StartTime:Date.now() }; //LastMove=最后移动的位置
93876
93941
 
93877
93942
 
93878
93943
  //var touches=this.GetToucheData(e,false);
@@ -93969,11 +94034,7 @@ function KLineChartHScreenContainer(uielement)
93969
94034
  }
93970
94035
  else if (this.IsPhonePinching(e))
93971
94036
  {
93972
- var phonePinch=
93973
- {
93974
- "Start":{},
93975
- "Last":{}
93976
- };
94037
+ var phonePinch={ Start:{}, Last:{}, StartTime:Date.now() };
93977
94038
 
93978
94039
  var touches=this.GetToucheData(e,false);
93979
94040
 
@@ -6521,10 +6521,12 @@ function ChartReport()
6521
6521
  else if (column.Type==REPORT_COLUMN_ID.CUSTOM_NUMBER_TEXT_ID)
6522
6522
  {
6523
6523
  this.GetCustomNumberDrawInfo(data, column, drawInfo);
6524
+ this.FormatDrawInfoEvent(stock, data, column, drawInfo);
6524
6525
  }
6525
6526
  else if (column.Type==REPORT_COLUMN_ID.CUSTOM_DATETIME_TEXT_ID)
6526
6527
  {
6527
6528
  this.GetCustomDateTimeDrawInfo(data, column, drawInfo);
6529
+ this.FormatDrawInfoEvent(stock, data, column, drawInfo);
6528
6530
  }
6529
6531
  else if (column.Type==REPORT_COLUMN_ID.CUSTOM_ICON_ID)
6530
6532
  {
@@ -6547,10 +6549,12 @@ function ChartReport()
6547
6549
  else if (column.Type==REPORT_COLUMN_ID.TIME_ID)
6548
6550
  {
6549
6551
  this.FormaTimeDrawInfo(column, stock, drawInfo, data);
6552
+ this.FormatDrawInfoEvent(stock, data, column, drawInfo);
6550
6553
  }
6551
6554
  else if (column.Type==REPORT_COLUMN_ID.DATE_ID)
6552
6555
  {
6553
6556
  this.FormaDateDrawInfo(column, stock, drawInfo, data);
6557
+ this.FormatDrawInfoEvent(stock, data, column, drawInfo);
6554
6558
  }
6555
6559
  else if (column.Type==REPORT_COLUMN_ID.CHECKBOX_ID)
6556
6560
  {
@@ -7010,12 +7014,6 @@ function ChartReport()
7010
7014
  this.GetCustomStringDrawInfo=function(data, column, drawInfo)
7011
7015
  {
7012
7016
  var value=this.GetExtendData(data, column);
7013
- if (column.IsDrawCallback) //外部处理输出格式
7014
- {
7015
- this.GetCustomTextDrawInfo(column, data.Symbol, value, drawInfo, data);
7016
- return;
7017
- }
7018
-
7019
7017
  if (!IFrameSplitOperator.IsString(value)) return;
7020
7018
  drawInfo.Text=value;
7021
7019
  }
@@ -7023,12 +7021,6 @@ function ChartReport()
7023
7021
  this.GetCustomNumberDrawInfo=function(data, column, drawInfo)
7024
7022
  {
7025
7023
  var value=this.GetExtendData(data, column);
7026
- if (column.IsDrawCallback) //外部处理输出格式
7027
- {
7028
- this.GetCustomTextDrawInfo(column, data.Symbol, value, drawInfo, data);
7029
- return;
7030
- }
7031
-
7032
7024
  if (!IFrameSplitOperator.IsNumber(value)) return;
7033
7025
 
7034
7026
  //格式化输出
@@ -7070,12 +7062,6 @@ function ChartReport()
7070
7062
  var value=this.GetExtendData(data, column);
7071
7063
  if (!IFrameSplitOperator.IsNumber(value)) return;
7072
7064
 
7073
- if (column.IsDrawCallback) //外部处理输出格式
7074
- {
7075
- this.GetCustomTextDrawInfo(column, data.Symbol, value, drawInfo, data);
7076
- return;
7077
- }
7078
-
7079
7065
  if (column.ValueType==0)
7080
7066
  {
7081
7067
  if (column.FormatType==1)
@@ -8211,42 +8197,9 @@ function ChartReport()
8211
8197
  }
8212
8198
  }
8213
8199
 
8214
- //外部配置显示格式 颜色 对齐方式
8215
- this.GetCustomTextDrawInfo=function(columnInfo, symbol, value, drawInfo, data)
8216
- {
8217
- var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_DRAW_CUSTOM_TEXT);
8218
- if (!event || !event.Callback) return false;
8219
-
8220
- var sendData=
8221
- {
8222
- Symbol:symbol, Column:columnInfo, Value:value, Data:data,
8223
- Out:{ Text:null, TextColor:null, TextAlign:null }
8224
- };
8225
-
8226
- event.Callback(event,sendData,this);
8227
-
8228
- if (sendData.Out.Text) drawInfo.Text=sendData.Out.Text;
8229
- if (sendData.Out.TextColor) drawInfo.TextColor=sendData.Out.TextColor;
8230
- if (sendData.Out.TextAlign) drawInfo.TextAlign=sendData.Out.TextAlign;
8231
- if (sendData.Out.BGColor) drawInfo.BGColor=sendData.Out.BGColor;
8232
-
8233
- return true;
8234
- }
8235
-
8236
8200
  this.FormatDrawInfo=function(column, stock, drawInfo, data)
8237
8201
  {
8238
- if (!column.IsDrawCallback) return false;
8239
-
8240
- var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_REPORT_FORMAT_DRAW_INFO);
8241
- if (!event || !event.Callback) return false;
8242
-
8243
- var sendData=
8244
- {
8245
- Stock:stock, Column:column, Data:data,
8246
- DrawInfo:drawInfo
8247
- };
8248
-
8249
- event.Callback(event,sendData,this);
8202
+ this.FormatDrawInfoEvent(stock, data, column, drawInfo);
8250
8203
  }
8251
8204
 
8252
8205
  this.GetFixedRowTextDrawInfo=function(rowIndex, colIndex, columnInfo, drawInfo)
@@ -262,7 +262,7 @@ HQData.Minute_RequestMinuteData=function(data, callback)
262
262
  }
263
263
  */
264
264
 
265
- //stockItem.minute.length=50;
265
+ stockItem.minute.length=50;
266
266
 
267
267
  var hqchartData={code:0, stock:[stockItem] };
268
268