hqchart 1.1.14286 → 1.1.14291

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.
@@ -7022,12 +7022,17 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7022
7022
  IsDisplayLatest:false,
7023
7023
  SelectedBorder:{ Mode:0, SelFrame:0 }, //边框选中模式 Mode:0=禁用 1=右侧标记选中 2=指标窗口标记选中
7024
7024
  SelectedXBorder: { Mode:0, Date:null }, //X边框选中模式 Mode:0=禁用 分时图图有效
7025
- //XDateFormat (多日分时图x轴底部日期格式)
7025
+ //XDateFormat (多日分时图x轴底部日期格式)
7026
+
7027
+ //右侧框架外部坐标和间距
7026
7028
  RightHorizontal:
7027
7029
  {
7028
7030
  //Show:true,
7029
7031
  //Width:5
7030
- } //右侧框架外部坐标和间距
7032
+ },
7033
+
7034
+ //锁十字光标
7035
+ LockCorssCursor:{ X:{ Enable:false } }
7031
7036
  };
7032
7037
 
7033
7038
  this.VerticalDrag; //通过X轴左右拖动数据(手势才有)
@@ -8433,7 +8438,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
8433
8438
  this.UIOnMounseOut=function(e)
8434
8439
  {
8435
8440
  JSConsole.Chart.Log('[KLineChartContainer::UIOnMounseOut]',e);
8436
- this.UIOnMouseMove(e);
8441
+ if (!this.IsLockCorssCursor()) this.UIOnMouseMove(e); //锁十字光标时, 始终显示十字光标
8437
8442
  }
8438
8443
 
8439
8444
  this.UIOnMouseleave=function(e)
@@ -9654,15 +9659,16 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9654
9659
 
9655
9660
  var bDrawDialogTooltip=false;
9656
9661
  var ptPosition=null; //鼠标位置 null 无效 -1 在外面 >=0 对应的指标窗口中ID
9657
- if (this.LastPoint.X!=null || this.LastPoint.Y!=null)
9662
+ var corssCursorPos=this.GetCorssCursorPosition()
9663
+ if (corssCursorPos.LastPoint.X!=null || corssCursorPos.LastPoint.Y!=null)
9658
9664
  {
9659
9665
  if (this.ChartCorssCursor)
9660
9666
  {
9661
- this.ChartCorssCursor.LastPoint=this.LastPoint;
9662
- this.ChartCorssCursor.CursorIndex=this.CursorIndex;
9667
+ this.ChartCorssCursor.LastPoint=corssCursorPos.LastPoint;
9668
+ this.ChartCorssCursor.CursorIndex=corssCursorPos.CursorIndex;
9663
9669
  if (this.EnableNewIndex)
9664
9670
  {
9665
- this.ChartCorssCursor.CorssCursorIndex=this.CorssCursorIndex;
9671
+ this.ChartCorssCursor.CorssCursorIndex=corssCursorPos.CorssCursorIndex;
9666
9672
  this.ChartCorssCursor.EnableNewIndex=this.EnableNewIndex;
9667
9673
  }
9668
9674
 
@@ -9712,8 +9718,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9712
9718
  var item=this.TitlePaint[i];
9713
9719
  if (!item.IsDynamic) continue;
9714
9720
 
9715
- item.CursorIndex=this.CursorIndex;
9716
- item.LastPoint=this.LastPoint;
9721
+ item.CursorIndex=corssCursorPos.CursorIndex;
9722
+ item.LastPoint=corssCursorPos.LastPoint;
9717
9723
  if (item.ClassName=='DynamicChartTitlePainting') item.OnDrawEvent=eventIndexTitleDraw
9718
9724
  else item.OnDrawEvent=eventTitleDraw;
9719
9725
 
@@ -9721,6 +9727,10 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9721
9727
  {
9722
9728
  item.OnDrawEvent.FunctionName='Draw';
9723
9729
  item.OnDrawEvent.PointPosition=ptPosition;
9730
+ if (this.IsLockCorssCursor())
9731
+ {
9732
+ if (item.OnDrawEvent.PointPosition<0) item.OnDrawEvent.PointPosition=0;
9733
+ }
9724
9734
  }
9725
9735
 
9726
9736
  item.DrawStatus=drawStatus;
@@ -10030,6 +10040,25 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
10030
10040
  }
10031
10041
  }
