hqchart 1.1.14283 → 1.1.14289

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.
@@ -3053,12 +3053,17 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
3053
3053
  IsDisplayLatest:false,
3054
3054
  SelectedBorder:{ Mode:0, SelFrame:0 }, //边框选中模式 Mode:0=禁用 1=右侧标记选中 2=指标窗口标记选中
3055
3055
  SelectedXBorder: { Mode:0, Date:null }, //X边框选中模式 Mode:0=禁用 分时图图有效
3056
- //XDateFormat (多日分时图x轴底部日期格式)
3056
+ //XDateFormat (多日分时图x轴底部日期格式)
3057
+
3058
+ //右侧框架外部坐标和间距
3057
3059
  RightHorizontal:
3058
3060
  {
3059
3061
  //Show:true,
3060
3062
  //Width:5
3061
- } //右侧框架外部坐标和间距
3063
+ },
3064
+
3065
+ //锁十字光标
3066
+ LockCorssCursor:{ X:{ Enable:false } }
3062
3067
  };
3063
3068
 
3064
3069
  this.VerticalDrag; //通过X轴左右拖动数据(手势才有)
@@ -4464,7 +4469,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
4464
4469
  this.UIOnMounseOut=function(e)
4465
4470
  {
4466
4471
  JSConsole.Chart.Log('[KLineChartContainer::UIOnMounseOut]',e);
4467
- this.UIOnMouseMove(e);
4472
+ if (!this.IsLockCorssCursor()) this.UIOnMouseMove(e); //锁十字光标时, 始终显示十字光标
4468
4473
  }
4469
4474
 
4470
4475
  this.UIOnMouseleave=function(e)
@@ -5685,15 +5690,16 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
5685
5690
 
5686
5691
  var bDrawDialogTooltip=false;
5687
5692
  var ptPosition=null; //鼠标位置 null 无效 -1 在外面 >=0 对应的指标窗口中ID
5688
- if (this.LastPoint.X!=null || this.LastPoint.Y!=null)
5693
+ var corssCursorPos=this.GetCorssCursorPosition()
5694
+ if (corssCursorPos.LastPoint.X!=null || corssCursorPos.LastPoint.Y!=null)
5689
5695
  {
5690
5696
  if (this.ChartCorssCursor)
5691
5697
  {
5692
- this.ChartCorssCursor.LastPoint=this.LastPoint;
5693
- this.ChartCorssCursor.CursorIndex=this.CursorIndex;
5698
+ this.ChartCorssCursor.LastPoint=corssCursorPos.LastPoint;
5699
+ this.ChartCorssCursor.CursorIndex=corssCursorPos.CursorIndex;
5694
5700
  if (this.EnableNewIndex)
5695
5701
  {
5696
- this.ChartCorssCursor.CorssCursorIndex=this.CorssCursorIndex;
5702
+ this.ChartCorssCursor.CorssCursorIndex=corssCursorPos.CorssCursorIndex;
5697
5703
  this.ChartCorssCursor.EnableNewIndex=this.EnableNewIndex;
5698
5704
  }
5699
5705
 
@@ -5743,8 +5749,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
5743
5749
  var item=this.TitlePaint[i];
5744
5750
  if (!item.IsDynamic) continue;
5745
5751
 
5746
- item.CursorIndex=this.CursorIndex;
5747
- item.LastPoint=this.LastPoint;
5752
+ item.CursorIndex=corssCursorPos.CursorIndex;
5753
+ item.LastPoint=corssCursorPos.LastPoint;
5748
5754
  if (item.ClassName=='DynamicChartTitlePainting') item.OnDrawEvent=eventIndexTitleDraw
5749
5755
  else item.OnDrawEvent=eventTitleDraw;
5750
5756
 
@@ -6061,6 +6067,25 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
6061
6067
  }
6062
6068
  }
6063
6069
 
