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.
@@ -6692,7 +6692,7 @@ var JSCHART_EVENT_ID=
6692
6692
  ON_RCLICK_REPORT_HEADER:52, //右键点击表头
6693
6693
  ON_REPORT_LOCAL_SORT:53, //报价列表本地排序
6694
6694
  ON_DRAW_REPORT_NAME_COLOR:54, //报价列表股票名称列颜色
6695
- ON_DRAW_CUSTOM_TEXT:55, //报价列表自定义列
6695
+ ON_DRAW_CUSTOM_TEXT:55, //报价列表自定义列(废弃)
6696
6696
  ON_CLICK_REPORT_TAB:56, //报价列表标签点击
6697
6697
  ON_CLICK_REPORT_TABMENU:57, //报价列表标签菜单点击
6698
6698
  ON_DRAW_REPORT_FIXEDROW_TEXT:58, //报价列表固定行绘制
@@ -6834,6 +6834,8 @@ var JSCHART_EVENT_ID=
6834
6834
  ON_DBCLICK_DEAL_ROW:167,
6835
6835
 
6836
6836
  ON_FORMAT_OVERLAY_INDEX_OUT_TEXT:168, //格式化叠指标标题
6837
+
6838
+ ON_TOUCH_FAST_SLIDE:169 //快速滑动
6837
6839
  }
6838
6840
 
6839
6841
  var JSCHART_OPERATOR_ID=
@@ -7207,6 +7209,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7207
7209
  this.mapEvent=new Map(); //通知外部调用 key:JSCHART_EVENT_ID value:{Callback:回调,}
7208
7210
 
7209
7211
  this.PhonePinch=null; //手机双指操作信息
7212
+ this.TouchDrag=null; //手势拖动操作信息
7210
7213
  this.IsOnTouch = false; //是否再操作数据
7211
7214
  this.TouchDrawCount = 0; //手势绘制次数
7212
7215
  this.DisableMouse=false; //禁止鼠标事件
@@ -7293,6 +7296,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7293
7296
  //SecondKeyID 1=shiftKey 2=ctrlKey 3=altKey
7294
7297
  this.AryHotKey=[]; //热键 { KeyID:87, SecondKeyID:1, CMD:JSCHART_MENU_ID.CMD_FULLSCREEN_SUMMARY_ID, Args:null, Description:"Alt+W 全屏区间统计" },
7295
7298
 
7299
+ this.FastSlideConfig={ MinDistance:500, MinSpeed:3, MaxTime:250 }; //快速滑动配置 MinDistance=最小的距离 MinSpeed=最小速度 MaxTime=最大间隔时间(ms)
7300
+
7296
7301
  this.RestoreFocus=function(delay)
7297
7302
  {
7298
7303
  var value=1000;
@@ -9410,6 +9415,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9410
9415
  this.IsOnTouch=true;
9411
9416
  this.TouchDrawCount=0;
9412
9417
  this.PhonePinch=null;
9418
+ this.TouchDrag=null;
9413
9419
  this.StopDragTimer();
9414
9420
 
9415
9421
  var isSingleTouch=this.IsSingleTouch(e);
@@ -9455,11 +9461,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9455
9461
 
9456
9462
  if (this.EnableClickModel && this.ClickModel.IsShowCorssCursor==true) bStartTimer=false;
9457
9463
 
9458
- var drag=
9459
- {
9460
- "Click":{},
9461
- "LastMove":{} //最后移动的位置
9462
- };
9464
+ var drag= { Click:{}, LastMove:{}, StartTime:Date.now() }; //LastMove 最后移动的位置
9465
+ var touchDrag={ Click:{}, LastMove:{}, StartTime:Date.now() };
9463
9466
 
9464
9467
  //var touches=this.GetToucheData(e,this.IsForceLandscape);
9465
9468
 
@@ -9467,8 +9470,14 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9467
9470
  drag.Click.Y=touches[0].clientY;
9468
9471
  drag.LastMove.X=touches[0].clientX;
9469
9472
  drag.LastMove.Y=touches[0].clientY;
9470
-
9471
9473
  this.MouseDrag=drag;
9474
+
9475
+ touchDrag.Click.X=touches[0].clientX;
9476
+ touchDrag.Click.Y=touches[0].clientY;
9477
+ touchDrag.LastMove.X=touches[0].clientX;
9478
+ touchDrag.LastMove.Y=touches[0].clientY;
9479
+ this.TouchDrag=touchDrag;
9480
+
9472
9481
  var drawPictureActive=this.GetActiveDrawPicture(); //上一次选中的
9473
9482
  var selectedChart={ Chart:this.SelectedChart.Selected.Chart, Identify:this.SelectedChart.Selected.Identify }; //上一次选中的图形
9474
9483
  this.PhoneTouchInfo={ Start:{X:touches[0].clientX, Y:touches[0].clientY }, End:{ X:touches[0].clientX, Y:touches[0].clientY } };
@@ -9590,11 +9599,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9590
9599
  }