10032
10042
 
10043
+ //十字光标坐标
10044
+ this.GetCorssCursorPosition=function()
10045
+ {
10046
+ var position=
10047
+ {
10048
+ LastPoint:{ X:this.LastPoint.X, Y:this.LastPoint.Y },
10049
+ CursorIndex:this.CursorIndex,
10050
+ };
10051
+
10052
+ return position;
10053
+ }
10054
+
10055
+ this.IsLockCorssCursor=function()
10056
+ {
10057
+ if (!this.GlobalOption || !this.GlobalOption.LockCorssCursor) return false;
10058
+
10059
+ return this.GlobalOption.LockCorssCursor.X.Enable;
10060
+ }
10061
+
10033
10062
  //画动态信息
10034
10063
  this.DrawDynamicInfo=function(option)
10035
10064
  {
@@ -10107,13 +10136,14 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
10107
10136
 
10108
10137
  this.DrawDrawPictureXYCoordinate();
10109
10138
  var bDrawDialogTooltip=false;
10139
+ var corssCursorPos=this.GetCorssCursorPosition(); //十字光标的位置
10110
10140
  if (this.ChartCorssCursor)
10111
10141
  {
10112
- this.ChartCorssCursor.LastPoint=this.LastPoint;
10113
- this.ChartCorssCursor.CursorIndex=this.CursorIndex;
10142
+ this.ChartCorssCursor.LastPoint=corssCursorPos.LastPoint;
10143
+ this.ChartCorssCursor.CursorIndex=corssCursorPos.CursorIndex;
10114
10144
  if (this.EnableNewIndex)
10115
10145
  {
10116
- this.ChartCorssCursor.CorssCursorIndex=this.CorssCursorIndex;
10146
+ this.ChartCorssCursor.CorssCursorIndex=corssCursorPos.CorssCursorIndex;
10117
10147
  this.ChartCorssCursor.EnableNewIndex=this.EnableNewIndex;
10118
10148
  }
10119
10149
 
@@ -10167,18 +10197,29 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
10167
10197
  var item=this.TitlePaint[i];
10168
10198
  if (!item.IsDynamic) continue;
10169
10199
 
10170
- item.CursorIndex=this.CursorIndex;
10200
+ item.CursorIndex=corssCursorPos.CursorIndex;
10171
10201
  item.LastPoint=this.LastPoint;
10172
10202
  if (item.OnDrawEvent)
10173
10203
  {
10174
10204
  item.OnDrawEvent.FunctionName='DrawDynamicInfo';
10175
10205
  item.OnDrawEvent.PointPosition=ptPosition;
10206
+ if (this.IsLockCorssCursor())
10207
+ {
10208
+ if (item.OnDrawEvent.PointPosition<0) item.OnDrawEvent.PointPosition=0;
10209
+ }
10176
10210
  }
10177
10211
  item.DrawStatus=drawStatus;
10178
10212
 
10179
10213
  var pointInfo=null;
10180
10214
  if (option && IFrameSplitOperator.IsNumber(option.ClientPos) && option.Point) //当前鼠标所在位置的详细信息 包含盘前盘后
10215
+ {
10181
10216
  pointInfo={ ClientPos:option.ClientPos, Point:{ X:option.Point.X, Y:option.Point.Y }};
10217
+ if (this.IsLockCorssCursor())
10218
+ {
10219
+ if (pointInfo.ClientPos<=0) pointInfo.ClientPos=1;
10220
+ }
10221
+ }
10222
+
10182
10223
  item.PointInfo=pointInfo;
10183
10224
 
10184
10225
  item.Draw(moveonPoint, this.LastMouseStatus);
@@ -60068,6 +60109,9 @@ function DynamicMinuteTitlePainting()
60068
60109
  isShowLastData=true;
60069
60110
  }
60070
60111
 
60112
+ //十字光标锁定状态 禁用显示最后一个数据
60113
+ if (this.GlobalOption && this.GlobalOption.LockCorssCursor && this.GlobalOption.LockCorssCursor.X.Enable) isShowLastData=false;
60114
+
60071
60115
  var isLastOne=false;
60072
60116
  if (isShowLastData)
60073
60117
  {
@@ -60626,6 +60670,9 @@ function DynamicChartTitlePainting()
60626
60670
  isShowLastData=true;
60627
60671
  }
60628
60672
 
60673
+ //十字光标锁定状态 禁用显示最后一个数据
60674
+ if (this.GlobalOption && this.GlobalOption.LockCorssCursor && this.GlobalOption.LockCorssCursor.X.Enable) isShowLastData=false;
60675
+
60629
60676
  return isShowLastData;
60630
60677
  }