6070
+ //十字光标坐标
6071
+ this.GetCorssCursorPosition=function()
6072
+ {
6073
+ var position=
6074
+ {
6075
+ LastPoint:{ X:this.LastPoint.X, Y:this.LastPoint.Y },
6076
+ CursorIndex:this.CursorIndex,
6077
+ };
6078
+
6079
+ return position;
6080
+ }
6081
+
6082
+ this.IsLockCorssCursor=function()
6083
+ {
6084
+ if (!this.GlobalOption || !this.GlobalOption.LockCorssCursor) return false;
6085
+
6086
+ return this.GlobalOption.LockCorssCursor.X.Enable;
6087
+ }
6088
+
6064
6089
  //画动态信息
6065
6090
  this.DrawDynamicInfo=function(option)
6066
6091
  {
@@ -6138,13 +6163,14 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
6138
6163
 
6139
6164
  this.DrawDrawPictureXYCoordinate();
6140
6165
  var bDrawDialogTooltip=false;
6166
+ var corssCursorPos=this.GetCorssCursorPosition(); //十字光标的位置
6141
6167
  if (this.ChartCorssCursor)
6142
6168
  {
6143
- this.ChartCorssCursor.LastPoint=this.LastPoint;
6144
- this.ChartCorssCursor.CursorIndex=this.CursorIndex;
6169
+ this.ChartCorssCursor.LastPoint=corssCursorPos.LastPoint;
6170
+ this.ChartCorssCursor.CursorIndex=corssCursorPos.CursorIndex;
6145
6171
  if (this.EnableNewIndex)
6146
6172
  {
6147
- this.ChartCorssCursor.CorssCursorIndex=this.CorssCursorIndex;
6173
+ this.ChartCorssCursor.CorssCursorIndex=corssCursorPos.CorssCursorIndex;
6148
6174
  this.ChartCorssCursor.EnableNewIndex=this.EnableNewIndex;
6149
6175
  }
6150
6176
 
@@ -6198,7 +6224,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
6198
6224
  var item=this.TitlePaint[i];
6199
6225
  if (!item.IsDynamic) continue;
6200
6226
 
6201
- item.CursorIndex=this.CursorIndex;
6227
+ item.CursorIndex=corssCursorPos.CursorIndex;
6202
6228
  item.LastPoint=this.LastPoint;
6203
6229
  if (item.OnDrawEvent)
6204
6230
  {
@@ -6209,7 +6235,16 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
6209
6235
 
6210
6236
  var pointInfo=null;
6211
6237
  if (option && IFrameSplitOperator.IsNumber(option.ClientPos) && option.Point) //当前鼠标所在位置的详细信息 包含盘前盘后
6238
+ {
6212
6239
  pointInfo={ ClientPos:option.ClientPos, Point:{ X:option.Point.X, Y:option.Point.Y }};
6240
+ /*
6241
+ if (this.IsLockCorssCursor())
6242
+ {
6243
+ if (pointInfo.ClientPos<=0) pointInfo.ClientPos=1;
6244
+ }
6245
+ */
6246
+ }
6247
+
6213
6248
  item.PointInfo=pointInfo;
6214
6249
 
6215
6250
  item.Draw(moveonPoint, this.LastMouseStatus);
@@ -31677,7 +31712,7 @@ function ChartSimpleTable()
31677
31712
  var colItem=this.AryColumnCache[i];
31678
31713
 
31679
31714
  var rtBG={Left:x, Top:rtRow.Top, Bottom:rtRow.Bottom, Height:this.RowHeight, Width:colItem.Width };
31680
- rtBG.Right=rtBG.Top+rtBG.Height;
31715
+ rtBG.Right=rtBG.Left+rtBG.Width;
31681
31716
 
31682
31717
  if (item)
31683
31718
  {
@@ -56099,6 +56134,9 @@ function DynamicMinuteTitlePainting()
56099
56134
  isShowLastData=true;
56100
56135
  }
56101
56136
 
56137
+ //十字光标锁定状态 禁用显示最后一个数据
56138
+ if (this.GlobalOption && this.GlobalOption.LockCorssCursor && this.GlobalOption.LockCorssCursor.X.Enable) isShowLastData=false;
56139
+
56102
56140
  var isLastOne=false;
56103
56141
  if (isShowLastData)
56104
56142
  {
@@ -76940,6 +76978,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
76940
76978
  this.Frame.ClearUpDonwFrameYData();
76941
76979
  this.ClearCustomKLine();
76942
76980
  this.ClearKLineCaluate();
76981
+ this.UnlockCorssCursor();
76943
76982
 
76944
76983
 
76945
76984
  var kLineDrawType=this.GetKLineDrawType();
@@ -76977,6 +77016,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
76977
77016
  this.ResetOverlaySymbolStatus();
76978
77017
  this.ClearIndexRunCount();
76979
77018
  this.Frame.ClearYCoordinateMaxMin();
77019
+ this.UnlockCorssCursor();
76980
77020
  this.RequestHistoryData(); //请求日线数据
76981
77021
  //this.ReqeustKLineInfoData();
76982
77022
  }
@@ -76988,6 +77028,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
76988
77028
  this.ResetOverlaySymbolStatus();
76989
77029
  this.ClearIndexRunCount();
76990
77030
  this.Frame.ClearYCoordinateMaxMin();
77031
+ this.UnlockCorssCursor();
76991
77032
  this.RequestHistoryMinuteData(); //请求分钟数据
76992
77033
  }
76993
77034
  else if (ChartData.IsTickPeriod(this.Period))
@@ -76997,6 +77038,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
76997
77038
  this.ResetScrollBar();
76998
77039
  this.ClearIndexRunCount();
76999
77040
  this.Frame.ClearYCoordinateMaxMin();
77041
+ this.UnlockCorssCursor();
77000
77042
  this.RequestTickData(); //请求分笔数据
77001
77043
  }
77002
77044
  }