9591
9600
  else if (this.IsPhonePinching(e))
9592
9601
  {
9593
- var phonePinch=
9594
- {
9595
- "Start":{},
9596
- "Last":{}
9597
- };
9602
+ var phonePinch={ Start:{}, Last:{}, StartTime:Date.now() };
9598
9603
 
9599
9604
  var touches=this.GetToucheData(e,this.IsForceLandscape);
9600
9605
 
@@ -9729,6 +9734,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9729
9734
  this.PhoneTouchInfo.End.X=touches[0].clientX;
9730
9735
  this.PhoneTouchInfo.End.Y=touches[0].clientY;
9731
9736
  }
9737
+
9738
+ if (this.TouchDrag)
9739
+ {
9740
+ var touchDrag=this.TouchDrag;
9741
+ touchDrag.LastMove.X=touches[0].clientX;
9742
+ touchDrag.LastMove.Y=touches[0].clientY;
9743
+ }
9732
9744
  }
9733
9745
  else if (this.IsPhonePinching(e))
9734
9746
  {
@@ -9795,6 +9807,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9795
9807
  JSConsole.Chart.Log('[KLineChartContainer:OnTouchEnd]',e);
9796
9808
  if (this.ChartSplashPaint && this.ChartSplashPaint.IsEnableSplash == true) return;
9797
9809
 
9810
+ this.FastSlideEvent();
9811
+
9798
9812
  var bClearDrawPicture=true;
9799
9813
  if (this.CurrentChartDrawPicture)
9800
9814
  {
@@ -9833,6 +9847,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9833
9847
  this.OnTouchFinished();
9834
9848
  this.TouchDrawCount=0;
9835
9849
  this.PhonePinch=null;
9850
+ this.TouchDrag=null;
9836
9851
  }
9837
9852
 
9838
9853
  this.OnTouchDBClick=function(points)
@@ -15646,6 +15661,41 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
15646
15661
 
15647
15662
  return true;
15648
15663
  }
15664
+
15665
+ //快速滑动
15666
+ this.FastSlideEvent=function()
15667
+ {
15668
+ if (!this.TouchDrag) return false;
15669
+ if (!this.FastSlideConfig) return false;
15670
+
15671
+ var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_TOUCH_FAST_SLIDE);
15672
+ if (!event || !event.Callback) return false;
15673
+
15674
+ var config=this.FastSlideConfig;
15675
+ var drag=this.TouchDrag;
15676
+ var time=Date.now();
15677
+ var spanTime=time-drag.StartTime;
15678
+ if (spanTime>config.MaxTime) return false;
15679
+
15680
+ if (!drag.Click || !drag.LastMove) return false;
15681
+
15682
+ var xStart=drag.Click.X;
15683
+ var xEnd=drag.LastMove.X;
15684
+
15685
+ if (!IFrameSplitOperator.IsNumber(xStart) || !IFrameSplitOperator.IsNumber(xEnd)) return false;
15686
+
15687
+ var distance=xEnd-xStart;
15688
+ var speed=Math.abs(distance)/spanTime;
15689
+ JSConsole.Chart.Log(`[JSChartContainer:FastSlideEvent] speed=${speed}, distance=${distance}, spanTime=${spanTime}`);
15690
+
15691
+ if (Math.abs(distance)<config.MinDistance) return false;
15692
+ if (speed<config.MinSpeed) return false;
15693
+
15694
+ var sendData={ Speed:speed, Distance:distance, IsLeft:distance<0?true:false }
15695
+ event.Callback(event, sendData, this);
15696
+
15697
+ return true;
15698
+ }
15649
15699
  }