60631
60678
 
@@ -80909,6 +80956,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
80909
80956
  this.Frame.ClearUpDonwFrameYData();
80910
80957
  this.ClearCustomKLine();
80911
80958
  this.ClearKLineCaluate();
80959
+ this.UnlockCorssCursor();
80912
80960
 
80913
80961
 
80914
80962
  var kLineDrawType=this.GetKLineDrawType();
@@ -80946,6 +80994,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
80946
80994
  this.ResetOverlaySymbolStatus();
80947
80995
  this.ClearIndexRunCount();
80948
80996
  this.Frame.ClearYCoordinateMaxMin();
80997
+ this.UnlockCorssCursor();
80949
80998
  this.RequestHistoryData(); //请求日线数据
80950
80999
  //this.ReqeustKLineInfoData();
80951
81000
  }
@@ -80957,6 +81006,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
80957
81006
  this.ResetOverlaySymbolStatus();
80958
81007
  this.ClearIndexRunCount();
80959
81008
  this.Frame.ClearYCoordinateMaxMin();
81009
+ this.UnlockCorssCursor();
80960
81010
  this.RequestHistoryMinuteData(); //请求分钟数据
80961
81011
  }
80962
81012
  else if (ChartData.IsTickPeriod(this.Period))
@@ -80966,6 +81016,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
80966
81016
  this.ResetScrollBar();
80967
81017
  this.ClearIndexRunCount();
80968
81018
  this.Frame.ClearYCoordinateMaxMin();
81019
+ this.UnlockCorssCursor();
80969
81020
  this.RequestTickData(); //请求分笔数据
80970
81021
  }
80971
81022
  }
@@ -81016,6 +81067,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
81016
81067
  this.ResetOverlaySymbolStatus();
81017
81068
  this.ResetScrollBar();
81018
81069
  this.Frame.ClearYCoordinateMaxMin();
81070
+ this.UnlockCorssCursor();
81019
81071
  this.RequestHistoryData(); //请求日线数据
81020
81072
  }
81021
81073
  else if (ChartData.IsMinutePeriod(this.Period,true) || ChartData.IsSecondPeriod(this.Period) || ChartData.IsMilliSecondPeriod(this.Period))
@@ -81026,6 +81078,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
81026
81078
  this.ResetOverlaySymbolStatus();
81027
81079
  this.ResetScrollBar();
81028
81080
  this.Frame.ClearYCoordinateMaxMin();
81081
+ this.UnlockCorssCursor();
81029
81082
  this.RequestHistoryMinuteData(); //请求分钟数据
81030
81083
  }
81031
81084
  }
@@ -82370,6 +82423,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
82370
82423
  this.HideTooltip();
82371
82424
  this.ResetScrollBar();
82372
82425
  this.ClearIndexRunCount();
82426
+ this.UnlockCorssCursor();
82373
82427
  this.Frame.ClearYCoordinateMaxMin();
82374
82428
 
82375
82429
 
@@ -85129,6 +85183,40 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
85129
85183
 
85130
85184
  return data;
85131
85185
  }
