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.
@@ -6978,12 +6978,17 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
6978
6978
  IsDisplayLatest:false,
6979
6979
  SelectedBorder:{ Mode:0, SelFrame:0 }, //边框选中模式 Mode:0=禁用 1=右侧标记选中 2=指标窗口标记选中
6980
6980
  SelectedXBorder: { Mode:0, Date:null }, //X边框选中模式 Mode:0=禁用 分时图图有效
6981
- //XDateFormat (多日分时图x轴底部日期格式)
6981
+ //XDateFormat (多日分时图x轴底部日期格式)
6982
+
6983
+ //右侧框架外部坐标和间距
6982
6984
  RightHorizontal:
6983
6985
  {
6984
6986
  //Show:true,
6985
6987
  //Width:5
6986
- } //右侧框架外部坐标和间距
6988
+ },
6989
+
6990
+ //锁十字光标
6991
+ LockCorssCursor:{ X:{ Enable:false } }
6987
6992
  };
6988
6993
 
6989
6994
  this.VerticalDrag; //通过X轴左右拖动数据(手势才有)
@@ -8389,7 +8394,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
8389
8394
  this.UIOnMounseOut=function(e)
8390
8395
  {
8391
8396
  JSConsole.Chart.Log('[KLineChartContainer::UIOnMounseOut]',e);
8392
- this.UIOnMouseMove(e);
8397
+ if (!this.IsLockCorssCursor()) this.UIOnMouseMove(e); //锁十字光标时, 始终显示十字光标
8393
8398
  }
8394
8399
 
8395
8400
  this.UIOnMouseleave=function(e)
@@ -9610,15 +9615,16 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9610
9615
 
9611
9616
  var bDrawDialogTooltip=false;
9612
9617
  var ptPosition=null; //鼠标位置 null 无效 -1 在外面 >=0 对应的指标窗口中ID
9613
- if (this.LastPoint.X!=null || this.LastPoint.Y!=null)
9618
+ var corssCursorPos=this.GetCorssCursorPosition()
9619
+ if (corssCursorPos.LastPoint.X!=null || corssCursorPos.LastPoint.Y!=null)
9614
9620
  {
9615
9621
  if (this.ChartCorssCursor)
9616
9622
  {
9617
- this.ChartCorssCursor.LastPoint=this.LastPoint;
9618
- this.ChartCorssCursor.CursorIndex=this.CursorIndex;
9623
+ this.ChartCorssCursor.LastPoint=corssCursorPos.LastPoint;
9624
+ this.ChartCorssCursor.CursorIndex=corssCursorPos.CursorIndex;
9619
9625
  if (this.EnableNewIndex)
9620
9626
  {
9621
- this.ChartCorssCursor.CorssCursorIndex=this.CorssCursorIndex;
9627
+ this.ChartCorssCursor.CorssCursorIndex=corssCursorPos.CorssCursorIndex;
9622
9628
  this.ChartCorssCursor.EnableNewIndex=this.EnableNewIndex;
9623
9629
  }
9624
9630
 
@@ -9668,8 +9674,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9668
9674
  var item=this.TitlePaint[i];
9669
9675
  if (!item.IsDynamic) continue;
9670
9676
 
9671
- item.CursorIndex=this.CursorIndex;
9672
- item.LastPoint=this.LastPoint;
9677
+ item.CursorIndex=corssCursorPos.CursorIndex;
9678
+ item.LastPoint=corssCursorPos.LastPoint;
9673
9679
  if (item.ClassName=='DynamicChartTitlePainting') item.OnDrawEvent=eventIndexTitleDraw
9674
9680
  else item.OnDrawEvent=eventTitleDraw;
9675
9681
 
@@ -9677,6 +9683,10 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9677
9683
  {
9678
9684
  item.OnDrawEvent.FunctionName='Draw';
9679
9685
  item.OnDrawEvent.PointPosition=ptPosition;
9686
+ if (this.IsLockCorssCursor())
9687
+ {
9688
+ if (item.OnDrawEvent.PointPosition<0) item.OnDrawEvent.PointPosition=0;
9689
+ }
9680
9690
  }
9681
9691
 
9682
9692
  item.DrawStatus=drawStatus;
@@ -9986,6 +9996,25 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9986
9996
  }
9987
9997
  }
