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.
@@ -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
 
@@ -10030,6 +10036,25 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
10030
10036
  }
10031
10037
  }
10032
10038
 
10039
+ //十字光标坐标
10040
+ this.GetCorssCursorPosition=function()
10041
+ {
10042
+ var position=
10043
+ {
10044
+ LastPoint:{ X:this.LastPoint.X, Y:this.LastPoint.Y },
10045
+ CursorIndex:this.CursorIndex,
10046
+ };
10047
+
10048
+ return position;
10049
+ }
10050
+
10051
+ this.IsLockCorssCursor=function()
10052
+ {
10053
+ if (!this.GlobalOption || !this.GlobalOption.LockCorssCursor) return false;
10054
+
10055
+ return this.GlobalOption.LockCorssCursor.X.Enable;
10056
+ }
10057
+
10033
10058
  //画动态信息
10034
10059
  this.DrawDynamicInfo=function(option)
10035
10060
  {
@@ -10107,13 +10132,14 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
10107
10132
 
10108
10133
  this.DrawDrawPictureXYCoordinate();
10109
10134
  var bDrawDialogTooltip=false;
10135
+ var corssCursorPos=this.GetCorssCursorPosition(); //十字光标的位置
10110
10136
  if (this.ChartCorssCursor)
10111
10137
  {
10112
- this.ChartCorssCursor.LastPoint=this.LastPoint;
10113
- this.ChartCorssCursor.CursorIndex=this.CursorIndex;
10138
+ this.ChartCorssCursor.LastPoint=corssCursorPos.LastPoint;
10139
+ this.ChartCorssCursor.CursorIndex=corssCursorPos.CursorIndex;
10114
10140
  if (this.EnableNewIndex)
10115
10141
  {
10116
- this.ChartCorssCursor.CorssCursorIndex=this.CorssCursorIndex;
10142
+ this.ChartCorssCursor.CorssCursorIndex=corssCursorPos.CorssCursorIndex;
10117
10143
  this.ChartCorssCursor.EnableNewIndex=this.EnableNewIndex;
10118
10144
  }
10119
10145
 
@@ -10167,7 +10193,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
10167
10193
  var item=this.TitlePaint[i];
10168
10194
  if (!item.IsDynamic) continue;
10169
10195
 
10170
- item.CursorIndex=this.CursorIndex;
10196
+ item.CursorIndex=corssCursorPos.CursorIndex;
10171
10197
  item.LastPoint=this.LastPoint;
10172
10198
  if (item.OnDrawEvent)
10173
10199
  {
@@ -10178,7 +10204,16 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
10178
10204
 
10179
10205
  var pointInfo=null;
10180
10206
  if (option && IFrameSplitOperator.IsNumber(option.ClientPos) && option.Point) //当前鼠标所在位置的详细信息 包含盘前盘后
10207
+ {
10181
10208
  pointInfo={ ClientPos:option.ClientPos, Point:{ X:option.Point.X, Y:option.Point.Y }};
10209
+ /*
10210
+ if (this.IsLockCorssCursor())
10211
+ {
10212
+ if (pointInfo.ClientPos<=0) pointInfo.ClientPos=1;
10213
+ }
10214
+ */
10215
+ }
10216
+
10182
10217
  item.PointInfo=pointInfo;
10183
10218
 
10184
10219
  item.Draw(moveonPoint, this.LastMouseStatus);
@@ -35646,7 +35681,7 @@ function ChartSimpleTable()
35646
35681
  var colItem=this.AryColumnCache[i];
35647
35682
 
35648
35683
  var rtBG={Left:x, Top:rtRow.Top, Bottom:rtRow.Bottom, Height:this.RowHeight, Width:colItem.Width };
35649
- rtBG.Right=rtBG.Top+rtBG.Height;
35684
+ rtBG.Right=rtBG.Left+rtBG.Width;
35650
35685
 
35651
35686
  if (item)
35652
35687
  {
@@ -60068,6 +60103,9 @@ function DynamicMinuteTitlePainting()
60068
60103
  isShowLastData=true;
60069
60104
  }
60070
60105
 
60106
+ //十字光标锁定状态 禁用显示最后一个数据
60107
+ if (this.GlobalOption && this.GlobalOption.LockCorssCursor && this.GlobalOption.LockCorssCursor.X.Enable) isShowLastData=false;
60108
+
60071
60109
  var isLastOne=false;
60072
60110
  if (isShowLastData)
60073
60111
  {
@@ -80909,6 +80947,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
80909
80947
  this.Frame.ClearUpDonwFrameYData();
80910
80948
  this.ClearCustomKLine();
80911
80949
  this.ClearKLineCaluate();
80950
+ this.UnlockCorssCursor();
80912
80951
 
80913
80952
 
80914
80953
  var kLineDrawType=this.GetKLineDrawType();
@@ -80946,6 +80985,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
80946
80985
  this.ResetOverlaySymbolStatus();
80947
80986
  this.ClearIndexRunCount();
80948
80987
  this.Frame.ClearYCoordinateMaxMin();
80988
+ this.UnlockCorssCursor();
80949
80989
  this.RequestHistoryData(); //请求日线数据
80950
80990
  //this.ReqeustKLineInfoData();
80951
80991
  }
@@ -80957,6 +80997,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
80957
80997
  this.ResetOverlaySymbolStatus();
80958
80998
  this.ClearIndexRunCount();
80959
80999
  this.Frame.ClearYCoordinateMaxMin();
81000
+ this.UnlockCorssCursor();
80960
81001
  this.RequestHistoryMinuteData(); //请求分钟数据
80961
81002
  }
80962
81003
  else if (ChartData.IsTickPeriod(this.Period))
@@ -80966,6 +81007,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
80966
81007
  this.ResetScrollBar();
80967
81008
  this.ClearIndexRunCount();
80968
81009
  this.Frame.ClearYCoordinateMaxMin();
81010
+ this.UnlockCorssCursor();
80969
81011
  this.RequestTickData(); //请求分笔数据
80970
81012
  }
80971
81013
  }