85186
+
85187
+ //十字光标解锁
85188
+ this.UnlockCorssCursor=function()
85189
+ {
85190
+ var xItem=this.GlobalOption.LockCorssCursor.X;
85191
+ xItem.Enable=false;
85192
+ xItem.KLine=null;
85193
+ }
85194
+
85195
+ this.LockCorssCursor=function()
85196
+ {
85197
+ var xItem=this.GlobalOption.LockCorssCursor.X;
85198
+ xItem.KLine={ DataIndex:null, Date:null, Time:null };
85199
+ xItem.Enable=true;
85200
+ }
85201
+
85202
+ this.GetCorssCursorPosition=function()
85203
+ {
85204
+ var position=
85205
+ {
85206
+ LastPoint:{ X:this.LastPoint.X, Y:this.LastPoint.Y },
85207
+ CursorIndex:this.CursorIndex,
85208
+ };
85209
+
85210
+ if (!this.GlobalOption || !this.GlobalOption.LockCorssCursor) return position;
85211
+
85212
+ var xItem=this.GlobalOption.LockCorssCursor.X;
85213
+ if (xItem.Enable && xItem.KLine)
85214
+ {
85215
+ position.CursorIndex=xItem.KLine.CursorIndex;
85216
+ }
85217
+
85218
+ return position;
85219
+ }
85132
85220
  }
85133
85221
 
85134
85222
  //API 返回数据 转化为array[]
@@ -85560,7 +85648,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
85560
85648
  this.ColorLineData; //主图价格线颜色自定义配置
85561
85649
  this.EnableSelectRect=false; //是否可以区间选择
85562
85650
 
85563
- this.CorssCursorIndex={ DayIndex:-1, DataIndex:-1, Point:{X:-1, Y:-1} ,Type:-1 };
85651
+ this.CorssCursorIndex={ DayIndex:-1, DataIndex:-1, Point:{X:-1, Y:-1} ,Type:-1 }; //Type: 单日(1=主图 2=盘前 3=盘后) 多日(10=主图 20=盘前 30=盘后)
85564
85652
  this.EnableNewIndex=false //是否使用新的索引版本
85565
85653
 
85566
85654
  this.DayOffset={ Offset:0, ShowDayCount:-1, DataOffset:0, DayCount:1, }; //Offset 日期偏移 , DataOffset数据偏移
@@ -86317,6 +86405,118 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
86317
86405
  }
86318
86406
  }
86319
86407
 
