hqchart 1.1.14291 → 1.1.14299

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.
@@ -35686,6 +35686,127 @@ function ChartSimpleTable()
35686
35686
  }
35687
35687
  }
35688
35688
 
35689
+
35690
+ //饼图
35691
+ function ChartPie()
35692
+ {
35693
+ this.newMethod=IChartPainting; //派生
35694
+ this.newMethod();
35695
+ delete this.newMethod;
35696
+
35697
+ this.Radius = 100; //半径默认值
35698
+ this.Width=40;
35699
+ this.Height=50;
35700
+
35701
+ //this.Distance = 30; //指示线超出圆饼的距离
35702
+ //this.txtLine = 20; // 文本下划线
35703
+ //this.paddingX = 20 / 3;// 设置文本的移动
35704
+
35705
+
35706
+
35707
+ this.RectClient={ };
35708
+
35709
+ this.Draw=function()
35710
+ {
35711
+ if (!this.Data || !this.Data.Data || !(this.Data.Data.length>0)) return this.DrawEmptyData();
35712
+
35713
+
35714
+
35715
+ let left=this.ChartBorder.GetLeft();
35716
+ let right=this.ChartBorder.GetRight();
35717
+ let top=this.ChartBorder.GetTop();
35718
+ let bottom=this.ChartBorder.GetBottom();
35719
+ let width=this.ChartBorder.GetWidth();
35720
+ let height=this.ChartBorder.GetHeight();
35721
+
35722
+ if(isNaN(this.Radius)){
35723
+ let str = this.Radius.replace("%","");
35724
+ str = str/100;
35725
+ if(width >= height){
35726
+ this.Radius = str*height;
35727
+ }
35728
+ if(width < height) this.Radius = str*width;
35729
+ }
35730
+
35731
+
35732
+ this.Canvas.save();
35733
+ this.Canvas.translate(width/2,height/2);
35734
+
35735
+ let totalValue=0; //求和
35736
+ for(let i in this.Data.Data)
35737
+ {
35738
+ totalValue += this.Data.Data[i].Value;
35739
+ }
35740
+ let start = 0;
35741
+ let end = 0;
35742
+ //画饼图
35743
+ for(let i in this.Data.Data)
35744
+ {
35745
+ let item =this.Data.Data[i];
35746
+ let rate=(item.Value/totalValue).toFixed(2); //占比
35747
+ //JSConsole.Chart.Log('[ChartPie::Draw]', i, rate, item);
35748
+
35749
+ // 绘制扇形
35750
+ this.Canvas.beginPath();
35751
+ this.Canvas.moveTo(0,0);
35752
+
35753
+ end += rate*2*Math.PI;//终止角度
35754
+ this.Canvas.strokeStyle = "white";
35755
+ this.Canvas.fillStyle = item.Color;
35756
+ this.Canvas.arc(0,0,this.Radius,start,end);
35757
+ this.Canvas.fill();
35758
+ this.Canvas.closePath();
35759
+ this.Canvas.stroke();
35760
+
35761
+ // 绘制直线
35762
+ this.Canvas.beginPath();
35763
+ this.Canvas.strokeStyle = item.Color;
35764
+ this.Canvas.moveTo(0,0);
35765
+ let x = (this.Radius + this.Distance)*Math.cos(end- (end-start)/2);
35766
+ let y = (this.Radius + this.Distance)*Math.sin(end - (end-start)/2);
35767
+ this.Canvas.lineTo(x,y);
35768
+ // JSConsole.Chart.Log(x,y,"xy")
35769
+
35770
+ // 绘制横线
35771
+ let txtLine = this.txtLine;
35772
+ let paddingX = this.paddingX;
35773
+ this.Canvas.textAlign = 'left';
35774
+ if( end - (end-start)/2 < 1.5*Math.PI && end - (end-start)/2 > 0.5*Math.PI ){
35775
+
35776
+ txtLine = - this.txtLine;
35777
+ paddingX = - this.paddingX;
35778
+ this.Canvas.textAlign = 'right';
35779
+ }
35780
+ this.Canvas.lineTo( x + txtLine, y );
35781
+ this.Canvas.stroke();
35782
+
35783
+ // 写文字
35784
+ if(item.Text){
35785
+ this.Canvas.fillText( item.Text, x + txtLine + paddingX, y );
35786
+ }else{
35787
+ let text = `${item.Name}:${item.Value}`;
35788
+ this.Canvas.fillText( text, x + txtLine + paddingX, y );
35789
+ }
35790
+
35791
+
35792
+ start += rate*2*Math.PI;//起始角度
35793
+ }
35794
+
35795
+ this.Canvas.restore();
35796
+ }
35797
+
35798
+ //空数据
35799
+ this.DrawEmptyData=function()
35800
+ {
35801
+ JSConsole.Chart.Log('[ChartPie::DrawEmptyData]')
35802
+ }
35803
+
35804
+ this.GetMaxMin=function()
35805
+ {
35806
+ return { Min:null, Max:null };
35807
+ }
35808
+ }
35809
+
35689
35810
  //分钟成交量 支持横屏