@@ -77037,6 +77079,8 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
77037
77079
  }
77038
77080
  else //API周期数据 重新请求数据
77039
77081
  {
77082
+
77083
+
77040
77084
  if (ChartData.IsDayPeriod(this.Period,true))
77041
77085
  {
77042
77086
  this.CancelAutoUpdate(); //先停止定时器
@@ -77044,6 +77088,8 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
77044
77088
  this.ClearIndexPaint();
77045
77089
  this.ResetOverlaySymbolStatus();
77046
77090
  this.ResetScrollBar();
77091
+ this.Frame.ClearYCoordinateMaxMin();
77092
+ this.UnlockCorssCursor();
77047
77093
  this.RequestHistoryData(); //请求日线数据
77048
77094
  }
77049
77095
  else if (ChartData.IsMinutePeriod(this.Period,true) || ChartData.IsSecondPeriod(this.Period) || ChartData.IsMilliSecondPeriod(this.Period))
@@ -77053,6 +77099,8 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
77053
77099
  this.ClearIndexPaint();
77054
77100
  this.ResetOverlaySymbolStatus();
77055
77101
  this.ResetScrollBar();
77102
+ this.Frame.ClearYCoordinateMaxMin();
77103
+ this.UnlockCorssCursor();
77056
77104
  this.RequestHistoryMinuteData(); //请求分钟数据
77057
77105
  }
77058
77106
  }
@@ -78397,6 +78445,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
78397
78445
  this.HideTooltip();
78398
78446
  this.ResetScrollBar();
78399
78447
  this.ClearIndexRunCount();
78448
+ this.UnlockCorssCursor();
78400
78449
  this.Frame.ClearYCoordinateMaxMin();
78401
78450
 
78402
78451
 
@@ -81156,6 +81205,40 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
81156
81205
 
81157
81206
  return data;
81158
81207
  }