86408
+ this.LockCorssCursor=function()
86409
+ {
86410
+ var xItem=this.GlobalOption.LockCorssCursor.X;
86411
+
86412
+ if (this.EnableNewIndex)
86413
+ {
86414
+ if (this.CorssCursorIndex.Type!=1 && this.CorssCursorIndex.Type!=10) return; //目前只支持连续交易时间段
86415
+
86416
+ xItem.Minute=
86417
+ {
86418
+ DayIndex:this.CorssCursorIndex.DayIndex,
86419
+ DataIndex:this.CorssCursorIndex.DataIndex,
86420
+ Type:this.CorssCursorIndex.Type,
86421
+ CursorIndex:this.CursorIndex,
86422
+ };
86423
+ }
86424
+ else
86425
+ {
86426
+ xItem.Minute={ CursorIndex:this.CursorIndex };
86427
+ }
86428
+
86429
+ xItem.Enable=true;
86430
+ }
86431
+
86432
+ this.UnlockCorssCursor=function()
86433
+ {
86434
+ var xItem=this.GlobalOption.LockCorssCursor.X;
86435
+ xItem.Enable=false;
86436
+ xItem.Minute=null;
86437
+ }
86438
+
86439
+ this.GetCorssCursorPosition=function()
86440
+ {
86441
+ var position=
86442
+ {
86443
+ LastPoint:{ X:this.LastPoint.X, Y:this.LastPoint.Y },
86444
+ CursorIndex:this.CursorIndex,
86445
+ CorssCursorIndex:this.CorssCursorIndex,
86446
+ };
86447
+
86448
+ if (!this.GlobalOption || !this.GlobalOption.LockCorssCursor) return position;
86449
+
86450
+ var xItem=this.GlobalOption.LockCorssCursor.X;
86451
+ if (xItem.Enable && xItem.Minute)
86452
+ {
86453
+ if (this.EnableNewIndex)
86454
+ {
86455
+ var type=xItem.Minute.Type;
86456
+ position.CorssCursorIndex={ DayIndex:xItem.Minute.DayIndex, DataIndex:xItem.Minute.DataIndex, Type:type };
86457
+ position.CursorIndex=xItem.Minute.CursorIndex;
86458
+ position.LastPoint.X=this.GetXPointByCorssCursorIndex(position.CorssCursorIndex);
86459
+ }
86460
+ else
86461
+ {
86462
+ var index=xItem.Minute.CursorIndex;
86463
+ var x=this.Frame.GetXFromIndex(index,false);
86464
+ position.LastPoint.X=x;
86465
+ position.CursorIndex=xItem.Minute.CursorIndex;
86466
+ }
86467
+
86468
+ var border=this.Frame.ChartBorder.GetBorder();
86469
+ if (position.LastPoint.Y<border.Top || position.LastPoint.Y>border.Bottom) //超出图形框子, 调整为收盘价
86470
+ {
86471
+ var kData=this.GetKData();
86472
+ if (kData && IFrameSplitOperator.IsNonEmptyArray(kData.Data))
86473
+ {
86474
+ var index=parseInt(position.CursorIndex.toFixed(0));
86475
+ var item=kData.Data[index];
86476
+ if (item && IFrameSplitOperator.IsNumber(item.Close))
86477
+ {
86478
+ var y = this.Frame.SubFrame[0].Frame.GetYFromData(item.Close);
86479
+ position.LastPoint.Y=y;
86480
+ }
86481
+ }
86482
+ }
86483
+ }
86484
+
86485
+ return position;
86486
+ }
86487
+
86488
+ this.GetXPointByCorssCursorIndex=function(corssCursorIndex)
86489
+ {
86490
+ if (!corssCursorIndex) return;
86491
+
86492
+ var x=null;
86493
+ var dayIndex=corssCursorIndex.DayIndex;
86494
+ var dataIndex=corssCursorIndex.DataIndex;
86495
+ switch(corssCursorIndex.Type) //单日 1=主图 2=盘前 3=盘后 //多日 10=主图 20=盘前 30=盘后
86496
+ {
86497
+ case 1: //单日 1=主图
86498
+ case 10: //多日 10=主图
86499
+ x=this.Frame.GetXFromIndex(dataIndex)
86500
+ break;
86501
+ /*
86502
+ case 2: //单日 2=盘前
86503
+ x=this.Frame.SubFrame[0].Frame.GetLeftExtendXFromIndex(dataIndex,this.GetBeforeOpenData());
86504
+ break;
86505
+ case 20: //多日 20=盘前
86506
+ x=this.Frame.SubFrame[0].Frame.GetLeftExtendXFromIndex(dataIndex,{ Data:this.MultiDayBeforeOpenData, });
86507
+ break;
86508
+ case 3: //单日 3=盘后
86509
+ x=this.Frame.SubFrame[0].Frame.GetRightExtendXFromIndex(dataIndex,this.GetAfterCloseData());
86510
+ break;
86511
+ case 30: //多日 30=盘后
86512
+ x=this.Frame.SubFrame[0].Frame.GetRightExtendXFromIndex(dataIndex,{ Data:this.MultiDayAfterCloseData} );
86513
+ break;
86514
+ */
86515
+ }
86516
+
86517
+ return x;
86518
+ }
86519
+
86320
86520
  this.SetCorssCursorIndex=function(option)
86321
86521
  {
86322
86522
  if (!this.EnableNewIndex) return;
@@ -88210,6 +88410,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
88210
88410
  this.ReloadChartDrawPicture();
88211
88411
  this.ClearIndexRunCount();
88212
88412
  this.ClearStockCache();
88413
+ this.UnlockCorssCursor();
88213
88414
  this.Frame.ClearYCoordinateMaxMin();
88214
88415
 
88215
88416
  if (option)
@@ -88345,6 +88546,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
88345
88546
  this.AutoUpdateEvent(false, "MinuteChartContainer::ChangeDayCount");
88346
88547
  this.DayCount=count;
88347
88548
  this.ClearMinuteData();
88549
+ this.UnlockCorssCursor();
88348
88550
 
88349
88551
  if (option && option.PageInfo)
88350
88552
  {
@@ -150754,7 +150956,7 @@ function HQChartScriptWorker()
150754
150956
 
150755
150957
 
150756
150958
 
150757
- var HQCHART_VERSION="1.1.14285";
150959
+ var HQCHART_VERSION="1.1.14290";
150758
150960
 
150759
150961
  function PrintHQChartVersion()
150760
150962
  {