35690
35811
  function ChartMinuteVolumBar()
35691
35812
  {
@@ -85141,18 +85262,31 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
85141
85262
  }
85142
85263
 
85143
85264
  //十字光标解锁
85144
- this.UnlockCorssCursor=function()
85265
+ this.UnlockCorssCursor=function(option)
85145
85266
  {
85146
85267
  var xItem=this.GlobalOption.LockCorssCursor.X;
85147
85268
  xItem.Enable=false;
85148
85269
  xItem.KLine=null;
85270
+
85271
+ if (option && option.Draw) this.Draw();
85149
85272
  }
85150
85273
 
85151
- this.LockCorssCursor=function()
85274
+ this.LockCorssCursor=function(option)
85152
85275
  {
85276
+ if (this.CursorIndex<0) return false;
85277
+ var kData=this.GetKData();
85278
+ if (!kData || !IFrameSplitOperator.IsNonEmptyArray(kData.Data)) return false;
85279
+
85280
+ var dataIndex=kData.DataOffset+parseInt(this.CursorIndex.toFixed(0));
85281
+ var kItem=kData.Data[dataIndex];
85282
+ if (!kItem) return false;
85283
+
85153
85284
  var xItem=this.GlobalOption.LockCorssCursor.X;
85154
- xItem.KLine={ DataIndex:null, Date:null, Time:null };
85285
+ xItem.KLine={ DataIndex:dataIndex, Date:kItem.Date, Time:kItem.Time };
85155
85286
  xItem.Enable=true;
85287
+
85288
+ if (option && option.Draw) this.Draw();
85289
+ return true;
85156
85290
  }
85157
85291
 
85158
85292
  this.GetCorssCursorPosition=function()
@@ -85168,7 +85302,19 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
85168
85302
  var xItem=this.GlobalOption.LockCorssCursor.X;
85169
85303
  if (xItem.Enable && xItem.KLine)
85170
85304
  {
85171
- position.CursorIndex=xItem.KLine.CursorIndex;
85305
+ var kData=this.GetKData();
85306
+ if (!kData || !IFrameSplitOperator.IsNonEmptyArray(kData.Data)) return position;
85307
+
85308
+ position.CursorIndex=xItem.KLine.DataIndex-kData.DataOffset;
85309
+ position.LastPoint.X=this.Frame.GetXFromIndex(position.CursorIndex);
85310
+
85311
+ var border=this.Frame.ChartBorder.GetBorder();
85312
+ if (position.LastPoint.Y<border.Top || position.LastPoint.Y>border.Bottom) //超出图形框子, 调整为收盘价
85313
+ {
85314
+ var kItem=kData.Data[xItem.KLine.DataIndex];
85315
+ var y = this.Frame.SubFrame[0].Frame.GetYFromData(kItem.Close);
85316
+ position.LastPoint.Y=y;
85317
+ }
85172
85318
  }