9988
9998
 
9999
+ //十字光标坐标
10000
+ this.GetCorssCursorPosition=function()
10001
+ {
10002
+ var position=
10003
+ {
10004
+ LastPoint:{ X:this.LastPoint.X, Y:this.LastPoint.Y },
10005
+ CursorIndex:this.CursorIndex,
10006
+ };
10007
+
10008
+ return position;
10009
+ }
10010
+
10011
+ this.IsLockCorssCursor=function()
10012
+ {
10013
+ if (!this.GlobalOption || !this.GlobalOption.LockCorssCursor) return false;
10014
+
10015
+ return this.GlobalOption.LockCorssCursor.X.Enable;
10016
+ }
10017
+
9989
10018
  //画动态信息
9990
10019
  this.DrawDynamicInfo=function(option)
9991
10020
  {
@@ -10063,13 +10092,14 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
10063
10092
 
10064
10093
  this.DrawDrawPictureXYCoordinate();
10065
10094
  var bDrawDialogTooltip=false;
10095
+ var corssCursorPos=this.GetCorssCursorPosition(); //十字光标的位置
10066
10096
  if (this.ChartCorssCursor)
10067
10097
  {
10068
- this.ChartCorssCursor.LastPoint=this.LastPoint;
10069
- this.ChartCorssCursor.CursorIndex=this.CursorIndex;
10098
+ this.ChartCorssCursor.LastPoint=corssCursorPos.LastPoint;
10099
+ this.ChartCorssCursor.CursorIndex=corssCursorPos.CursorIndex;
10070
10100
  if (this.EnableNewIndex)
10071
10101
  {
10072
- this.ChartCorssCursor.CorssCursorIndex=this.CorssCursorIndex;
10102
+ this.ChartCorssCursor.CorssCursorIndex=corssCursorPos.CorssCursorIndex;
10073
10103
  this.ChartCorssCursor.EnableNewIndex=this.EnableNewIndex;
10074
10104
  }
10075
10105
 
@@ -10123,18 +10153,29 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
10123
10153
  var item=this.TitlePaint[i];
10124
10154
  if (!item.IsDynamic) continue;
10125
10155
 
10126
- item.CursorIndex=this.CursorIndex;
10156
+ item.CursorIndex=corssCursorPos.CursorIndex;
10127
10157
  item.LastPoint=this.LastPoint;
10128
10158
  if (item.OnDrawEvent)
10129
10159
  {
10130
10160
  item.OnDrawEvent.FunctionName='DrawDynamicInfo';
10131
10161
  item.OnDrawEvent.PointPosition=ptPosition;
10162
+ if (this.IsLockCorssCursor())
10163
+ {
10164
+ if (item.OnDrawEvent.PointPosition<0) item.OnDrawEvent.PointPosition=0;
10165
+ }
10132
10166
  }
10133
10167
  item.DrawStatus=drawStatus;
10134
10168
 
10135
10169
  var pointInfo=null;
10136
10170
  if (option && IFrameSplitOperator.IsNumber(option.ClientPos) && option.Point) //当前鼠标所在位置的详细信息 包含盘前盘后
10171
+ {
10137
10172
  pointInfo={ ClientPos:option.ClientPos, Point:{ X:option.Point.X, Y:option.Point.Y }};
10173
+ if (this.IsLockCorssCursor())
10174
+ {
10175
+ if (pointInfo.ClientPos<=0) pointInfo.ClientPos=1;
10176
+ }
10177
+ }
10178
+
10138
10179
  item.PointInfo=pointInfo;
10139
10180
 
10140
10181
  item.Draw(moveonPoint, this.LastMouseStatus);
@@ -60024,6 +60065,9 @@ function DynamicMinuteTitlePainting()
60024
60065
  isShowLastData=true;
60025
60066
  }
60026
60067
 
60068
+ //十字光标锁定状态 禁用显示最后一个数据
60069
+ if (this.GlobalOption && this.GlobalOption.LockCorssCursor && this.GlobalOption.LockCorssCursor.X.Enable) isShowLastData=false;
60070
+
60027
60071
  var isLastOne=false;
60028
60072
  if (isShowLastData)
60029
60073
  {
@@ -60582,6 +60626,9 @@ function DynamicChartTitlePainting()
60582
60626
  isShowLastData=true;
60583
60627
  }
60584
60628
 
60629
+ //十字光标锁定状态 禁用显示最后一个数据
60630
+ if (this.GlobalOption && this.GlobalOption.LockCorssCursor && this.GlobalOption.LockCorssCursor.X.Enable) isShowLastData=false;
60631
+
60585
60632
  return isShowLastData;
60586
60633
  }