81208
+
81209
+ //十字光标解锁
81210
+ this.UnlockCorssCursor=function()
81211
+ {
81212
+ var xItem=this.GlobalOption.LockCorssCursor.X;
81213
+ xItem.Enable=false;
81214
+ xItem.KLine=null;
81215
+ }
81216
+
81217
+ this.LockCorssCursor=function()
81218
+ {
81219
+ var xItem=this.GlobalOption.LockCorssCursor.X;
81220
+ xItem.KLine={ DataIndex:null, Date:null, Time:null };
81221
+ xItem.Enable=true;
81222
+ }
81223
+
81224
+ this.GetCorssCursorPosition=function()
81225
+ {
81226
+ var position=
81227
+ {
81228
+ LastPoint:{ X:this.LastPoint.X, Y:this.LastPoint.Y },
81229
+ CursorIndex:this.CursorIndex,
81230
+ };
81231
+
81232
+ if (!this.GlobalOption || !this.GlobalOption.LockCorssCursor) return position;
81233
+
81234
+ var xItem=this.GlobalOption.LockCorssCursor.X;
81235
+ if (xItem.Enable && xItem.KLine)
81236
+ {
81237
+ position.CursorIndex=xItem.KLine.CursorIndex;
81238
+ }
81239
+
81240
+ return position;
81241
+ }
81159
81242
  }
81160
81243
 
81161
81244
  //API 返回数据 转化为array[]
@@ -81587,7 +81670,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
81587
81670
  this.ColorLineData; //主图价格线颜色自定义配置
81588
81671
  this.EnableSelectRect=false; //是否可以区间选择
81589
81672
 
81590
- this.CorssCursorIndex={ DayIndex:-1, DataIndex:-1, Point:{X:-1, Y:-1} ,Type:-1 };
81673
+ this.CorssCursorIndex={ DayIndex:-1, DataIndex:-1, Point:{X:-1, Y:-1} ,Type:-1 }; //Type: 单日(1=主图 2=盘前 3=盘后) 多日(10=主图 20=盘前 30=盘后)
81591
81674
  this.EnableNewIndex=false //是否使用新的索引版本
81592
81675
 
81593
81676
  this.DayOffset={ Offset:0, ShowDayCount:-1, DataOffset:0, DayCount:1, }; //Offset 日期偏移 , DataOffset数据偏移
@@ -82344,6 +82427,118 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
82344
82427
  }
82345
82428
  }
82346
82429
 