@@ -81006,6 +81048,8 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
81006
81048
  }
81007
81049
  else //API周期数据 重新请求数据
81008
81050
  {
81051
+
81052
+
81009
81053
  if (ChartData.IsDayPeriod(this.Period,true))
81010
81054
  {
81011
81055
  this.CancelAutoUpdate(); //先停止定时器
@@ -81013,6 +81057,8 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
81013
81057
  this.ClearIndexPaint();
81014
81058
  this.ResetOverlaySymbolStatus();
81015
81059
  this.ResetScrollBar();
81060
+ this.Frame.ClearYCoordinateMaxMin();
81061
+ this.UnlockCorssCursor();
81016
81062
  this.RequestHistoryData(); //请求日线数据
81017
81063
  }
81018
81064
  else if (ChartData.IsMinutePeriod(this.Period,true) || ChartData.IsSecondPeriod(this.Period) || ChartData.IsMilliSecondPeriod(this.Period))
@@ -81022,6 +81068,8 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
81022
81068
  this.ClearIndexPaint();
81023
81069
  this.ResetOverlaySymbolStatus();
81024
81070
  this.ResetScrollBar();
81071
+ this.Frame.ClearYCoordinateMaxMin();
81072
+ this.UnlockCorssCursor();
81025
81073
  this.RequestHistoryMinuteData(); //请求分钟数据
81026
81074
  }
81027
81075
  }
@@ -82366,6 +82414,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
82366
82414
  this.HideTooltip();
82367
82415
  this.ResetScrollBar();
82368
82416
  this.ClearIndexRunCount();
82417
+ this.UnlockCorssCursor();
82369
82418
  this.Frame.ClearYCoordinateMaxMin();
82370
82419
 
82371
82420
 
@@ -85125,6 +85174,40 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
85125
85174
 
85126
85175
  return data;
85127
85176
  }