60587
60634
 
@@ -80865,6 +80912,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
80865
80912
  this.Frame.ClearUpDonwFrameYData();
80866
80913
  this.ClearCustomKLine();
80867
80914
  this.ClearKLineCaluate();
80915
+ this.UnlockCorssCursor();
80868
80916
 
80869
80917
 
80870
80918
  var kLineDrawType=this.GetKLineDrawType();
@@ -80902,6 +80950,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
80902
80950
  this.ResetOverlaySymbolStatus();
80903
80951
  this.ClearIndexRunCount();
80904
80952
  this.Frame.ClearYCoordinateMaxMin();
80953
+ this.UnlockCorssCursor();
80905
80954
  this.RequestHistoryData(); //请求日线数据
80906
80955
  //this.ReqeustKLineInfoData();
80907
80956
  }
@@ -80913,6 +80962,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
80913
80962
  this.ResetOverlaySymbolStatus();
80914
80963
  this.ClearIndexRunCount();
80915
80964
  this.Frame.ClearYCoordinateMaxMin();
80965
+ this.UnlockCorssCursor();
80916
80966
  this.RequestHistoryMinuteData(); //请求分钟数据
80917
80967
  }
80918
80968
  else if (ChartData.IsTickPeriod(this.Period))
@@ -80922,6 +80972,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
80922
80972
  this.ResetScrollBar();
80923
80973
  this.ClearIndexRunCount();
80924
80974
  this.Frame.ClearYCoordinateMaxMin();
80975
+ this.UnlockCorssCursor();
80925
80976
  this.RequestTickData(); //请求分笔数据
80926
80977
  }
80927
80978
  }
@@ -80972,6 +81023,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
80972
81023
  this.ResetOverlaySymbolStatus();
80973
81024
  this.ResetScrollBar();
80974
81025
  this.Frame.ClearYCoordinateMaxMin();
81026
+ this.UnlockCorssCursor();
80975
81027
  this.RequestHistoryData(); //请求日线数据
80976
81028
  }
80977
81029
  else if (ChartData.IsMinutePeriod(this.Period,true) || ChartData.IsSecondPeriod(this.Period) || ChartData.IsMilliSecondPeriod(this.Period))
@@ -80982,6 +81034,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
80982
81034
  this.ResetOverlaySymbolStatus();
80983
81035
  this.ResetScrollBar();
80984
81036
  this.Frame.ClearYCoordinateMaxMin();
81037
+ this.UnlockCorssCursor();
80985
81038
  this.RequestHistoryMinuteData(); //请求分钟数据
80986
81039
  }
80987
81040
  }
@@ -82326,6 +82379,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
82326
82379
  this.HideTooltip();
82327
82380
  this.ResetScrollBar();
82328
82381
  this.ClearIndexRunCount();
82382
+ this.UnlockCorssCursor();
82329
82383
  this.Frame.ClearYCoordinateMaxMin();
82330
82384
 
82331
82385
 
@@ -85085,6 +85139,40 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
85085
85139
 
85086
85140
  return data;
85087
85141
  }
