hqchart 1.1.13963 → 1.1.13965

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.
@@ -55702,6 +55702,10 @@ HQData.NetworkFilter=function(data, callback)
55702
55702
  //HQChart使用教程95-报价列表对接第3方数据4-股票排序数据
55703
55703
  HQData.Report_RequestStockSortData(data, callback);
55704
55704
  break;
55705
+ case "JSDealChartContainer::RequestVirtualStockData":
55706
+ HQData.Report_RequestVirtualStockData(data, callback); //股票数据 虚拟表格
55707
+ break;
55708
+
55705
55709
  }
55706
55710
  }
55707
55711
 
@@ -56572,6 +56576,30 @@ HQData.Report_RequestStockListData=function(data, callback)
56572
56576
 
56573
56577
  }
56574
56578
 
56579
+ //空码表
56580
+ HQData.Report_RequestStockListData_Empty=function(data, callback)
56581
+ {
56582
+ data.PreventDefault=true;
56583
+ var hqchartData={ data:[] };
56584
+ console.log("[HQData.Report_RequestStockListData_EMPTY] hqchartData",hqchartData);
56585
+ callback(hqchartData);
56586
+ }
56587
+
56588
+ HQData.Report_RequestMemberVirtualListData=function(data, callback, option)
56589
+ {
56590
+ var symbol=data.Request.Data.symbol; //板块代码
56591
+ data.PreventDefault=true;
56592
+
56593
+ var hqchartData= { symbol:symbol , name:symbol, data:[] , code:0, Virtual:{ Count:option.Virtual.Count } };
56594
+
56595
+ for(var i=0; i<SHSZ_STOCK_LIST_TEST_DATA.symbol.length && i<50; ++i )
56596
+ {
56597
+ hqchartData.data.push(SHSZ_STOCK_LIST_TEST_DATA.symbol[i]);
56598
+ }
56599
+
56600
+ callback(hqchartData);
56601
+ }
56602
+
56575
56603
  //板块|行业等成分列表
56576
56604
  HQData.Report_RequestMemberListDat=function(data, callback)
56577
56605
  {
@@ -56837,6 +56865,119 @@ HQData.Report_RequestStockSortData=function(data, callback)
56837
56865
  }
56838
56866
 
56839
56867
 
56868
+ HQData.Report_RequestVirtualStockData=function(data, callback)
56869
+ {
56870
+ var blockID=data.Request.Data.symbol; //板块代码
56871
+ var range=data.Request.Data.range; //排序范围
56872
+ var column=data.Request.Data.column; //排序列信息
56873
+ var sortType=data.Request.Data.sort; //排序方向
56874
+ var pageSize=data.Request.Data.pageSize;
56875
+ data.PreventDefault=true;
56876
+
56877
+ var start=range.start;
56878
+ var end=range.end;
56879
+ if (start>0) start-=pageSize;
56880
+ if (start<0) start=0;
56881
+ end+=pageSize;
56882
+
56883
+ var count=end-start+1;
56884
+
56885
+ var aryData=[];
56886
+ var aryIndex=[];
56887
+
56888
+ if (IFrameSplitOperator.IsNonEmptyArray(SHSZ_STOCK_LIST_TEST_DATA.symbol))
56889
+ {
56890
+ var randomStart = Math.floor(Math.random()*(SHSZ_STOCK_LIST_TEST_DATA.symbol.length-1));
56891
+ var symbolCount=SHSZ_STOCK_LIST_TEST_DATA.symbol.length;
56892
+ for(var i=0;i<count;++i)
56893
+ {
56894
+ var dataIndex=(randomStart+i)%symbolCount;
56895
+ var symbol=SHSZ_STOCK_LIST_TEST_DATA.symbol[dataIndex];
56896
+ var name=SHSZ_STOCK_LIST_TEST_DATA.name[dataIndex];
56897
+ var price=SHSZ_STOCK_LIST_TEST_DATA.close[dataIndex];
56898
+ var vol=SHSZ_STOCK_LIST_TEST_DATA.vol[dataIndex];
56899
+ var newItem=
56900
+ [
56901
+ symbol,
56902
+ name,
56903
+ SHSZ_STOCK_LIST_TEST_DATA.yclose[dataIndex],
56904
+ SHSZ_STOCK_LIST_TEST_DATA.open[dataIndex],
56905
+ SHSZ_STOCK_LIST_TEST_DATA.high[dataIndex],
56906
+ SHSZ_STOCK_LIST_TEST_DATA.low[dataIndex],
56907
+ price,
56908
+ vol,
56909
+ SHSZ_STOCK_LIST_TEST_DATA.amount[dataIndex],
56910
+ ];
56911
+
56912
+ //买价 量
56913
+ newItem[9]=price+0.05;
56914
+ newItem[10]=10;
56915
+
56916
+ //卖价 量
56917
+ newItem[11]=price-0.06;
56918
+ newItem[12]=5;
56919
+
56920
+ //均价
56921
+ newItem[13]=price-0.03;
56922
+
56923
+ //内盘
56924
+ newItem[18]=vol/4;
56925
+ //外盘
56926
+ newItem[19]=vol/5;
56927
+
56928
+ newItem[14]=vol*1.5; //流通股本
56929
+ newItem[15]=vol*1.8; //总股本
56930
+
56931
+ //换手率
56932
+ newItem[23]=(Math.round(Math.random()*60))/100;
56933
+
56934
+ //名字字段
56935
+ var symbolEx={ Text:name };
56936
+ if (i%20==5)
56937
+ symbolEx.Symbol={ Family:'iconfont', Size:16, Data:[ { Text:'\ue629', Color:'rgb(255,165,0)'}, { Text:'\ue627', Color:'#1c65db'} ] };
56938
+ else if (i%20==9)
56939
+ symbolEx.Symbol={ Family:'iconfont', Size:16, Data:[ { Text:'\ue629', Color:'rgb(255,165,0)'}] } ;
56940
+ else if (i%20==18)
56941
+ symbolEx.Symbol={ Family:'iconfont', Size:16, Data:[ { Text:'\ue627', Color:'#1c65db'}] } ;
56942
+
56943
+ newItem[27]=symbolEx;
56944
+
56945
+
56946
+ //扩展数据 (定制数据)
56947
+ var extendData=[];
56948
+ newItem[30]=extendData;
56949
+
56950
+ //行业
56951
+ extendData[0]="行业X";
56952
+ //地区
56953
+ extendData[1]="地区X";
56954
+
56955
+ //PE|PB
56956
+ extendData[2]=(Math.round(Math.random()*60))/100;
56957
+ extendData[3]=(Math.round(Math.random()*60))/100;
56958
+ extendData[4]=(Math.round(Math.random()*60))/100;
56959
+ extendData[5]=(Math.round(Math.random()*60))/100;
56960
+
56961
+
56962
+ //周涨幅
56963
+ extendData[6]=(Math.round(Math.random()*60))/100;
56964
+ extendData[7]=(Math.round(Math.random()*60))/100;
56965
+ extendData[8]=(Math.round(Math.random()*60))/100;
56966
+
56967
+
56968
+ aryData.push(newItem);
56969
+ aryIndex.push(start+i);
56970
+ }
56971
+ }
56972
+
56973
+ var hqchartData={ data:aryData, index:aryIndex, filedindex:-1, sort:sortType, symbol:blockID };
56974
+
56975
+ if (column) hqchartData.filedindex=column.index;
56976
+
56977
+ callback(hqchartData);
56978
+ }
56979
+
56980
+
56840
56981
 
56841
56982
  HQData.Keyboard_RequestSymbolList=function(data, callback)
56842
56983
  {
@@ -127705,6 +127705,12 @@ function JSReportChart(divElement)
127705
127705
  if (IFrameSplitOperator.IsNumber(item.Sort)) chart.SortInfo.Sort=item.Sort;
127706
127706
  }
127707
127707
 
127708
+ if (option.VirtualTable)
127709
+ {
127710
+ var item=option.VirtualTable;
127711
+ if (IFrameSplitOperator.IsBool(item.Enable)) chart.Data.Virtual.Enable=item.Enable;
127712
+ }
127713
+
127708
127714
  var reportChart=chart.GetReportChart();
127709
127715
  if (reportChart)
127710
127716
  {
@@ -127919,7 +127925,7 @@ function JSReportChartContainer(uielement)
127919
127925
  this.Symbol; //板块代码
127920
127926
  this.Name; //板块名称
127921
127927
  this.NetworkFilter; //数据回调接口
127922
- this.Data={ XOffset:0, YOffset:0, Data:[] }; //股票列表
127928
+ this.Data={ XOffset:0, YOffset:0, Data:[], Virtual:{ Enable:false, Count:0 } }; //股票列表 (Virtual 虚拟表)
127923
127929
  this.SourceData={ Data:[] } ; //原始股票顺序(排序还原用)
127924
127930
  this.BlockData=new Map(); //当前板块数据
127925
127931
  this.MapStockData=new Map(); //原始股票数据
@@ -128288,6 +128294,7 @@ function JSReportChartContainer(uielement)
128288
128294
  {
128289
128295
  this.SourceData.Data=[];
128290
128296
  this.Data.Data=[];
128297
+ this.Data.Virtual.Count=0;
128291
128298
  this.BlockData=new Map();
128292
128299
  }
128293
128300
 
@@ -128544,6 +128551,12 @@ function JSReportChartContainer(uielement)
128544
128551
  }
128545
128552
  }
128546
128553
 
128554
+ if (recvData.Virtual) //虚拟表设置
128555
+ {
128556
+ var item=recvData.Virtual;
128557
+ if (IFrameSplitOperator.IsNumber(item.Count)) this.Data.Virtual.Count=item.Count;
128558
+ }
128559
+
128547
128560
  this.Draw();
128548
128561
  this.UpdateStockData();
128549
128562
  }
@@ -128769,6 +128782,12 @@ function JSReportChartContainer(uielement)
128769
128782
  var chart=this.ChartPaint[0];
128770
128783
  if (!chart) return;
128771
128784
 
128785
+ if (this.Data.Virtual && this.Data.Virtual.Enable)
128786
+ {
128787
+ this.RequestVirtualStockData(); //虚拟表格 全部取后台
128788
+ return;
128789
+ }
128790
+
128772
128791
  if (this.SortInfo && this.SortInfo.Field>=0 && this.SortInfo.Sort>0)
128773
128792
  {
128774
128793
  var column=chart.Column[this.SortInfo.Field];
@@ -130124,8 +130143,9 @@ function JSReportChartContainer(uielement)
130124
130143
  if (!chart) return false;
130125
130144
 
130126
130145
  var pageSize=chart.GetPageSize();
130127
- if (pageSize>this.Data.Data.length) return false;
130128
- if (this.Data.YOffset+pageSize>=this.Data.Data.length)
130146
+ var dataCount=chart.GetAllRowCount();
130147
+ if (pageSize>dataCount) return false;
130148
+ if (this.Data.YOffset+pageSize>=dataCount)
130129
130149
  {
130130
130150
  if (bCycle===true)
130131
130151
  {
@@ -130139,7 +130159,7 @@ function JSReportChartContainer(uielement)
130139
130159
  }
130140
130160
 
130141
130161
  this.Data.YOffset+=pageSize;
130142
- var showDataCount=this.Data.Data.length-this.Data.YOffset;
130162
+ var showDataCount=dataCount-this.Data.YOffset;
130143
130163
 
130144
130164
  if (chart.SelectedModel==0)
130145
130165
  {
@@ -130155,13 +130175,14 @@ function JSReportChartContainer(uielement)
130155
130175
  var chart=this.ChartPaint[0];
130156
130176
  if (!chart) return false;
130157
130177
  var pageSize=chart.GetPageSize();
130158
- if (pageSize>this.Data.Data.length) return false;
130178
+ var dataCount=chart.GetAllRowCount();
130179
+ if (pageSize>dataCount) return false;
130159
130180
 
130160
130181
  if (this.Data.YOffset<=0)
130161
130182
  {
130162
130183
  if (bCycle===true)
130163
130184
  {
130164
- this.Data.YOffset=this.Data.Data.length-pageSize; //循环到最后一页
130185
+ this.Data.YOffset=dataCount-pageSize; //循环到最后一页
130165
130186
  return true;
130166
130187
  }
130167
130188
  else
@@ -130599,7 +130620,16 @@ function JSReportChartContainer(uielement)
130599
130620
  if (column.Sort!=1 && column.Sort!=2) return false;
130600
130621
 
130601
130622
  var sortInfo={ Field:index, Sort:sortType };
130602
- if (sortInfo.Sort==0) //不排序还原
130623
+ if (this.Data.Virtual && this.Data.Virtual.Enable)
130624
+ {
130625
+ this.SortInfo.Field=sortInfo.Field;
130626
+ this.SortInfo.Sort=sortInfo.Sort;
130627
+ this.Data.YOffset=0;
130628
+ this.ResetReportSelectStatus();
130629
+ this.RequestVirtualStockData(); //虚拟表格
130630
+ return true;
130631
+ }
130632
+ else if (sortInfo.Sort==0) //不排序还原
130603
130633
  {
130604
130634
  this.Data.Data=[];
130605
130635
  if (IFrameSplitOperator.IsNonEmptyArray(this.SourceData.Data))
@@ -131325,6 +131355,70 @@ function JSReportChartContainer(uielement)
131325
131355
  if (bUpdate) this.Draw();
131326
131356
  }
131327
131357
 
131358
+ //虚拟表格 请求序号 所有数据后台返回
131359
+ this.RequestVirtualStockData=function()
131360
+ {
131361
+ var chart=this.ChartPaint[0];
131362
+ if (!chart) return;
131363
+
131364
+ var self=this;
131365
+ var startIndex=this.Data.YOffset;
131366
+ var pageSize=chart.GetPageSize();
131367
+ var endIndex=startIndex+pageSize;
131368
+ var dataCount=chart.GetAllRowCount();
131369
+ if (endIndex>=dataCount) endIndex=dataCount-1;
131370
+
131371
+ if (!this.NetworkFilter) return;
131372
+
131373
+ var requestData=
131374
+ {
131375
+ range:{ start:startIndex, end:endIndex, count:chart.GetAllRowCount() },
131376
+ column:null,
131377
+ sort:0, symbol:this.Symbol, name:this.Name,
131378
+ pageSize:pageSize
131379
+ }
131380
+
131381
+ if (this.SortInfo && this.SortInfo.Field>=0 && this.SortInfo.Sort>0) //排序
131382
+ {
131383
+ var column=chart.Column[this.SortInfo.Field];
131384
+ requestData.column={ name: column.Title, type: column.Type, index:this.SortInfo.Field, ID:column.ID };
131385
+ requestData.sort=this.SortInfo.Sort;
131386
+ }
131387
+
131388
+ var obj=
131389
+ {
131390
+ Name:'JSDealChartContainer::RequestVirtualStockData', //类名::函数名
131391
+ Explain:'报价列表股票数据(虚拟表格)',
131392
+ Request:
131393
+ {
131394
+ Data: requestData
131395
+ },
131396
+ Self:this,
131397
+ PreventDefault:false
131398
+ };
131399
+
131400
+ if (chart.FixedRowCount>0 && chart.FixedRowData.Type==1)
131401
+ {
131402
+ var arySymbol=[];
131403
+ for(var i=0;i<chart.FixedRowData.Symbol.length;++i)
131404
+ {
131405
+ var item=chart.FixedRowData.Symbol[i];
131406
+ if (item) arySymbol.push(item);
131407
+ }
131408
+
131409
+ obj.Request.FixedSymbol=arySymbol;
131410
+ }
131411
+
131412
+ this.NetworkFilter(obj, function(data)
131413
+ {
131414
+ self.RecvStockSortData(data);
131415
+ self.AutoUpdate();
131416
+ });
131417
+
131418
+ if (obj.PreventDefault==true) return;
131419
+
131420
+ }
131421
+
131328
131422
  //底部标签
131329
131423
  this.ShowPageInfo=function(bShow)
131330
131424
  {
@@ -132004,8 +132098,9 @@ function ChartReport()
132004
132098
  this.GetYScrollRange=function()
132005
132099
  {
132006
132100
  if (!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data)) return 0;
132101
+ var dataCount=this.GetAllRowCount();
132007
132102
 
132008
- var maxOffset=this.Data.Data.length-this.RowCount;
132103
+ var maxOffset=dataCount-this.RowCount;
132009
132104
 
132010
132105
  return maxOffset;
132011
132106
  }
@@ -132581,6 +132676,14 @@ function ChartReport()
132581
132676
  this.Canvas.stroke();
132582
132677
  }
132583
132678
 
132679
+ //获取一共多少行
132680
+ this.GetAllRowCount=function()
132681
+ {
132682
+ var count=this.Data.Data.length;
132683
+ if (this.Data.Virtual && this.Data.Virtual.Enable) count=this.Data.Virtual.Count;
132684
+ return count;
132685
+ }
132686
+
132584
132687
  this.DrawBody=function()
132585
132688
  {
132586
132689
  if (!this.Data) return;
@@ -132620,7 +132723,8 @@ function ChartReport()
132620
132723
  var setSelected;
132621
132724
  if (this.MultiSelectModel==1) setSelected=new Set(this.MultiSelectedRow);
132622
132725
 
132623
- for(var i=this.Data.YOffset, j=0; i<this.Data.Data.length && j<this.RowCount ;++i, ++j)
132726
+ var dataCount=this.GetAllRowCount();
132727
+ for(var i=this.Data.YOffset, j=0; i<dataCount && j<this.RowCount ;++i, ++j)
132624
132728
  {
132625
132729
  var symbol=this.Data.Data[i];
132626
132730
 
@@ -144582,7 +144686,7 @@ function HQChartScriptWorker()
144582
144686
 
144583
144687
 
144584
144688
 
144585
- var HQCHART_VERSION="1.1.13962";
144689
+ var HQCHART_VERSION="1.1.13964";
144586
144690
 
144587
144691
  function PrintHQChartVersion()
144588
144692
  {