85177
+
85178
+ //十字光标解锁
85179
+ this.UnlockCorssCursor=function()
85180
+ {
85181
+ var xItem=this.GlobalOption.LockCorssCursor.X;
85182
+ xItem.Enable=false;
85183
+ xItem.KLine=null;
85184
+ }
85185
+
85186
+ this.LockCorssCursor=function()
85187
+ {
85188
+ var xItem=this.GlobalOption.LockCorssCursor.X;
85189
+ xItem.KLine={ DataIndex:null, Date:null, Time:null };
85190
+ xItem.Enable=true;
85191
+ }
85192
+
85193
+ this.GetCorssCursorPosition=function()
85194
+ {
85195
+ var position=
85196
+ {
85197
+ LastPoint:{ X:this.LastPoint.X, Y:this.LastPoint.Y },
85198
+ CursorIndex:this.CursorIndex,
85199
+ };
85200
+
85201
+ if (!this.GlobalOption || !this.GlobalOption.LockCorssCursor) return position;
85202
+
85203
+ var xItem=this.GlobalOption.LockCorssCursor.X;
85204
+ if (xItem.Enable && xItem.KLine)
85205
+ {
85206
+ position.CursorIndex=xItem.KLine.CursorIndex;
85207
+ }
85208
+
85209
+ return position;
85210
+ }
85128
85211
  }
85129
85212
 
85130
85213
  //API 返回数据 转化为array[]
@@ -85556,7 +85639,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
85556
85639
  this.ColorLineData; //主图价格线颜色自定义配置
85557
85640
  this.EnableSelectRect=false; //是否可以区间选择
85558
85641
 
85559
- this.CorssCursorIndex={ DayIndex:-1, DataIndex:-1, Point:{X:-1, Y:-1} ,Type:-1 };
85642
+ this.CorssCursorIndex={ DayIndex:-1, DataIndex:-1, Point:{X:-1, Y:-1} ,Type:-1 }; //Type: 单日(1=主图 2=盘前 3=盘后) 多日(10=主图 20=盘前 30=盘后)
85560
85643
  this.EnableNewIndex=false //是否使用新的索引版本
85561
85644
 
85562
85645
  this.DayOffset={ Offset:0, ShowDayCount:-1, DataOffset:0, DayCount:1, }; //Offset 日期偏移 , DataOffset数据偏移
@@ -86313,6 +86396,118 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
86313
86396
  }
86314
86397
  }
86315
86398
 
86399
+ this.LockCorssCursor=function()
86400
+ {
86401
+ var xItem=this.GlobalOption.LockCorssCursor.X;
86402
+
86403
+ if (this.EnableNewIndex)
86404
+ {
86405
+ if (this.CorssCursorIndex.Type!=1 && this.CorssCursorIndex.Type!=10) return; //目前只支持连续交易时间段
86406
+
86407
+ xItem.Minute=
86408
+ {
86409
+ DayIndex:this.CorssCursorIndex.DayIndex,
86410
+ DataIndex:this.CorssCursorIndex.DataIndex,
86411
+ Type:this.CorssCursorIndex.Type,
86412
+ CursorIndex:this.CursorIndex,
86413
+ };
86414
+ }
86415
+ else
86416
+ {
86417
+ xItem.Minute={ CursorIndex:this.CursorIndex };
86418
+ }
86419
+
86420
+ xItem.Enable=true;
86421
+ }
86422
+
86423
+ this.UnlockCorssCursor=function()
86424
+ {
86425
+ var xItem=this.GlobalOption.LockCorssCursor.X;
86426
+ xItem.Enable=false;
86427
+ xItem.Minute=null;
86428
+ }
86429
+
86430
+ this.GetCorssCursorPosition=function()
86431
+ {
86432
+ var position=
86433
+ {
86434
+ LastPoint:{ X:this.LastPoint.X, Y:this.LastPoint.Y },
86435
+ CursorIndex:this.CursorIndex,
86436
+ CorssCursorIndex:this.CorssCursorIndex,
86437
+ };
86438
+
86439
+ if (!this.GlobalOption || !this.GlobalOption.LockCorssCursor) return position;
86440
+
86441
+ var xItem=this.GlobalOption.LockCorssCursor.X;
86442
+ if (xItem.Enable && xItem.Minute)
86443
+ {
86444
+ if (this.EnableNewIndex)
86445
+ {
86446
+ var type=xItem.Minute.Type;
86447
+ position.CorssCursorIndex={ DayIndex:xItem.Minute.DayIndex, DataIndex:xItem.Minute.DataIndex, Type:type };
86448
+ position.CursorIndex=xItem.Minute.CursorIndex;
86449
+ position.LastPoint.X=this.GetXPointByCorssCursorIndex(position.CorssCursorIndex);
86450
+ }
86451
+ else
86452
+ {
86453
+ var index=xItem.Minute.CursorIndex;
86454
+ var x=this.Frame.GetXFromIndex(index,false);
86455
+ position.LastPoint.X=x;
86456
+ position.CursorIndex=xItem.Minute.CursorIndex;
86457
+ }
86458
+
86459
+ var border=this.Frame.ChartBorder.GetBorder();
86460
+ if (position.LastPoint.Y<border.Top || position.LastPoint.Y>border.Bottom) //超出图形框子, 调整为收盘价
86461
+ {
86462
+ var kData=this.GetKData();
86463
+ if (kData && IFrameSplitOperator.IsNonEmptyArray(kData.Data))
86464
+ {
86465
+ var index=parseInt(position.CursorIndex.toFixed(0));
86466
+ var item=kData.Data[index];
86467
+ if (item && IFrameSplitOperator.IsNumber(item.Close))
86468
+ {
86469
+ var y = this.Frame.SubFrame[0].Frame.GetYFromData(item.Close);
86470
+ position.LastPoint.Y=y;
86471
+ }
86472
+ }
86473
+ }
86474
+ }
86475
+
86476
+ return position;
86477
+ }
86478
+
86479
+ this.GetXPointByCorssCursorIndex=function(corssCursorIndex)
86480
+ {
86481
+ if (!corssCursorIndex) return;
86482
+
86483
+ var x=null;
86484
+ var dayIndex=corssCursorIndex.DayIndex;
86485
+ var dataIndex=corssCursorIndex.DataIndex;
86486
+ switch(corssCursorIndex.Type) //单日 1=主图 2=盘前 3=盘后 //多日 10=主图 20=盘前 30=盘后
86487
+ {
86488
+ case 1: //单日 1=主图
86489
+ case 10: //多日 10=主图
86490
+ x=this.Frame.GetXFromIndex(dataIndex)
86491
+ break;
86492
+ /*
86493
+ case 2: //单日 2=盘前
86494
+ x=this.Frame.SubFrame[0].Frame.GetLeftExtendXFromIndex(dataIndex,this.GetBeforeOpenData());
86495
+ break;
86496
+ case 20: //多日 20=盘前
86497
+ x=this.Frame.SubFrame[0].Frame.GetLeftExtendXFromIndex(dataIndex,{ Data:this.MultiDayBeforeOpenData, });
86498
+ break;
86499
+ case 3: //单日 3=盘后
86500
+ x=this.Frame.SubFrame[0].Frame.GetRightExtendXFromIndex(dataIndex,this.GetAfterCloseData());
86501
+ break;
86502
+ case 30: //多日 30=盘后
86503
+ x=this.Frame.SubFrame[0].Frame.GetRightExtendXFromIndex(dataIndex,{ Data:this.MultiDayAfterCloseData} );
86504
+ break;
86505
+ */
86506
+ }
86507
+
86508
+ return x;
86509
+ }
86510
+
86316
86511
  this.SetCorssCursorIndex=function(option)
86317
86512
  {
86318
86513
  if (!this.EnableNewIndex) return;
@@ -88206,6 +88401,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
88206
88401
  this.ReloadChartDrawPicture();
88207
88402
  this.ClearIndexRunCount();
88208
88403
  this.ClearStockCache();
88404
+ this.UnlockCorssCursor();
88209
88405
  this.Frame.ClearYCoordinateMaxMin();
88210
88406
 
88211
88407
  if (option)
@@ -88341,6 +88537,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
88341
88537
  this.AutoUpdateEvent(false, "MinuteChartContainer::ChangeDayCount");
88342
88538
  this.DayCount=count;
88343
88539
  this.ClearMinuteData();
88540
+ this.UnlockCorssCursor();
88344
88541
 
88345
88542
  if (option && option.PageInfo)
88346
88543
  {
@@ -111580,6 +111777,45 @@ function JSDraw(errorHandler,symbolData)
111580
111777
 
111581
111778
  return result;
111582
111779
  }
111780
+
111781
+ //表格
111782
+ this.TABLE_CELL=function(text, color, textAlign)
111783
+ {
111784
+ var cellItem={ Text:text };
111785
+ if (color) cellItem.Color=color;
111786
+ if (IFrameSplitOperator.IsString(textAlign))
111787
+ {
111788
+ var strValue=textAlign.toLowerCase(); //转小写
111789
+ cellItem.TextAlign=strValue;
111790
+ }
111791
+
111792
+ return cellItem;
111793
+ }
111794
+
111795
+ this.TABLE_ROW=function(aryData)
111796
+ {
111797
+ var aryCell=[];
111798
+ for(var i=0;i<aryData.length;++i)
111799
+ {
111800
+ var item=aryData[i];
111801
+ aryCell.push(item)
111802
+ }
111803
+
111804
+ return aryCell;
111805
+ }
111806
+
111807
+ this.DRAWTABLE=function(aryData)
111808
+ {
111809
+ var tableData=[]
111810
+ for(var i=0;i<aryData.length;++i)
111811
+ {
111812
+ var item=aryData[i];
111813
+ tableData.push({ AryCell:item });
111814
+ }
111815
+
111816
+
111817
+ return result={ DrawData:{ TableData:tableData }, DrawType:'DRAW_SIMPLE_TABLE' };
111818
+ }
111583
111819
  }
111584
111820
 
111585
111821
 
@@ -111634,7 +111870,7 @@ JSDraw.prototype.IsDrawFunction=function(name)
111634
111870
  'DRAWOVERLAYLINE',"FILLRGN", "FILLRGN2","FILLTOPRGN", "FILLBOTTOMRGN", "FILLVERTICALRGN","FLOATRGN","DRAWSL", "DRAWGBK2","DRAWGBK_DIV",
111635
111871
  "VERTLINE","HORLINE","TIPICON",
111636
111872
  "BUY","SELL","SELLSHORT","BUYSHORT",
111637
- "DRAWLASTBARICON","DRAWLASTBARNUMBER", "DRAWLASTBARTEXT",
111873
+ "DRAWLASTBARICON","DRAWLASTBARNUMBER", "DRAWLASTBARTEXT","DRAWTABLE",
111638
111874
  ]);
111639
111875
  if (setFunctionName.has(name)) return true;
111640
111876
 
@@ -118504,6 +118740,18 @@ function JSExecute(ast,option)
118504
118740
  node.Out=node.Draw.DrawData.Data;
118505
118741
  break;
118506
118742
 
118743
+ //表格函数
118744
+ case "TABLE_CELL":
118745
+ node.Out=this.Draw.TABLE_CELL(args[0],args[1],args[2]);
118746
+ break;
118747
+ case "TABLE_ROW":
118748
+ node.Out=this.Draw.TABLE_ROW(args);
118749
+ break;
118750
+ case "DRAWTABLE":
118751
+ node.Draw=this.Draw.DRAWTABLE(args);
118752
+ node.Out=[];
118753
+ break;
118754
+
118507
118755
  default:
118508
118756
  node.Out=this.Algorithm.CallFunction(funcName, args, node, this.SymbolData);
118509
118757
  break;
@@ -150699,7 +150947,7 @@ function HQChartScriptWorker()
150699
150947
 
150700
150948
 
150701
150949
 
150702
- var HQCHART_VERSION="1.1.14282";
150950
+ var HQCHART_VERSION="1.1.14288";
150703
150951
 
150704
150952
  function PrintHQChartVersion()
150705
150953
  {