85142
+
85143
+ //十字光标解锁
85144
+ this.UnlockCorssCursor=function()
85145
+ {
85146
+ var xItem=this.GlobalOption.LockCorssCursor.X;
85147
+ xItem.Enable=false;
85148
+ xItem.KLine=null;
85149
+ }
85150
+
85151
+ this.LockCorssCursor=function()
85152
+ {
85153
+ var xItem=this.GlobalOption.LockCorssCursor.X;
85154
+ xItem.KLine={ DataIndex:null, Date:null, Time:null };
85155
+ xItem.Enable=true;
85156
+ }
85157
+
85158
+ this.GetCorssCursorPosition=function()
85159
+ {
85160
+ var position=
85161
+ {
85162
+ LastPoint:{ X:this.LastPoint.X, Y:this.LastPoint.Y },
85163
+ CursorIndex:this.CursorIndex,
85164
+ };
85165
+
85166
+ if (!this.GlobalOption || !this.GlobalOption.LockCorssCursor) return position;
85167
+
85168
+ var xItem=this.GlobalOption.LockCorssCursor.X;
85169
+ if (xItem.Enable && xItem.KLine)
85170
+ {
85171
+ position.CursorIndex=xItem.KLine.CursorIndex;
85172
+ }
85173
+
85174
+ return position;
85175
+ }
85088
85176
  }
85089
85177
 
85090
85178
  //API 返回数据 转化为array[]
@@ -85516,7 +85604,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
85516
85604
  this.ColorLineData; //主图价格线颜色自定义配置
85517
85605
  this.EnableSelectRect=false; //是否可以区间选择
85518
85606
 
85519
- this.CorssCursorIndex={ DayIndex:-1, DataIndex:-1, Point:{X:-1, Y:-1} ,Type:-1 };
85607
+ this.CorssCursorIndex={ DayIndex:-1, DataIndex:-1, Point:{X:-1, Y:-1} ,Type:-1 }; //Type: 单日(1=主图 2=盘前 3=盘后) 多日(10=主图 20=盘前 30=盘后)
85520
85608
  this.EnableNewIndex=false //是否使用新的索引版本
85521
85609
 
85522
85610
  this.DayOffset={ Offset:0, ShowDayCount:-1, DataOffset:0, DayCount:1, }; //Offset 日期偏移 , DataOffset数据偏移
@@ -86273,6 +86361,118 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
86273
86361
  }
86274
86362
  }
86275
86363
 
