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.
@@ -6736,7 +6736,7 @@ var JSCHART_EVENT_ID=
6736
6736
  ON_RCLICK_REPORT_HEADER:52, //右键点击表头
6737
6737
  ON_REPORT_LOCAL_SORT:53, //报价列表本地排序
6738
6738
  ON_DRAW_REPORT_NAME_COLOR:54, //报价列表股票名称列颜色
6739
- ON_DRAW_CUSTOM_TEXT:55, //报价列表自定义列
6739
+ ON_DRAW_CUSTOM_TEXT:55, //报价列表自定义列(废弃)
6740
6740
  ON_CLICK_REPORT_TAB:56, //报价列表标签点击
6741
6741
  ON_CLICK_REPORT_TABMENU:57, //报价列表标签菜单点击
6742
6742
  ON_DRAW_REPORT_FIXEDROW_TEXT:58, //报价列表固定行绘制
@@ -6878,6 +6878,8 @@ var JSCHART_EVENT_ID=
6878
6878
  ON_DBCLICK_DEAL_ROW:167,
6879
6879
 
6880
6880
  ON_FORMAT_OVERLAY_INDEX_OUT_TEXT:168, //格式化叠指标标题
6881
+
6882
+ ON_TOUCH_FAST_SLIDE:169 //快速滑动
6881
6883
  }
6882
6884
 
6883
6885
  var JSCHART_OPERATOR_ID=
@@ -7251,6 +7253,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7251
7253
  this.mapEvent=new Map(); //通知外部调用 key:JSCHART_EVENT_ID value:{Callback:回调,}
7252
7254
 
7253
7255
  this.PhonePinch=null; //手机双指操作信息
7256
+ this.TouchDrag=null; //手势拖动操作信息
7254
7257
  this.IsOnTouch = false; //是否再操作数据
7255
7258
  this.TouchDrawCount = 0; //手势绘制次数
7256
7259
  this.DisableMouse=false; //禁止鼠标事件
@@ -7337,6 +7340,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7337
7340
  //SecondKeyID 1=shiftKey 2=ctrlKey 3=altKey
7338
7341
  this.AryHotKey=[]; //热键 { KeyID:87, SecondKeyID:1, CMD:JSCHART_MENU_ID.CMD_FULLSCREEN_SUMMARY_ID, Args:null, Description:"Alt+W 全屏区间统计" },
7339
7342
 
7343
+ this.FastSlideConfig={ MinDistance:500, MinSpeed:3, MaxTime:250 }; //快速滑动配置 MinDistance=最小的距离 MinSpeed=最小速度 MaxTime=最大间隔时间(ms)
7344
+
7340
7345
  this.RestoreFocus=function(delay)
7341
7346
  {
7342
7347
  var value=1000;
@@ -9454,6 +9459,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9454
9459
  this.IsOnTouch=true;
9455
9460
  this.TouchDrawCount=0;
9456
9461
  this.PhonePinch=null;
9462
+ this.TouchDrag=null;
9457
9463
  this.StopDragTimer();
9458
9464
 
9459
9465
  var isSingleTouch=this.IsSingleTouch(e);
@@ -9499,11 +9505,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9499
9505
 
9500
9506
  if (this.EnableClickModel && this.ClickModel.IsShowCorssCursor==true) bStartTimer=false;
9501
9507
 
9502
- var drag=
9503
- {
9504
- "Click":{},
9505
- "LastMove":{} //最后移动的位置
9506
- };
9508
+ var drag= { Click:{}, LastMove:{}, StartTime:Date.now() }; //LastMove 最后移动的位置
9509
+ var touchDrag={ Click:{}, LastMove:{}, StartTime:Date.now() };
9507
9510
 
9508
9511
  //var touches=this.GetToucheData(e,this.IsForceLandscape);
9509
9512
 
@@ -9511,8 +9514,14 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9511
9514
  drag.Click.Y=touches[0].clientY;
9512
9515
  drag.LastMove.X=touches[0].clientX;
9513
9516
  drag.LastMove.Y=touches[0].clientY;
9514
-
9515
9517
  this.MouseDrag=drag;
9518
+
9519
+ touchDrag.Click.X=touches[0].clientX;
9520
+ touchDrag.Click.Y=touches[0].clientY;
9521
+ touchDrag.LastMove.X=touches[0].clientX;
9522
+ touchDrag.LastMove.Y=touches[0].clientY;
9523
+ this.TouchDrag=touchDrag;
9524
+
9516
9525
  var drawPictureActive=this.GetActiveDrawPicture(); //上一次选中的
9517
9526
  var selectedChart={ Chart:this.SelectedChart.Selected.Chart, Identify:this.SelectedChart.Selected.Identify }; //上一次选中的图形
9518
9527
  this.PhoneTouchInfo={ Start:{X:touches[0].clientX, Y:touches[0].clientY }, End:{ X:touches[0].clientX, Y:touches[0].clientY } };
@@ -9634,11 +9643,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9634
9643
  }
9635
9644
  else if (this.IsPhonePinching(e))
9636
9645
  {
9637
- var phonePinch=
9638
- {
9639
- "Start":{},
9640
- "Last":{}
9641
- };
9646
+ var phonePinch={ Start:{}, Last:{}, StartTime:Date.now() };
9642
9647
 
9643
9648
  var touches=this.GetToucheData(e,this.IsForceLandscape);
9644
9649
 
@@ -9773,6 +9778,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9773
9778
  this.PhoneTouchInfo.End.X=touches[0].clientX;
9774
9779
  this.PhoneTouchInfo.End.Y=touches[0].clientY;
9775
9780
  }
9781
+
9782
+ if (this.TouchDrag)
9783
+ {
9784
+ var touchDrag=this.TouchDrag;
9785
+ touchDrag.LastMove.X=touches[0].clientX;
9786
+ touchDrag.LastMove.Y=touches[0].clientY;
9787
+ }
9776
9788
  }
9777
9789
  else if (this.IsPhonePinching(e))
9778
9790
  {
@@ -9839,6 +9851,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9839
9851
  JSConsole.Chart.Log('[KLineChartContainer:OnTouchEnd]',e);
9840
9852
  if (this.ChartSplashPaint && this.ChartSplashPaint.IsEnableSplash == true) return;
9841
9853
 
9854
+ this.FastSlideEvent();
9855
+
9842
9856
  var bClearDrawPicture=true;
9843
9857
  if (this.CurrentChartDrawPicture)
9844
9858
  {
@@ -9877,6 +9891,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9877
9891
  this.OnTouchFinished();
9878
9892
  this.TouchDrawCount=0;
9879
9893
  this.PhonePinch=null;
9894
+ this.TouchDrag=null;
9880
9895
  }
9881
9896
 
9882
9897
  this.OnTouchDBClick=function(points)
@@ -15690,6 +15705,41 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
15690
15705
 
15691
15706
  return true;
15692
15707
  }
15708
+
15709
+ //快速滑动
15710
+ this.FastSlideEvent=function()
15711
+ {
15712
+ if (!this.TouchDrag) return false;
15713
+ if (!this.FastSlideConfig) return false;
15714
+
15715
+ var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_TOUCH_FAST_SLIDE);
15716
+ if (!event || !event.Callback) return false;
15717
+
15718
+ var config=this.FastSlideConfig;
15719
+ var drag=this.TouchDrag;
15720
+ var time=Date.now();
15721
+ var spanTime=time-drag.StartTime;
15722
+ if (spanTime>config.MaxTime) return false;
15723
+
15724
+ if (!drag.Click || !drag.LastMove) return false;
15725
+
15726
+ var xStart=drag.Click.X;
15727
+ var xEnd=drag.LastMove.X;
15728
+
15729
+ if (!IFrameSplitOperator.IsNumber(xStart) || !IFrameSplitOperator.IsNumber(xEnd)) return false;
15730
+
15731
+ var distance=xEnd-xStart;
15732
+ var speed=Math.abs(distance)/spanTime;
15733
+ JSConsole.Chart.Log(`[JSChartContainer:FastSlideEvent] speed=${speed}, distance=${distance}, spanTime=${spanTime}`);
15734
+
15735
+ if (Math.abs(distance)<config.MinDistance) return false;
15736
+ if (speed<config.MinSpeed) return false;
15737
+
15738
+ var sendData={ Speed:speed, Distance:distance, IsLeft:distance<0?true:false }
15739
+ event.Callback(event, sendData, this);
15740
+
15741
+ return true;
15742
+ }
15693
15743
  }
15694
15744
 
15695
15745
  function GetDevicePixelRatio()
@@ -91736,13 +91786,15 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
91736
91786
  this.IsOnTouch=true;
91737
91787
  this.TouchDrawCount=0;
91738
91788
  this.PhonePinch=null;
91789
+ this.TouchDrag=null;
91739
91790
  this.StopDragTimer();
91740
91791
 
91741
91792
  if (this.EnableScrollUpDown==false) e.preventDefault(); //上下拖动图形不能阻止事件
91742
91793
 
91743
91794
  if (this.IsPhoneDragging(e))
91744
91795
  {
91745
- var drag= { Click:{}, LastMove:{} };//LastMove=最后移动的位置
91796
+ var drag= { Click:{}, LastMove:{}, StartTime:Date.now() };//LastMove=最后移动的位置 StartTime=开始时间
91797
+ var touchDrag={ Click:{}, LastMove:{}, StartTime:Date.now() };
91746
91798
  var touches=this.GetToucheData(e,this.IsForceLandscape);
91747
91799
  var pt=this.PointAbsoluteToRelative(touches[0].clientX, touches[0].clientY, true);
91748
91800
 
@@ -91768,6 +91820,12 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
91768
91820
  drag.Click.Y=touches[0].clientY;
91769
91821
  drag.LastMove.X=touches[0].clientX;
91770
91822
  drag.LastMove.Y=touches[0].clientY;
91823
+
91824
+ touchDrag.Click.X=touches[0].clientX;
91825
+ touchDrag.Click.Y=touches[0].clientY;
91826
+ touchDrag.LastMove.X=touches[0].clientX;
91827
+ touchDrag.LastMove.Y=touches[0].clientY;
91828
+
91771
91829
  var self=this;
91772
91830
 
91773
91831
  var T_ShowCorssCursor=function() //临时函数(Temp_) T_开头
@@ -91848,6 +91906,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
91848
91906
  }
91849
91907
 
91850
91908
  this.MouseDrag=drag;
91909
+ this.TouchDrag=touchDrag;
91851
91910
  this.PhoneTouchInfo={ Start:{X:touches[0].clientX, Y:touches[0].clientY }, End:{ X:touches[0].clientX, Y:touches[0].clientY } };
91852
91911
  this.SelectChartDrawPicture=null;
91853
91912
 
@@ -91894,11 +91953,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
91894
91953
  }
91895
91954
  else if (this.IsPhonePinching(e))
91896
91955
  {
91897
- var phonePinch=
91898
- {
91899
- "Start":{},
91900
- "Last":{}
91901
- };
91956
+ var phonePinch= { Start:{}, Last:{}, StartTime:Date.now() };
91902
91957
 
91903
91958
  var touches=this.GetToucheData(e,this.IsForceLandscape);
91904
91959
 
@@ -91990,6 +92045,13 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
91990
92045
  this.PhoneTouchInfo.End.X=touches[0].clientX;
91991
92046
  this.PhoneTouchInfo.End.Y=touches[0].clientY;
91992
92047
  }
92048
+
92049
+ if (this.TouchDrag)
92050
+ {
92051
+ var touchDrag=this.TouchDrag;
92052
+ touchDrag.LastMove.X=touches[0].clientX;
92053
+ touchDrag.LastMove.Y=touches[0].clientY;
92054
+ }
91993
92055
  }
91994
92056
  else if (this.IsPhonePinching(e))
91995
92057
  {
@@ -92047,6 +92109,8 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
92047
92109
  JSConsole.Chart.Log('[MinuteChartContainer::OnTouchEnd]',e);
92048
92110
  if (this.ChartSplashPaint && this.ChartSplashPaint.IsEnableSplash == true) return;
92049
92111
 
92112
+ this.FastSlideEvent();
92113
+
92050
92114
  var bClearDrawPicture=true;
92051
92115
  if (this.CurrentChartDrawPicture)
92052
92116
  {
@@ -92082,9 +92146,10 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
92082
92146
  this.TouchEvent({ EventID:JSCHART_EVENT_ID.ON_PHONE_TOUCH, FunctionName:"OnTouchEnd"}, e);
92083
92147
  this.OnTouchFinished();
92084
92148
  this.TouchDrawCount=0;
92149
+ this.TouchDrag=null;
92085
92150
  }
92086
92151
 
92087
-
92152
+
92088
92153
  //键盘左右移动十字光标
92089
92154
  this.OnKeyDown=function(e)
92090
92155
  {
@@ -98012,7 +98077,7 @@ function KLineChartHScreenContainer(uielement)
98012
98077
 
98013
98078
  if (this.VerticalDrag) bStartTimer=false;
98014
98079
 
98015
- var drag= { Click:{}, LastMove:{} }; //LastMove=最后移动的位置
98080
+ var drag= { Click:{}, LastMove:{}, StartTime:Date.now() }; //LastMove=最后移动的位置
98016
98081
 
98017
98082
 
98018
98083
  //var touches=this.GetToucheData(e,false);
@@ -98109,11 +98174,7 @@ function KLineChartHScreenContainer(uielement)
98109
98174
  }
98110
98175
  else if (this.IsPhonePinching(e))
98111
98176
  {
98112
- var phonePinch=
98113
- {
98114
- "Start":{},
98115
- "Last":{}
98116
- };
98177
+ var phonePinch={ Start:{}, Last:{}, StartTime:Date.now() };
98117
98178
 
98118
98179
  var touches=this.GetToucheData(e,false);
98119
98180
 
@@ -141048,10 +141109,12 @@ function ChartReport()
141048
141109
  else if (column.Type==REPORT_COLUMN_ID.CUSTOM_NUMBER_TEXT_ID)
141049
141110
  {
141050
141111
  this.GetCustomNumberDrawInfo(data, column, drawInfo);
141112
+ this.FormatDrawInfoEvent(stock, data, column, drawInfo);
141051
141113
  }
141052
141114
  else if (column.Type==REPORT_COLUMN_ID.CUSTOM_DATETIME_TEXT_ID)
141053
141115
  {
141054
141116
  this.GetCustomDateTimeDrawInfo(data, column, drawInfo);
141117
+ this.FormatDrawInfoEvent(stock, data, column, drawInfo);
141055
141118
  }
141056
141119
  else if (column.Type==REPORT_COLUMN_ID.CUSTOM_ICON_ID)
141057
141120
  {
@@ -141074,10 +141137,12 @@ function ChartReport()
141074
141137
  else if (column.Type==REPORT_COLUMN_ID.TIME_ID)
141075
141138
  {
141076
141139
  this.FormaTimeDrawInfo(column, stock, drawInfo, data);
141140
+ this.FormatDrawInfoEvent(stock, data, column, drawInfo);
141077
141141
  }
141078
141142
  else if (column.Type==REPORT_COLUMN_ID.DATE_ID)
141079
141143
  {
141080
141144
  this.FormaDateDrawInfo(column, stock, drawInfo, data);
141145
+ this.FormatDrawInfoEvent(stock, data, column, drawInfo);
141081
141146
  }
141082
141147
  else if (column.Type==REPORT_COLUMN_ID.CHECKBOX_ID)
141083
141148
  {
@@ -141537,12 +141602,6 @@ function ChartReport()
141537
141602
  this.GetCustomStringDrawInfo=function(data, column, drawInfo)
141538
141603
  {
141539
141604
  var value=this.GetExtendData(data, column);
141540
- if (column.IsDrawCallback) //外部处理输出格式
141541
- {
141542
- this.GetCustomTextDrawInfo(column, data.Symbol, value, drawInfo, data);
141543
- return;
141544
- }
141545
-
141546
141605
  if (!IFrameSplitOperator.IsString(value)) return;
141547
141606
  drawInfo.Text=value;
141548
141607
  }
@@ -141550,12 +141609,6 @@ function ChartReport()
141550
141609
  this.GetCustomNumberDrawInfo=function(data, column, drawInfo)
141551
141610
  {
141552
141611
  var value=this.GetExtendData(data, column);
141553
- if (column.IsDrawCallback) //外部处理输出格式
141554
- {
141555
- this.GetCustomTextDrawInfo(column, data.Symbol, value, drawInfo, data);
141556
- return;
141557
- }
141558
-
141559
141612
  if (!IFrameSplitOperator.IsNumber(value)) return;
141560
141613
 
141561
141614
  //格式化输出
@@ -141597,12 +141650,6 @@ function ChartReport()
141597
141650
  var value=this.GetExtendData(data, column);
141598
141651
  if (!IFrameSplitOperator.IsNumber(value)) return;
141599
141652
 
141600
- if (column.IsDrawCallback) //外部处理输出格式
141601
- {
141602
- this.GetCustomTextDrawInfo(column, data.Symbol, value, drawInfo, data);
141603
- return;
141604
- }
141605
-
141606
141653
  if (column.ValueType==0)
141607
141654
  {
141608
141655
  if (column.FormatType==1)
@@ -142738,42 +142785,9 @@ function ChartReport()
142738
142785
  }
142739
142786
  }
142740
142787
 
142741
- //外部配置显示格式 颜色 对齐方式
142742
- this.GetCustomTextDrawInfo=function(columnInfo, symbol, value, drawInfo, data)
142743
- {
142744
- var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_DRAW_CUSTOM_TEXT);
142745
- if (!event || !event.Callback) return false;
142746
-
142747
- var sendData=
142748
- {
142749
- Symbol:symbol, Column:columnInfo, Value:value, Data:data,
142750
- Out:{ Text:null, TextColor:null, TextAlign:null }
142751
- };
142752
-
142753
- event.Callback(event,sendData,this);
142754
-
142755
- if (sendData.Out.Text) drawInfo.Text=sendData.Out.Text;
142756
- if (sendData.Out.TextColor) drawInfo.TextColor=sendData.Out.TextColor;
142757
- if (sendData.Out.TextAlign) drawInfo.TextAlign=sendData.Out.TextAlign;
142758
- if (sendData.Out.BGColor) drawInfo.BGColor=sendData.Out.BGColor;
142759
-
142760
- return true;
142761
- }
142762
-
142763
142788
  this.FormatDrawInfo=function(column, stock, drawInfo, data)
142764
142789
  {
142765
- if (!column.IsDrawCallback) return false;
142766
-
142767
- var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_REPORT_FORMAT_DRAW_INFO);
142768
- if (!event || !event.Callback) return false;
142769
-
142770
- var sendData=
142771
- {
142772
- Stock:stock, Column:column, Data:data,
142773
- DrawInfo:drawInfo
142774
- };
142775
-
142776
- event.Callback(event,sendData,this);
142790
+ this.FormatDrawInfoEvent(stock, data, column, drawInfo);
142777
142791
  }
142778
142792
 
142779
142793
  this.GetFixedRowTextDrawInfo=function(rowIndex, colIndex, columnInfo, drawInfo)
@@ -158393,7 +158407,7 @@ function HQChartScriptWorker()
158393
158407
 
158394
158408
 
158395
158409
 
158396
- var HQCHART_VERSION="1.1.14687";
158410
+ var HQCHART_VERSION="1.1.14696";
158397
158411
 
158398
158412
  function PrintHQChartVersion()
158399
158413
  {