85173
85319
 
85174
85320
  return position;
@@ -86361,13 +86507,13 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
86361
86507
  }
86362
86508
  }
86363
86509
 
86364
- this.LockCorssCursor=function()
86510
+ this.LockCorssCursor=function(option)
86365
86511
  {
86366
86512
  var xItem=this.GlobalOption.LockCorssCursor.X;
86367
86513
 
86368
86514
  if (this.EnableNewIndex)
86369
86515
  {
86370
- if (this.CorssCursorIndex.Type!=1 && this.CorssCursorIndex.Type!=10) return; //目前只支持连续交易时间段
86516
+ if (this.CorssCursorIndex.Type!=1 && this.CorssCursorIndex.Type!=10) return false; //目前只支持连续交易时间段
86371
86517
 
86372
86518
  xItem.Minute=
86373
86519
  {
@@ -86383,13 +86529,19 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
86383
86529
  }
86384
86530
 
86385
86531
  xItem.Enable=true;
86532
+
86533
+ if (option && option.Draw) this.Draw();
86534
+
86535
+ return true;
86386
86536
  }
86387
86537
 
86388
- this.UnlockCorssCursor=function()
86538
+ this.UnlockCorssCursor=function(option)
86389
86539
  {
86390
86540
  var xItem=this.GlobalOption.LockCorssCursor.X;
86391
86541
  xItem.Enable=false;
86392
86542
  xItem.Minute=null;
86543
+
86544
+ if (option && option.Draw) this.Draw();
86393
86545
  }
86394
86546
 
86395
86547
  this.GetCorssCursorPosition=function()
@@ -86428,6 +86580,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
86428
86580
  if (kData && IFrameSplitOperator.IsNonEmptyArray(kData.Data))
86429
86581
  {
86430
86582
  var index=parseInt(position.CursorIndex.toFixed(0));
86583
+ if (index>=kData.Data.length) index=kData.Data.length-1; //未开盘的时间,取最后一个数据的收盘价
86431
86584
  var item=kData.Data[index];
86432
86585
  if (item && IFrameSplitOperator.IsNumber(item.Close))
86433
86586
  {
@@ -111744,10 +111897,24 @@ function JSDraw(errorHandler,symbolData)
111744
111897
  }
111745
111898
 
111746
111899
  //表格
111747
- this.TABLE_CELL=function(text, color, textAlign)
111900
+ this.TABLE_CELL=function(data, color, textAlign, bgColor)
111748
111901
  {
111902
+ var text=null;
111903
+ if (IFrameSplitOperator.IsString(data))
111904
+ {
111905
+ text=data;
111906
+ }
111907
+ else if (IFrameSplitOperator.IsNonEmptyArray(data))
111908
+ {
111909
+ var precision=2;
111910
+ var lastValue=data[data.length-1];
111911
+ if (IFrameSplitOperator.IsNumber(lastValue)) text=lastValue.toFixed(precision);
111912
+ else if (IFrameSplitOperator.IsString(lastValue)) text=lastValue;
111913
+ }
111914
+
111749
111915
  var cellItem={ Text:text };
111750
111916
  if (color) cellItem.Color=color;
111917
+ if (bgColor) cellItem.BGColor=bgColor;
111751
111918
  if (IFrameSplitOperator.IsString(textAlign))
111752
111919
  {
111753
111920
  var strValue=textAlign.toLowerCase(); //转小写
@@ -118707,7 +118874,7 @@ function JSExecute(ast,option)
118707
118874
 
118708
118875
  //表格函数
118709
118876
  case "TABLE_CELL":
118710
- node.Out=this.Draw.TABLE_CELL(args[0],args[1],args[2]);
118877
+ node.Out=this.Draw.TABLE_CELL(args[0],args[1],args[2],args[3]);
118711
118878
  break;
118712
118879
  case "TABLE_ROW":
118713
118880
  node.Out=this.Draw.TABLE_ROW(args);
@@ -119614,6 +119781,10 @@ function JSExplainer(ast,option)
119614
119781
  ["L2_VOLNUM", { Name:"L2_VOLNUM", Param:{ Count:2 }, ToString:function(args) { return `单数分档`; } }],
119615
119782
  ["L2_VOL", { Name:"L2_VOL", Param:{ Count:2 }, ToString:function(args) { return `成交量分档`; } }],
119616
119783
  ["L2_AMO", { Name:"L2_AMO", Param:{ Count:2 }, ToString:function(args) { return `成交额分档`; } }],
119784
+
119785
+ ["TABLE_CELL", { Name:"TABLE_CELL",Param:{ Dynamic:true }, ToString:function(args) { return `创建表格单元格`; } }],
119786
+ ["TABLE_ROW", { Name:"TABLE_ROW",Param:{ Dynamic:true }, ToString:function(args) { return `创建表格行`; } }],
119787
+ ["DRAWTABLE", { Name:"DRAWTABLE",Param:{ Dynamic:true }, ToString:function(args) { return `绘制表格`; } }]
119617
119788
 
119618
119789
  ]
119619
119790
  );
@@ -141308,7 +141479,7 @@ function ScrollBarBGChart()
141308
141479
 
141309
141480
 
141310
141481
 
141311
- var HQCHART_VERSION="1.1.14290";
141482
+ var HQCHART_VERSION="1.1.14298";
141312
141483
 
141313
141484
  function PrintHQChartVersion()
141314
141485
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.14290";
8
+ var HQCHART_VERSION="1.1.14298";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {
@@ -55763,6 +55763,8 @@ HQData.Minute_RequestMinuteData=function(data, callback)
55763
55763
  }
55764
55764
  */
55765
55765
 
55766
+ stockItem.minute.length=50;
55767
+
55766
55768
  var hqchartData={code:0, stock:[stockItem] };
55767
55769
 
55768
55770
 
@@ -57388,6 +57390,8 @@ HQData.Report_APIIndex=function(data, callback)
57388
57390
  HQData.APIIndex_MULTI_SVGICON(data, callback);
57389
57391
  else if (request.Data.indexname=="API-DRAWTEXT_LINE")
57390
57392
  HQData.APIIndex_DRAWTEXT_LINE(data, callback);
57393
+ else if (request.Data.indexname=="API_DRAW_SIMPLE_TABLE")
57394
+ HQData.APIIndex_DRAW_SIMPLE_TABLE(data, callback);
57391
57395
  }
57392
57396
 
57393
57397
 
@@ -57810,6 +57814,50 @@ HQData.APIIndex_DRAWTEXT_LINE=function(data, callback)
57810
57814
  callback(apiData);
57811
57815
  }
57812
57816
 
57817
+ HQData.APIIndex_DRAW_SIMPLE_TABLE=function(data, callback)
57818
+ {
57819
+ data.PreventDefault=true;
57820
+ var hqchart=data.HQChart;
57821
+ var kData=hqchart.GetKData();
57822
+
57823
+ var tableData=
57824
+ {
57825
+ name:'DRAW_SIMPLE_TABLE', type:1,
57826
+ Draw:
57827
+ {
57828
+ DrawType:'DRAW_SIMPLE_TABLE',
57829
+ DrawData:
57830
+ {
57831
+ //BGColor:"rgba(250,250,210,0.8)",
57832
+ //BorderColor:"rgb(0,0,255)",
57833
+ //TextColor:"rgb(0,191,255)",
57834
+ TableData:
57835
+ [
57836
+ { AryCell:[{ Text:"股票代码"}, { Text:"主营业务", TextAlign:'center'}, { Text:"每股收益(元)"}] },
57837
+ { AryCell:[{ Text:"美丽生态"}, { Text:"园林绿化"}, { Text:"13.5", Color:"rgb(139,0,139)"}] },
57838
+ { AryCell:[{ Text:"深物业A"}, { Text:"房地产及相关业务", BGColor:"rgb(200,200,200)"}, { Text:"0.12"}] },
57839
+ { AryCell:[{ Text:"深科技"}, { Text:"计算机硬件、通讯设备等"}, { Text:"5.4"}] },
57840
+ ],
57841
+
57842
+ //TextFont:{ Size:16, Name:"微软雅黑"},
57843
+ //XOffset:-10,
57844
+ //YOffset:-15,
57845
+ }
57846
+ }
57847
+ };
57848
+
57849
+ var apiData=
57850
+ {
57851
+ code:0,
57852
+ stock:{ name:hqchart.Name, symbol:hqchart.Symbol },
57853
+ outdata: { date:kData.GetDate(), time:kData.GetTime() , outvar:[tableData] }
57854
+ };
57855
+
57856
+
57857
+ console.log('[HQData.APIIndex_DRAW_SIMPLE_TABLE] apiData ', apiData);
57858
+ callback(apiData);
57859
+ }
57860
+
57813
57861
 