86364
+ this.LockCorssCursor=function()
86365
+ {
86366
+ var xItem=this.GlobalOption.LockCorssCursor.X;
86367
+
86368
+ if (this.EnableNewIndex)
86369
+ {
86370
+ if (this.CorssCursorIndex.Type!=1 && this.CorssCursorIndex.Type!=10) return; //目前只支持连续交易时间段
86371
+
86372
+ xItem.Minute=
86373
+ {
86374
+ DayIndex:this.CorssCursorIndex.DayIndex,
86375
+ DataIndex:this.CorssCursorIndex.DataIndex,
86376
+ Type:this.CorssCursorIndex.Type,
86377
+ CursorIndex:this.CursorIndex,
86378
+ };
86379
+ }
86380
+ else
86381
+ {
86382
+ xItem.Minute={ CursorIndex:this.CursorIndex };
86383
+ }
86384
+
86385
+ xItem.Enable=true;
86386
+ }
86387
+
86388
+ this.UnlockCorssCursor=function()
86389
+ {
86390
+ var xItem=this.GlobalOption.LockCorssCursor.X;
86391
+ xItem.Enable=false;
86392
+ xItem.Minute=null;
86393
+ }
86394
+
86395
+ this.GetCorssCursorPosition=function()
86396
+ {
86397
+ var position=
86398
+ {
86399
+ LastPoint:{ X:this.LastPoint.X, Y:this.LastPoint.Y },
86400
+ CursorIndex:this.CursorIndex,
86401
+ CorssCursorIndex:this.CorssCursorIndex,
86402
+ };
86403
+
86404
+ if (!this.GlobalOption || !this.GlobalOption.LockCorssCursor) return position;
86405
+
86406
+ var xItem=this.GlobalOption.LockCorssCursor.X;
86407
+ if (xItem.Enable && xItem.Minute)
86408
+ {
86409
+ if (this.EnableNewIndex)
86410
+ {
86411
+ var type=xItem.Minute.Type;
86412
+ position.CorssCursorIndex={ DayIndex:xItem.Minute.DayIndex, DataIndex:xItem.Minute.DataIndex, Type:type };
86413
+ position.CursorIndex=xItem.Minute.CursorIndex;
86414
+ position.LastPoint.X=this.GetXPointByCorssCursorIndex(position.CorssCursorIndex);
86415
+ }
86416
+ else
86417
+ {
86418
+ var index=xItem.Minute.CursorIndex;
86419
+ var x=this.Frame.GetXFromIndex(index,false);
86420
+ position.LastPoint.X=x;
86421
+ position.CursorIndex=xItem.Minute.CursorIndex;
86422
+ }
86423
+
86424
+ var border=this.Frame.ChartBorder.GetBorder();
86425
+ if (position.LastPoint.Y<border.Top || position.LastPoint.Y>border.Bottom) //超出图形框子, 调整为收盘价
86426
+ {
86427
+ var kData=this.GetKData();
86428
+ if (kData && IFrameSplitOperator.IsNonEmptyArray(kData.Data))
86429
+ {
86430
+ var index=parseInt(position.CursorIndex.toFixed(0));
86431
+ var item=kData.Data[index];
86432
+ if (item && IFrameSplitOperator.IsNumber(item.Close))
86433
+ {
86434
+ var y = this.Frame.SubFrame[0].Frame.GetYFromData(item.Close);
86435
+ position.LastPoint.Y=y;
86436
+ }
86437
+ }
86438
+ }
86439
+ }
86440
+
86441
+ return position;
86442
+ }
86443
+
86444
+ this.GetXPointByCorssCursorIndex=function(corssCursorIndex)
86445
+ {
86446
+ if (!corssCursorIndex) return;
86447
+
86448
+ var x=null;
86449
+ var dayIndex=corssCursorIndex.DayIndex;
86450
+ var dataIndex=corssCursorIndex.DataIndex;
86451
+ switch(corssCursorIndex.Type) //单日 1=主图 2=盘前 3=盘后 //多日 10=主图 20=盘前 30=盘后
86452
+ {
86453
+ case 1: //单日 1=主图
86454
+ case 10: //多日 10=主图
86455
+ x=this.Frame.GetXFromIndex(dataIndex)
86456
+ break;
86457
+ /*
86458
+ case 2: //单日 2=盘前
86459
+ x=this.Frame.SubFrame[0].Frame.GetLeftExtendXFromIndex(dataIndex,this.GetBeforeOpenData());
86460
+ break;
86461
+ case 20: //多日 20=盘前
86462
+ x=this.Frame.SubFrame[0].Frame.GetLeftExtendXFromIndex(dataIndex,{ Data:this.MultiDayBeforeOpenData, });
86463
+ break;
86464
+ case 3: //单日 3=盘后
86465
+ x=this.Frame.SubFrame[0].Frame.GetRightExtendXFromIndex(dataIndex,this.GetAfterCloseData());
86466
+ break;
86467
+ case 30: //多日 30=盘后
86468
+ x=this.Frame.SubFrame[0].Frame.GetRightExtendXFromIndex(dataIndex,{ Data:this.MultiDayAfterCloseData} );
86469
+ break;
86470
+ */
86471
+ }
86472
+
86473
+ return x;
86474
+ }
86475
+
86276
86476
  this.SetCorssCursorIndex=function(option)
86277
86477
  {
86278
86478
  if (!this.EnableNewIndex) return;
@@ -88166,6 +88366,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
88166
88366
  this.ReloadChartDrawPicture();
88167
88367
  this.ClearIndexRunCount();
88168
88368
  this.ClearStockCache();
88369
+ this.UnlockCorssCursor();
88169
88370
  this.Frame.ClearYCoordinateMaxMin();
88170
88371
 
88171
88372
  if (option)
@@ -88301,6 +88502,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
88301
88502
  this.AutoUpdateEvent(false, "MinuteChartContainer::ChangeDayCount");
88302
88503
  this.DayCount=count;
88303
88504
  this.ClearMinuteData();
88505
+ this.UnlockCorssCursor();
88304
88506
 
88305
88507
  if (option && option.PageInfo)
88306
88508
  {
@@ -141106,7 +141308,7 @@ function ScrollBarBGChart()
141106
141308
 
141107
141309
 
141108
141310
 
141109
- var HQCHART_VERSION="1.1.14285";
141311
+ var HQCHART_VERSION="1.1.14290";
141110
141312
 
141111
141313
  function PrintHQChartVersion()
141112
141314
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.14285";
8
+ var HQCHART_VERSION="1.1.14290";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {