hqchart 1.1.14286 → 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.
@@ -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
 
@@ -9986,6 +9992,25 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9986
9992
  }
9987
9993
  }
9988
9994
 
9995
+ //十字光标坐标
9996
+ this.GetCorssCursorPosition=function()
9997
+ {
9998
+ var position=
9999
+ {
10000
+ LastPoint:{ X:this.LastPoint.X, Y:this.LastPoint.Y },
10001
+ CursorIndex:this.CursorIndex,
10002
+ };
10003
+
10004
+ return position;
10005
+ }
10006
+
10007
+ this.IsLockCorssCursor=function()
10008
+ {
10009
+ if (!this.GlobalOption || !this.GlobalOption.LockCorssCursor) return false;
10010
+
10011
+ return this.GlobalOption.LockCorssCursor.X.Enable;
10012
+ }
10013
+
9989
10014
  //画动态信息
9990
10015
  this.DrawDynamicInfo=function(option)
9991
10016
  {
@@ -10063,13 +10088,14 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
10063
10088
 
10064
10089
  this.DrawDrawPictureXYCoordinate();
10065
10090
  var bDrawDialogTooltip=false;
10091
+ var corssCursorPos=this.GetCorssCursorPosition(); //十字光标的位置
10066
10092
  if (this.ChartCorssCursor)
10067
10093
  {
10068
- this.ChartCorssCursor.LastPoint=this.LastPoint;
10069
- this.ChartCorssCursor.CursorIndex=this.CursorIndex;
10094
+ this.ChartCorssCursor.LastPoint=corssCursorPos.LastPoint;
10095
+ this.ChartCorssCursor.CursorIndex=corssCursorPos.CursorIndex;
10070
10096
  if (this.EnableNewIndex)
10071
10097
  {
10072
- this.ChartCorssCursor.CorssCursorIndex=this.CorssCursorIndex;
10098
+ this.ChartCorssCursor.CorssCursorIndex=corssCursorPos.CorssCursorIndex;
10073
10099
  this.ChartCorssCursor.EnableNewIndex=this.EnableNewIndex;
10074
10100
  }
10075
10101
 
@@ -10123,7 +10149,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
10123
10149
  var item=this.TitlePaint[i];
10124
10150
  if (!item.IsDynamic) continue;
10125
10151
 
10126
- item.CursorIndex=this.CursorIndex;
10152
+ item.CursorIndex=corssCursorPos.CursorIndex;
10127
10153
  item.LastPoint=this.LastPoint;
10128
10154
  if (item.OnDrawEvent)
10129
10155
  {
@@ -10134,7 +10160,16 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
10134
10160
 
10135
10161
  var pointInfo=null;
10136
10162
  if (option && IFrameSplitOperator.IsNumber(option.ClientPos) && option.Point) //当前鼠标所在位置的详细信息 包含盘前盘后
10163
+ {
10137
10164
  pointInfo={ ClientPos:option.ClientPos, Point:{ X:option.Point.X, Y:option.Point.Y }};
10165
+ /*
10166
+ if (this.IsLockCorssCursor())
10167
+ {
10168
+ if (pointInfo.ClientPos<=0) pointInfo.ClientPos=1;
10169
+ }
10170
+ */
10171
+ }
10172
+
10138
10173
  item.PointInfo=pointInfo;
10139
10174
 
10140
10175
  item.Draw(moveonPoint, this.LastMouseStatus);
@@ -60024,6 +60059,9 @@ function DynamicMinuteTitlePainting()
60024
60059
  isShowLastData=true;
60025
60060
  }
60026
60061
 
60062
+ //十字光标锁定状态 禁用显示最后一个数据
60063
+ if (this.GlobalOption && this.GlobalOption.LockCorssCursor && this.GlobalOption.LockCorssCursor.X.Enable) isShowLastData=false;
60064
+
60027
60065
  var isLastOne=false;
60028
60066
  if (isShowLastData)
60029
60067
  {
@@ -80865,6 +80903,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
80865
80903
  this.Frame.ClearUpDonwFrameYData();
80866
80904
  this.ClearCustomKLine();
80867
80905
  this.ClearKLineCaluate();
80906
+ this.UnlockCorssCursor();
80868
80907
 
80869
80908
 
80870
80909
  var kLineDrawType=this.GetKLineDrawType();
@@ -80902,6 +80941,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
80902
80941
  this.ResetOverlaySymbolStatus();
80903
80942
  this.ClearIndexRunCount();
80904
80943
  this.Frame.ClearYCoordinateMaxMin();
80944
+ this.UnlockCorssCursor();
80905
80945
  this.RequestHistoryData(); //请求日线数据
80906
80946
  //this.ReqeustKLineInfoData();
80907
80947
  }
@@ -80913,6 +80953,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
80913
80953
  this.ResetOverlaySymbolStatus();
80914
80954
  this.ClearIndexRunCount();
80915
80955
  this.Frame.ClearYCoordinateMaxMin();
80956
+ this.UnlockCorssCursor();
80916
80957
  this.RequestHistoryMinuteData(); //请求分钟数据
80917
80958
  }
80918
80959
  else if (ChartData.IsTickPeriod(this.Period))
@@ -80922,6 +80963,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
80922
80963
  this.ResetScrollBar();
80923
80964
  this.ClearIndexRunCount();
80924
80965
  this.Frame.ClearYCoordinateMaxMin();
80966
+ this.UnlockCorssCursor();
80925
80967
  this.RequestTickData(); //请求分笔数据
80926
80968
  }