57814
57862
 
57815
57863
 
@@ -35730,6 +35730,127 @@ function ChartSimpleTable()
35730
35730
  }
35731
35731
  }
35732
35732
 
35733
+
35734
+ //饼图
35735
+ function ChartPie()
35736
+ {
35737
+ this.newMethod=IChartPainting; //派生
35738
+ this.newMethod();
35739
+ delete this.newMethod;
35740
+
35741
+ this.Radius = 100; //半径默认值
35742
+ this.Width=40;
35743
+ this.Height=50;
35744
+
35745
+ //this.Distance = 30; //指示线超出圆饼的距离
35746
+ //this.txtLine = 20; // 文本下划线
35747
+ //this.paddingX = 20 / 3;// 设置文本的移动
35748
+
35749
+
35750
+
35751
+ this.RectClient={ };
35752
+
35753
+ this.Draw=function()
35754
+ {
35755
+ if (!this.Data || !this.Data.Data || !(this.Data.Data.length>0)) return this.DrawEmptyData();
35756
+
35757
+
35758
+
35759
+ let left=this.ChartBorder.GetLeft();
35760
+ let right=this.ChartBorder.GetRight();
35761
+ let top=this.ChartBorder.GetTop();
35762
+ let bottom=this.ChartBorder.GetBottom();
35763
+ let width=this.ChartBorder.GetWidth();
35764
+ let height=this.ChartBorder.GetHeight();
35765
+
35766
+ if(isNaN(this.Radius)){
35767
+ let str = this.Radius.replace("%","");
35768
+ str = str/100;
35769
+ if(width >= height){
35770
+ this.Radius = str*height;
35771
+ }
35772
+ if(width < height) this.Radius = str*width;
35773
+ }
35774
+
35775
+
35776
+ this.Canvas.save();
35777
+ this.Canvas.translate(width/2,height/2);
35778
+
35779
+ let totalValue=0; //求和
35780
+ for(let i in this.Data.Data)
35781
+ {
35782
+ totalValue += this.Data.Data[i].Value;
35783
+ }
35784
+ let start = 0;
35785
+ let end = 0;
35786
+ //画饼图
35787
+ for(let i in this.Data.Data)
35788
+ {
35789
+ let item =this.Data.Data[i];
35790
+ let rate=(item.Value/totalValue).toFixed(2); //占比
35791
+ //JSConsole.Chart.Log('[ChartPie::Draw]', i, rate, item);
35792
+
35793
+ // 绘制扇形
35794
+ this.Canvas.beginPath();
35795
+ this.Canvas.moveTo(0,0);
35796
+
35797
+ end += rate*2*Math.PI;//终止角度
35798
+ this.Canvas.strokeStyle = "white";
35799
+ this.Canvas.fillStyle = item.Color;
35800
+ this.Canvas.arc(0,0,this.Radius,start,end);
35801
+ this.Canvas.fill();
35802
+ this.Canvas.closePath();
35803
+ this.Canvas.stroke();
35804
+
35805
+ // 绘制直线
35806
+ this.Canvas.beginPath();
35807
+ this.Canvas.strokeStyle = item.Color;
35808
+ this.Canvas.moveTo(0,0);
35809
+ let x = (this.Radius + this.Distance)*Math.cos(end- (end-start)/2);
35810
+ let y = (this.Radius + this.Distance)*Math.sin(end - (end-start)/2);
35811
+ this.Canvas.lineTo(x,y);
35812
+ // JSConsole.Chart.Log(x,y,"xy")
35813
+
35814
+ // 绘制横线
35815
+ let txtLine = this.txtLine;
35816
+ let paddingX = this.paddingX;
35817
+ this.Canvas.textAlign = 'left';
35818
+ if( end - (end-start)/2 < 1.5*Math.PI && end - (end-start)/2 > 0.5*Math.PI ){
35819
+
35820
+ txtLine = - this.txtLine;
35821
+ paddingX = - this.paddingX;
35822
+ this.Canvas.textAlign = 'right';
35823
+ }
35824
+ this.Canvas.lineTo( x + txtLine, y );
35825
+ this.Canvas.stroke();
35826
+
35827
+ // 写文字
35828
+ if(item.Text){
35829
+ this.Canvas.fillText( item.Text, x + txtLine + paddingX, y );
35830
+ }else{
35831
+ let text = `${item.Name}:${item.Value}`;
35832
+ this.Canvas.fillText( text, x + txtLine + paddingX, y );
35833
+ }
35834
+
35835
+
35836
+ start += rate*2*Math.PI;//起始角度
35837
+ }
35838
+
35839
+ this.Canvas.restore();
35840
+ }
35841
+
35842
+ //空数据
35843
+ this.DrawEmptyData=function()
35844
+ {
35845
+ JSConsole.Chart.Log('[ChartPie::DrawEmptyData]')
35846
+ }
35847
+
35848
+ this.GetMaxMin=function()
35849
+ {
35850
+ return { Min:null, Max:null };
35851
+ }
35852
+ }
35853
+
35733
35854
  //分钟成交量 支持横屏
35734
35855
  function ChartMinuteVolumBar()
35735
35856
  {
@@ -85185,18 +85306,31 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
85185
85306
  }
85186
85307
 
85187
85308
  //十字光标解锁
85188
- this.UnlockCorssCursor=function()
85309
+ this.UnlockCorssCursor=function(option)
85189
85310
  {
85190
85311
  var xItem=this.GlobalOption.LockCorssCursor.X;
85191
85312
  xItem.Enable=false;
85192
85313
  xItem.KLine=null;
85314
+
85315
+ if (option && option.Draw) this.Draw();
85193
85316
  }
85194
85317
 
85195
- this.LockCorssCursor=function()
85318
+ this.LockCorssCursor=function(option)
85196
85319
  {
85320
+ if (this.CursorIndex<0) return false;
85321
+ var kData=this.GetKData();
85322
+ if (!kData || !IFrameSplitOperator.IsNonEmptyArray(kData.Data)) return false;
85323
+
85324
+ var dataIndex=kData.DataOffset+parseInt(this.CursorIndex.toFixed(0));
85325
+ var kItem=kData.Data[dataIndex];
85326
+ if (!kItem) return false;
85327
+
85197
85328
  var xItem=this.GlobalOption.LockCorssCursor.X;
85198
- xItem.KLine={ DataIndex:null, Date:null, Time:null };
85329
+ xItem.KLine={ DataIndex:dataIndex, Date:kItem.Date, Time:kItem.Time };
85199
85330
  xItem.Enable=true;
85331
+
85332
+ if (option && option.Draw) this.Draw();
85333
+ return true;
85200
85334
  }
85201
85335
 
85202
85336
  this.GetCorssCursorPosition=function()
@@ -85212,7 +85346,19 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
85212
85346
  var xItem=this.GlobalOption.LockCorssCursor.X;
85213
85347
  if (xItem.Enable && xItem.KLine)
85214
85348
  {
85215
- position.CursorIndex=xItem.KLine.CursorIndex;
85349
+ var kData=this.GetKData();
85350
+ if (!kData || !IFrameSplitOperator.IsNonEmptyArray(kData.Data)) return position;
85351
+
85352
+ position.CursorIndex=xItem.KLine.DataIndex-kData.DataOffset;
85353
+ position.LastPoint.X=this.Frame.GetXFromIndex(position.CursorIndex);
85354
+
85355
+ var border=this.Frame.ChartBorder.GetBorder();
85356
+ if (position.LastPoint.Y<border.Top || position.LastPoint.Y>border.Bottom) //超出图形框子, 调整为收盘价
85357
+ {
85358
+ var kItem=kData.Data[xItem.KLine.DataIndex];
85359
+ var y = this.Frame.SubFrame[0].Frame.GetYFromData(kItem.Close);
85360
+ position.LastPoint.Y=y;
85361
+ }
85216
85362
  }
85217
85363
 
85218
85364
  return position;
@@ -86405,13 +86551,13 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
86405
86551
  }
86406
86552
  }
86407
86553
 
86408
- this.LockCorssCursor=function()
86554
+ this.LockCorssCursor=function(option)
86409
86555
  {
86410
86556
  var xItem=this.GlobalOption.LockCorssCursor.X;
86411
86557
 
86412
86558
  if (this.EnableNewIndex)
86413
86559
  {
86414
- if (this.CorssCursorIndex.Type!=1 && this.CorssCursorIndex.Type!=10) return; //目前只支持连续交易时间段
86560
+ if (this.CorssCursorIndex.Type!=1 && this.CorssCursorIndex.Type!=10) return false; //目前只支持连续交易时间段
86415
86561
 
86416
86562
  xItem.Minute=
86417
86563
  {
@@ -86427,13 +86573,19 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
86427
86573
  }
86428
86574
 
86429
86575
  xItem.Enable=true;
86576
+
86577
+ if (option && option.Draw) this.Draw();
86578
+
86579
+ return true;
86430
86580
  }
86431
86581
 
86432
- this.UnlockCorssCursor=function()
86582
+ this.UnlockCorssCursor=function(option)
86433
86583
  {
86434
86584
  var xItem=this.GlobalOption.LockCorssCursor.X;
86435
86585
  xItem.Enable=false;
86436
86586
  xItem.Minute=null;
86587
+
86588
+ if (option && option.Draw) this.Draw();
86437
86589
  }
86438
86590
 
86439
86591
  this.GetCorssCursorPosition=function()
@@ -86472,6 +86624,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
86472
86624
  if (kData && IFrameSplitOperator.IsNonEmptyArray(kData.Data))
86473
86625
  {
86474
86626
  var index=parseInt(position.CursorIndex.toFixed(0));
86627
+ if (index>=kData.Data.length) index=kData.Data.length-1; //未开盘的时间,取最后一个数据的收盘价
86475
86628
  var item=kData.Data[index];
86476
86629
  if (item && IFrameSplitOperator.IsNumber(item.Close))
86477
86630
  {
@@ -111788,10 +111941,24 @@ function JSDraw(errorHandler,symbolData)
111788
111941
  }
111789
111942
 
111790
111943
  //表格
111791
- this.TABLE_CELL=function(text, color, textAlign)
111944
+ this.TABLE_CELL=function(data, color, textAlign, bgColor)
111792
111945
  {
111946
+ var text=null;
111947
+ if (IFrameSplitOperator.IsString(data))
111948
+ {
111949
+ text=data;
111950
+ }
111951
+ else if (IFrameSplitOperator.IsNonEmptyArray(data))
111952
+ {
111953
+ var precision=2;
111954
+ var lastValue=data[data.length-1];
111955
+ if (IFrameSplitOperator.IsNumber(lastValue)) text=lastValue.toFixed(precision);
111956
+ else if (IFrameSplitOperator.IsString(lastValue)) text=lastValue;
111957
+ }
111958
+
111793
111959
  var cellItem={ Text:text };
111794
111960
  if (color) cellItem.Color=color;
111961
+ if (bgColor) cellItem.BGColor=bgColor;
111795
111962
  if (IFrameSplitOperator.IsString(textAlign))
111796
111963
  {
111797
111964
  var strValue=textAlign.toLowerCase(); //转小写
@@ -118751,7 +118918,7 @@ function JSExecute(ast,option)
118751
118918
 
118752
118919
  //表格函数
118753
118920
  case "TABLE_CELL":
118754
- node.Out=this.Draw.TABLE_CELL(args[0],args[1],args[2]);
118921
+ node.Out=this.Draw.TABLE_CELL(args[0],args[1],args[2],args[3]);
118755
118922
  break;
118756
118923
  case "TABLE_ROW":
118757
118924
  node.Out=this.Draw.TABLE_ROW(args);
@@ -119658,6 +119825,10 @@ function JSExplainer(ast,option)
119658
119825
  ["L2_VOLNUM", { Name:"L2_VOLNUM", Param:{ Count:2 }, ToString:function(args) { return `单数分档`; } }],
119659
119826
  ["L2_VOL", { Name:"L2_VOL", Param:{ Count:2 }, ToString:function(args) { return `成交量分档`; } }],
119660
119827
  ["L2_AMO", { Name:"L2_AMO", Param:{ Count:2 }, ToString:function(args) { return `成交额分档`; } }],
119828
+
119829
+ ["TABLE_CELL", { Name:"TABLE_CELL",Param:{ Dynamic:true }, ToString:function(args) { return `创建表格单元格`; } }],
119830
+ ["TABLE_ROW", { Name:"TABLE_ROW",Param:{ Dynamic:true }, ToString:function(args) { return `创建表格行`; } }],
119831
+ ["DRAWTABLE", { Name:"DRAWTABLE",Param:{ Dynamic:true }, ToString:function(args) { return `绘制表格`; } }]
119661
119832
 
119662
119833
  ]
119663
119834
  );
@@ -146588,7 +146759,7 @@ function JSPopKeyboard()
146588
146759
  }
146589
146760
  }
146590
146761
 
146591
- if ((code>=48 && code<=57) || (code>=65 && code<=90) || (code>=97 && code<=122) || code==8)
146762
+ if ((code>=48 && code<=57) || (code>=65 && code<=90) || (code>=96 && code<=122) || code==8)
146592
146763
  {
146593
146764
  var strText=this.InputDOM.value;
146594
146765
  strText=strText.toUpperCase();
@@ -146686,7 +146857,7 @@ function JSPopKeyboard()
146686
146857
  var code=event.keyCode;
146687
146858
  if (code==116) return; //F5不处理
146688
146859
 
146689
- if (!this.IsShow() && (code>=48 && code<=57) || (code>=65 && code<=90) || (code>=97 && code<=122))
146860
+ if (!this.IsShow() && (code>=48 && code<=57) || (code>=65 && code<=90) || (code>=96 && code<=122))
146690
146861
  {
146691
146862
  this.Show();
146692
146863
  this.InputDOM.focus();
@@ -150956,7 +151127,7 @@ function HQChartScriptWorker()
150956
151127
 
150957
151128
 
150958
151129
 
150959
- var HQCHART_VERSION="1.1.14290";
151130
+ var HQCHART_VERSION="1.1.14298";
150960
151131
 
150961
151132
  function PrintHQChartVersion()
150962
151133
  {