82430
+ this.LockCorssCursor=function()
82431
+ {
82432
+ var xItem=this.GlobalOption.LockCorssCursor.X;
82433
+
82434
+ if (this.EnableNewIndex)
82435
+ {
82436
+ if (this.CorssCursorIndex.Type!=1 && this.CorssCursorIndex.Type!=10) return; //目前只支持连续交易时间段
82437
+
82438
+ xItem.Minute=
82439
+ {
82440
+ DayIndex:this.CorssCursorIndex.DayIndex,
82441
+ DataIndex:this.CorssCursorIndex.DataIndex,
82442
+ Type:this.CorssCursorIndex.Type,
82443
+ CursorIndex:this.CursorIndex,
82444
+ };
82445
+ }
82446
+ else
82447
+ {
82448
+ xItem.Minute={ CursorIndex:this.CursorIndex };
82449
+ }
82450
+
82451
+ xItem.Enable=true;
82452
+ }
82453
+
82454
+ this.UnlockCorssCursor=function()
82455
+ {
82456
+ var xItem=this.GlobalOption.LockCorssCursor.X;
82457
+ xItem.Enable=false;
82458
+ xItem.Minute=null;
82459
+ }
82460
+
82461
+ this.GetCorssCursorPosition=function()
82462
+ {
82463
+ var position=
82464
+ {
82465
+ LastPoint:{ X:this.LastPoint.X, Y:this.LastPoint.Y },
82466
+ CursorIndex:this.CursorIndex,
82467
+ CorssCursorIndex:this.CorssCursorIndex,
82468
+ };
82469
+
82470
+ if (!this.GlobalOption || !this.GlobalOption.LockCorssCursor) return position;
82471
+
82472
+ var xItem=this.GlobalOption.LockCorssCursor.X;
82473
+ if (xItem.Enable && xItem.Minute)
82474
+ {
82475
+ if (this.EnableNewIndex)
82476
+ {
82477
+ var type=xItem.Minute.Type;
82478
+ position.CorssCursorIndex={ DayIndex:xItem.Minute.DayIndex, DataIndex:xItem.Minute.DataIndex, Type:type };
82479
+ position.CursorIndex=xItem.Minute.CursorIndex;
82480
+ position.LastPoint.X=this.GetXPointByCorssCursorIndex(position.CorssCursorIndex);
82481
+ }
82482
+ else
82483
+ {
82484
+ var index=xItem.Minute.CursorIndex;
82485
+ var x=this.Frame.GetXFromIndex(index,false);
82486
+ position.LastPoint.X=x;
82487
+ position.CursorIndex=xItem.Minute.CursorIndex;
82488
+ }
82489
+
82490
+ var border=this.Frame.ChartBorder.GetBorder();
82491
+ if (position.LastPoint.Y<border.Top || position.LastPoint.Y>border.Bottom) //超出图形框子, 调整为收盘价
82492
+ {
82493
+ var kData=this.GetKData();
82494
+ if (kData && IFrameSplitOperator.IsNonEmptyArray(kData.Data))
82495
+ {
82496
+ var index=parseInt(position.CursorIndex.toFixed(0));
82497
+ var item=kData.Data[index];
82498
+ if (item && IFrameSplitOperator.IsNumber(item.Close))
82499
+ {
82500
+ var y = this.Frame.SubFrame[0].Frame.GetYFromData(item.Close);
82501
+ position.LastPoint.Y=y;
82502
+ }
82503
+ }
82504
+ }
82505
+ }
82506
+
82507
+ return position;
82508
+ }
82509
+
82510
+ this.GetXPointByCorssCursorIndex=function(corssCursorIndex)
82511
+ {
82512
+ if (!corssCursorIndex) return;
82513
+
82514
+ var x=null;
82515
+ var dayIndex=corssCursorIndex.DayIndex;
82516
+ var dataIndex=corssCursorIndex.DataIndex;
82517
+ switch(corssCursorIndex.Type) //单日 1=主图 2=盘前 3=盘后 //多日 10=主图 20=盘前 30=盘后
82518
+ {
82519
+ case 1: //单日 1=主图
82520
+ case 10: //多日 10=主图
82521
+ x=this.Frame.GetXFromIndex(dataIndex)
82522
+ break;
82523
+ /*
82524
+ case 2: //单日 2=盘前
82525
+ x=this.Frame.SubFrame[0].Frame.GetLeftExtendXFromIndex(dataIndex,this.GetBeforeOpenData());
82526
+ break;
82527
+ case 20: //多日 20=盘前
82528
+ x=this.Frame.SubFrame[0].Frame.GetLeftExtendXFromIndex(dataIndex,{ Data:this.MultiDayBeforeOpenData, });
82529
+ break;
82530
+ case 3: //单日 3=盘后
82531
+ x=this.Frame.SubFrame[0].Frame.GetRightExtendXFromIndex(dataIndex,this.GetAfterCloseData());
82532
+ break;
82533
+ case 30: //多日 30=盘后
82534
+ x=this.Frame.SubFrame[0].Frame.GetRightExtendXFromIndex(dataIndex,{ Data:this.MultiDayAfterCloseData} );
82535
+ break;
82536
+ */
82537
+ }
82538
+
82539
+ return x;
82540
+ }
82541
+
82347
82542
  this.SetCorssCursorIndex=function(option)
82348
82543
  {
82349
82544
  if (!this.EnableNewIndex) return;
@@ -84237,6 +84432,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
84237
84432
  this.ReloadChartDrawPicture();
84238
84433
  this.ClearIndexRunCount();
84239
84434
  this.ClearStockCache();
84435
+ this.UnlockCorssCursor();
84240
84436
  this.Frame.ClearYCoordinateMaxMin();
84241
84437
 
84242
84438
  if (option)
@@ -84372,6 +84568,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
84372
84568
  this.AutoUpdateEvent(false, "MinuteChartContainer::ChangeDayCount");
84373
84569
  this.DayCount=count;
84374
84570
  this.ClearMinuteData();
84571
+ this.UnlockCorssCursor();
84375
84572
 
84376
84573
  if (option && option.PageInfo)
84377
84574
  {