80927
80969
  }
@@ -80972,6 +81014,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
80972
81014
  this.ResetOverlaySymbolStatus();
80973
81015
  this.ResetScrollBar();
80974
81016
  this.Frame.ClearYCoordinateMaxMin();
81017
+ this.UnlockCorssCursor();
80975
81018
  this.RequestHistoryData(); //请求日线数据
80976
81019
  }
80977
81020
  else if (ChartData.IsMinutePeriod(this.Period,true) || ChartData.IsSecondPeriod(this.Period) || ChartData.IsMilliSecondPeriod(this.Period))
@@ -80982,6 +81025,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
80982
81025
  this.ResetOverlaySymbolStatus();
80983
81026
  this.ResetScrollBar();
80984
81027
  this.Frame.ClearYCoordinateMaxMin();
81028
+ this.UnlockCorssCursor();
80985
81029
  this.RequestHistoryMinuteData(); //请求分钟数据
80986
81030
  }
80987
81031
  }
@@ -82326,6 +82370,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
82326
82370
  this.HideTooltip();
82327
82371
  this.ResetScrollBar();
82328
82372
  this.ClearIndexRunCount();
82373
+ this.UnlockCorssCursor();
82329
82374
  this.Frame.ClearYCoordinateMaxMin();
82330
82375
 
82331
82376
 
@@ -85085,6 +85130,40 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
85085
85130
 
85086
85131
  return data;
85087
85132
  }
85133
+
85134
+ //十字光标解锁
85135
+ this.UnlockCorssCursor=function()
85136
+ {
85137
+ var xItem=this.GlobalOption.LockCorssCursor.X;
85138
+ xItem.Enable=false;
85139
+ xItem.KLine=null;
85140
+ }
85141
+
85142
+ this.LockCorssCursor=function()
85143
+ {
85144
+ var xItem=this.GlobalOption.LockCorssCursor.X;
85145
+ xItem.KLine={ DataIndex:null, Date:null, Time:null };
85146
+ xItem.Enable=true;
85147
+ }
85148
+
85149
+ this.GetCorssCursorPosition=function()
85150
+ {
85151
+ var position=
85152
+ {
85153
+ LastPoint:{ X:this.LastPoint.X, Y:this.LastPoint.Y },
85154
+ CursorIndex:this.CursorIndex,
85155
+ };
85156
+
85157
+ if (!this.GlobalOption || !this.GlobalOption.LockCorssCursor) return position;
85158
+
85159
+ var xItem=this.GlobalOption.LockCorssCursor.X;
85160
+ if (xItem.Enable && xItem.KLine)
85161
+ {
85162
+ position.CursorIndex=xItem.KLine.CursorIndex;
85163
+ }
85164
+
85165
+ return position;
85166
+ }
85088
85167
  }