15650
15700
 
15651
15701
  function GetDevicePixelRatio()
@@ -91692,13 +91742,15 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
91692
91742
  this.IsOnTouch=true;
91693
91743
  this.TouchDrawCount=0;
91694
91744
  this.PhonePinch=null;
91745
+ this.TouchDrag=null;
91695
91746
  this.StopDragTimer();
91696
91747
 
91697
91748
  if (this.EnableScrollUpDown==false) e.preventDefault(); //上下拖动图形不能阻止事件
91698
91749
 
91699
91750
  if (this.IsPhoneDragging(e))
91700
91751
  {
91701
- var drag= { Click:{}, LastMove:{} };//LastMove=最后移动的位置
91752
+ var drag= { Click:{}, LastMove:{}, StartTime:Date.now() };//LastMove=最后移动的位置 StartTime=开始时间
91753
+ var touchDrag={ Click:{}, LastMove:{}, StartTime:Date.now() };
91702
91754
  var touches=this.GetToucheData(e,this.IsForceLandscape);
91703
91755
  var pt=this.PointAbsoluteToRelative(touches[0].clientX, touches[0].clientY, true);
91704
91756
 
@@ -91724,6 +91776,12 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
91724
91776
  drag.Click.Y=touches[0].clientY;
91725
91777
  drag.LastMove.X=touches[0].clientX;
91726
91778
  drag.LastMove.Y=touches[0].clientY;
91779
+
91780
+ touchDrag.Click.X=touches[0].clientX;
91781
+ touchDrag.Click.Y=touches[0].clientY;
91782
+ touchDrag.LastMove.X=touches[0].clientX;
91783
+ touchDrag.LastMove.Y=touches[0].clientY;
91784
+
91727
91785
  var self=this;
91728
91786
 
91729
91787
  var T_ShowCorssCursor=function() //临时函数(Temp_) T_开头
@@ -91804,6 +91862,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
91804
91862
  }
91805
91863
 
91806
91864
  this.MouseDrag=drag;
91865
+ this.TouchDrag=touchDrag;
91807
91866
  this.PhoneTouchInfo={ Start:{X:touches[0].clientX, Y:touches[0].clientY }, End:{ X:touches[0].clientX, Y:touches[0].clientY } };
91808
91867
  this.SelectChartDrawPicture=null;
91809
91868
 
@@ -91850,11 +91909,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
91850
91909
  }
91851
91910
  else if (this.IsPhonePinching(e))
91852
91911
  {
91853
- var phonePinch=
91854
- {
91855
- "Start":{},
91856
- "Last":{}
91857
- };
91912
+ var phonePinch= { Start:{}, Last:{}, StartTime:Date.now() };
91858
91913
 
91859
91914
  var touches=this.GetToucheData(e,this.IsForceLandscape);
91860
91915
 
@@ -91946,6 +92001,13 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
91946
92001
  this.PhoneTouchInfo.End.X=touches[0].clientX;
91947
92002
  this.PhoneTouchInfo.End.Y=touches[0].clientY;
91948
92003
  }
92004
+
92005
+ if (this.TouchDrag)
92006
+ {
92007
+ var touchDrag=this.TouchDrag;
92008
+ touchDrag.LastMove.X=touches[0].clientX;
92009
+ touchDrag.LastMove.Y=touches[0].clientY;
92010
+ }
91949
92011
  }
91950
92012
  else if (this.IsPhonePinching(e))
91951
92013
  {
@@ -92003,6 +92065,8 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
92003
92065
  JSConsole.Chart.Log('[MinuteChartContainer::OnTouchEnd]',e);
92004
92066
  if (this.ChartSplashPaint && this.ChartSplashPaint.IsEnableSplash == true) return;
92005
92067
 
92068
+ this.FastSlideEvent();
92069
+
92006
92070
  var bClearDrawPicture=true;
92007
92071
  if (this.CurrentChartDrawPicture)
92008
92072
  {
@@ -92038,9 +92102,10 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
92038
92102
  this.TouchEvent({ EventID:JSCHART_EVENT_ID.ON_PHONE_TOUCH, FunctionName:"OnTouchEnd"}, e);
92039
92103
  this.OnTouchFinished();
92040
92104
  this.TouchDrawCount=0;
92105
+ this.TouchDrag=null;
92041
92106
  }
92042
92107
 
92043
-
92108
+
92044
92109
  //键盘左右移动十字光标
92045
92110
  this.OnKeyDown=function(e)
92046
92111
  {
@@ -97968,7 +98033,7 @@ function KLineChartHScreenContainer(uielement)
97968
98033
 
97969
98034
  if (this.VerticalDrag) bStartTimer=false;
97970
98035
 
97971
- var drag= { Click:{}, LastMove:{} }; //LastMove=最后移动的位置
98036
+ var drag= { Click:{}, LastMove:{}, StartTime:Date.now() }; //LastMove=最后移动的位置
97972
98037
 
97973
98038
 
97974
98039
  //var touches=this.GetToucheData(e,false);
@@ -98065,11 +98130,7 @@ function KLineChartHScreenContainer(uielement)
98065
98130
  }
98066
98131
  else if (this.IsPhonePinching(e))
98067
98132
  {
98068
- var phonePinch=
98069
- {
98070
- "Start":{},
98071
- "Last":{}
98072
- };
98133
+ var phonePinch={ Start:{}, Last:{}, StartTime:Date.now() };
98073
98134
 
98074
98135
  var touches=this.GetToucheData(e,false);
98075
98136
 
@@ -141004,10 +141065,12 @@ function ChartReport()
141004
141065
  else if (column.Type==REPORT_COLUMN_ID.CUSTOM_NUMBER_TEXT_ID)
141005
141066
  {
141006
141067
  this.GetCustomNumberDrawInfo(data, column, drawInfo);
141068
+ this.FormatDrawInfoEvent(stock, data, column, drawInfo);
141007
141069
  }
141008
141070
  else if (column.Type==REPORT_COLUMN_ID.CUSTOM_DATETIME_TEXT_ID)
141009
141071
  {
141010
141072
  this.GetCustomDateTimeDrawInfo(data, column, drawInfo);
141073
+ this.FormatDrawInfoEvent(stock, data, column, drawInfo);
141011
141074
  }
141012
141075
  else if (column.Type==REPORT_COLUMN_ID.CUSTOM_ICON_ID)
141013
141076
  {
@@ -141030,10 +141093,12 @@ function ChartReport()
141030
141093
  else if (column.Type==REPORT_COLUMN_ID.TIME_ID)
141031
141094
  {
141032
141095
  this.FormaTimeDrawInfo(column, stock, drawInfo, data);
141096
+ this.FormatDrawInfoEvent(stock, data, column, drawInfo);
141033
141097
  }
141034
141098
  else if (column.Type==REPORT_COLUMN_ID.DATE_ID)
141035
141099
  {
141036
141100
  this.FormaDateDrawInfo(column, stock, drawInfo, data);
141101
+ this.FormatDrawInfoEvent(stock, data, column, drawInfo);
141037
141102
  }
141038
141103
  else if (column.Type==REPORT_COLUMN_ID.CHECKBOX_ID)
141039
141104
  {
@@ -141493,12 +141558,6 @@ function ChartReport()
141493
141558
  this.GetCustomStringDrawInfo=function(data, column, drawInfo)
141494
141559
  {
141495
141560
  var value=this.GetExtendData(data, column);
141496
- if (column.IsDrawCallback) //外部处理输出格式
141497
- {
141498
- this.GetCustomTextDrawInfo(column, data.Symbol, value, drawInfo, data);
141499
- return;
141500
- }
141501
-
141502
141561
  if (!IFrameSplitOperator.IsString(value)) return;
141503
141562
  drawInfo.Text=value;
141504
141563
  }
@@ -141506,12 +141565,6 @@ function ChartReport()
141506
141565
  this.GetCustomNumberDrawInfo=function(data, column, drawInfo)
141507
141566
  {
141508
141567
  var value=this.GetExtendData(data, column);
141509
- if (column.IsDrawCallback) //外部处理输出格式
141510
- {
141511
- this.GetCustomTextDrawInfo(column, data.Symbol, value, drawInfo, data);
141512
- return;
141513
- }
141514
-
141515
141568
  if (!IFrameSplitOperator.IsNumber(value)) return;
141516
141569
 
141517
141570
  //格式化输出
@@ -141553,12 +141606,6 @@ function ChartReport()
141553
141606
  var value=this.GetExtendData(data, column);
141554
141607
  if (!IFrameSplitOperator.IsNumber(value)) return;
141555
141608
 
141556
- if (column.IsDrawCallback) //外部处理输出格式
141557
- {
141558
- this.GetCustomTextDrawInfo(column, data.Symbol, value, drawInfo, data);
141559
- return;
141560
- }
141561
-
141562
141609
  if (column.ValueType==0)
141563
141610
  {
141564
141611
  if (column.FormatType==1)
@@ -142694,42 +142741,9 @@ function ChartReport()
142694
142741
  }
142695
142742
  }
142696
142743
 
142697
- //外部配置显示格式 颜色 对齐方式
142698
- this.GetCustomTextDrawInfo=function(columnInfo, symbol, value, drawInfo, data)
142699
- {
142700
- var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_DRAW_CUSTOM_TEXT);
142701
- if (!event || !event.Callback) return false;
142702
-
142703
- var sendData=
142704
- {
142705
- Symbol:symbol, Column:columnInfo, Value:value, Data:data,
142706
- Out:{ Text:null, TextColor:null, TextAlign:null }
142707
- };
142708
-
142709
- event.Callback(event,sendData,this);
142710
-
142711
- if (sendData.Out.Text) drawInfo.Text=sendData.Out.Text;
142712
- if (sendData.Out.TextColor) drawInfo.TextColor=sendData.Out.TextColor;
142713
- if (sendData.Out.TextAlign) drawInfo.TextAlign=sendData.Out.TextAlign;
142714
- if (sendData.Out.BGColor) drawInfo.BGColor=sendData.Out.BGColor;
142715
-
142716
- return true;
142717
- }
142718
-
142719
142744
  this.FormatDrawInfo=function(column, stock, drawInfo, data)
142720
142745
  {
142721
- if (!column.IsDrawCallback) return false;
142722
-
142723
- var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_REPORT_FORMAT_DRAW_INFO);
142724
- if (!event || !event.Callback) return false;
142725
-
142726
- var sendData=
142727
- {
142728
- Stock:stock, Column:column, Data:data,
142729
- DrawInfo:drawInfo
142730
- };
142731
-
142732
- event.Callback(event,sendData,this);
142746
+ this.FormatDrawInfoEvent(stock, data, column, drawInfo);
142733
142747
  }
142734
142748
 
142735
142749
  this.GetFixedRowTextDrawInfo=function(rowIndex, colIndex, columnInfo, drawInfo)
@@ -147578,7 +147592,7 @@ function ScrollBarBGChart()
147578
147592
 
147579
147593
 
147580
147594
 
147581
- var HQCHART_VERSION="1.1.14687";
147595
+ var HQCHART_VERSION="1.1.14696";
147582
147596
 
147583
147597
  function PrintHQChartVersion()
147584
147598
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.14687";
8
+ var HQCHART_VERSION="1.1.14696";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {
@@ -55794,7 +55794,7 @@ HQData.Minute_RequestMinuteData=function(data, callback)
55794
55794
  }
55795
55795
  */
55796
55796
 
55797
- //stockItem.minute.length=50;
55797
+ stockItem.minute.length=50;
55798
55798
 
55799
55799
  var hqchartData={code:0, stock:[stockItem] };
55800
55800