85089
85168
 
85090
85169
  //API 返回数据 转化为array[]
@@ -85516,7 +85595,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
85516
85595
  this.ColorLineData; //主图价格线颜色自定义配置
85517
85596
  this.EnableSelectRect=false; //是否可以区间选择
85518
85597
 
85519
- this.CorssCursorIndex={ DayIndex:-1, DataIndex:-1, Point:{X:-1, Y:-1} ,Type:-1 };
85598
+ this.CorssCursorIndex={ DayIndex:-1, DataIndex:-1, Point:{X:-1, Y:-1} ,Type:-1 }; //Type: 单日(1=主图 2=盘前 3=盘后) 多日(10=主图 20=盘前 30=盘后)
85520
85599
  this.EnableNewIndex=false //是否使用新的索引版本
85521
85600
 
85522
85601
  this.DayOffset={ Offset:0, ShowDayCount:-1, DataOffset:0, DayCount:1, }; //Offset 日期偏移 , DataOffset数据偏移
@@ -86273,6 +86352,118 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
86273
86352
  }
86274
86353
  }
86275
86354
 
86355
+ this.LockCorssCursor=function()
86356
+ {
86357
+ var xItem=this.GlobalOption.LockCorssCursor.X;
86358
+
86359
+ if (this.EnableNewIndex)
86360
+ {
86361
+ if (this.CorssCursorIndex.Type!=1 && this.CorssCursorIndex.Type!=10) return; //目前只支持连续交易时间段
86362
+
86363
+ xItem.Minute=
86364
+ {
86365
+ DayIndex:this.CorssCursorIndex.DayIndex,
86366
+ DataIndex:this.CorssCursorIndex.DataIndex,
86367
+ Type:this.CorssCursorIndex.Type,
86368
+ CursorIndex:this.CursorIndex,
86369
+ };
86370
+ }
86371
+ else
86372
+ {
86373
+ xItem.Minute={ CursorIndex:this.CursorIndex };
86374
+ }
86375
+
86376
+ xItem.Enable=true;
86377
+ }
86378
+
86379
+ this.UnlockCorssCursor=function()
86380
+ {
86381
+ var xItem=this.GlobalOption.LockCorssCursor.X;
86382
+ xItem.Enable=false;
86383
+ xItem.Minute=null;
86384
+ }
86385
+
86386
+ this.GetCorssCursorPosition=function()
86387
+ {
86388
+ var position=
86389
+ {
86390
+ LastPoint:{ X:this.LastPoint.X, Y:this.LastPoint.Y },
86391
+ CursorIndex:this.CursorIndex,
86392
+ CorssCursorIndex:this.CorssCursorIndex,
86393
+ };
86394
+
86395
+ if (!this.GlobalOption || !this.GlobalOption.LockCorssCursor) return position;
86396
+
86397
+ var xItem=this.GlobalOption.LockCorssCursor.X;
86398
+ if (xItem.Enable && xItem.Minute)
86399
+ {
86400
+ if (this.EnableNewIndex)
86401
+ {
86402
+ var type=xItem.Minute.Type;
86403
+ position.CorssCursorIndex={ DayIndex:xItem.Minute.DayIndex, DataIndex:xItem.Minute.DataIndex, Type:type };
86404
+ position.CursorIndex=xItem.Minute.CursorIndex;
86405
+ position.LastPoint.X=this.GetXPointByCorssCursorIndex(position.CorssCursorIndex);
86406
+ }
86407
+ else
86408
+ {
86409
+ var index=xItem.Minute.CursorIndex;
86410
+ var x=this.Frame.GetXFromIndex(index,false);
86411
+ position.LastPoint.X=x;
86412
+ position.CursorIndex=xItem.Minute.CursorIndex;
86413
+ }
86414
+
86415
+ var border=this.Frame.ChartBorder.GetBorder();
86416
+ if (position.LastPoint.Y<border.Top || position.LastPoint.Y>border.Bottom) //超出图形框子, 调整为收盘价
86417
+ {
86418
+ var kData=this.GetKData();
86419
+ if (kData && IFrameSplitOperator.IsNonEmptyArray(kData.Data))
86420
+ {
86421
+ var index=parseInt(position.CursorIndex.toFixed(0));
86422
+ var item=kData.Data[index];
86423
+ if (item && IFrameSplitOperator.IsNumber(item.Close))
86424
+ {
86425
+ var y = this.Frame.SubFrame[0].Frame.GetYFromData(item.Close);
86426
+ position.LastPoint.Y=y;
86427
+ }
86428
+ }
86429
+ }
86430
+ }
86431
+
86432
+ return position;
86433
+ }
86434
+
86435
+ this.GetXPointByCorssCursorIndex=function(corssCursorIndex)
86436
+ {
86437
+ if (!corssCursorIndex) return;
86438
+
86439
+ var x=null;
86440
+ var dayIndex=corssCursorIndex.DayIndex;
86441
+ var dataIndex=corssCursorIndex.DataIndex;
86442
+ switch(corssCursorIndex.Type) //单日 1=主图 2=盘前 3=盘后 //多日 10=主图 20=盘前 30=盘后
86443
+ {
86444
+ case 1: //单日 1=主图
86445
+ case 10: //多日 10=主图
86446
+ x=this.Frame.GetXFromIndex(dataIndex)
86447
+ break;
86448
+ /*
86449
+ case 2: //单日 2=盘前
86450
+ x=this.Frame.SubFrame[0].Frame.GetLeftExtendXFromIndex(dataIndex,this.GetBeforeOpenData());
86451
+ break;
86452
+ case 20: //多日 20=盘前
86453
+ x=this.Frame.SubFrame[0].Frame.GetLeftExtendXFromIndex(dataIndex,{ Data:this.MultiDayBeforeOpenData, });
86454
+ break;
86455
+ case 3: //单日 3=盘后
86456
+ x=this.Frame.SubFrame[0].Frame.GetRightExtendXFromIndex(dataIndex,this.GetAfterCloseData());
86457
+ break;
86458
+ case 30: //多日 30=盘后
86459
+ x=this.Frame.SubFrame[0].Frame.GetRightExtendXFromIndex(dataIndex,{ Data:this.MultiDayAfterCloseData} );
86460
+ break;
86461
+ */
86462
+ }
86463
+
86464
+ return x;
86465
+ }
86466
+
86276
86467
  this.SetCorssCursorIndex=function(option)
86277
86468
  {
86278
86469
  if (!this.EnableNewIndex) return;
@@ -88166,6 +88357,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
88166
88357
  this.ReloadChartDrawPicture();
88167
88358
  this.ClearIndexRunCount();
88168
88359
  this.ClearStockCache();
88360
+ this.UnlockCorssCursor();
88169
88361
  this.Frame.ClearYCoordinateMaxMin();
88170
88362
 
88171
88363
  if (option)
@@ -88301,6 +88493,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
88301
88493
  this.AutoUpdateEvent(false, "MinuteChartContainer::ChangeDayCount");
88302
88494
  this.DayCount=count;
88303
88495
  this.ClearMinuteData();
88496
+ this.UnlockCorssCursor();
88304
88497
 
88305
88498
  if (option && option.PageInfo)
88306
88499
  {
@@ -141106,7 +141299,7 @@ function ScrollBarBGChart()
141106
141299
 
141107
141300
 
141108
141301
 
141109
- var HQCHART_VERSION="1.1.14285";
141302
+ var HQCHART_VERSION="1.1.14288";
141110
141303
 
141111
141304
  function PrintHQChartVersion()
141112
141305
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.14285";
8
+ var HQCHART_VERSION="1.1.14288";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {