hqchart 1.1.14919 → 1.1.14922

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.
@@ -6969,6 +6969,8 @@ var JSCHART_EVENT_ID=
6969
6969
  GET_DEFAULT_INDEX_PARAM:172, //获取指标默认参数
6970
6970
 
6971
6971
  ON_RELOAD_RESOURCE:173,
6972
+
6973
+ ON_REPORT_DATA_FILTER:174, //数据筛选
6972
6974
  }
6973
6975
 
6974
6976
  var JSCHART_OPERATOR_ID=
@@ -137972,7 +137974,13 @@ function JSReportChart(divElement)
137972
137974
  //是否自动更新
137973
137975
  if (option.IsAutoUpdate!=null) chart.IsAutoUpdate=option.IsAutoUpdate;
137974
137976
  if (option.AutoUpdateFrequency>0) chart.AutoUpdateFrequency=option.AutoUpdateFrequency;
137975
- if (IFrameSplitOperator.IsBool(option.EnableFilter)) chart.EnableFilter=option.EnableFilter;
137977
+
137978
+ //数据筛选
137979
+ if (option.DataFilter)
137980
+ {
137981
+ var item=option.DataFilter;
137982
+ if (IFrameSplitOperator.IsBool(item.Enable)) chart.DataFilterConfig.Enable=item.Enable;
137983
+ }
137976
137984
 
137977
137985
  //注册事件
137978
137986
  if (option.EventCallback)
@@ -138046,9 +138054,9 @@ function JSReportChart(divElement)
138046
138054
  if (this.JSChartContainer) this.JSChartContainer.AddSymbol(arySymbol, option);
138047
138055
  }
138048
138056
 
138049
- this.EnableFilter=function(bEnable, option) //启动|关闭筛选
138057
+ this.EnableDataFilter=function(bEnable, option) //启动|关闭筛选
138050
138058
  {
138051
- if (this.JSChartContainer) this.JSChartContainer.EnableFilter(bEnable, option);
138059
+ if (this.JSChartContainer) this.JSChartContainer.EnableDataFilter(bEnable, option);
138052
138060
  }
138053
138061
 
138054
138062
  //事件回调
@@ -138238,6 +138246,8 @@ function JSReportChartContainer(uielement)
138238
138246
  //MouseOnStatus:{ RowIndex:行, ColumnIndex:列}
138239
138247
  this.LastMouseStatus={ MoveStatus:null, TooltipStatus:null, MouseOnStatus:null };
138240
138248
  this.RequestStatus={ IsFinishStockList:false, IsFinishMemberList:false }; //下载状态
138249
+
138250
+ this.DataFilterConfig={ Enable:false, }; //数据筛选
138241
138251
 
138242
138252
  this.ChartDestroy=function() //销毁
138243
138253
  {
@@ -138950,26 +138960,14 @@ function JSReportChartContainer(uielement)
138950
138960
 
138951
138961
  this.RequestStatus.IsFinishMemberList=true;
138952
138962
 
138963
+ this.DataFilter();
138964
+
138953
138965
  //实时本地数据排序
138954
138966
  var chart=this.GetReportChart();
138955
138967
  if (chart && (this.SortInfo.Sort==1 || this.SortInfo.Sort==2) && IFrameSplitOperator.IsNumber(this.SortInfo.Field) && this.SortInfo.Field>=0)
138956
138968
  {
138957
138969
  var column=chart.Column[this.SortInfo.Field];
138958
- var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_REPORT_LOCAL_SORT);
138959
-
138960
- var bLocalSrot=true;
138961
- if (event && event.Callback)
138962
- {
138963
- var sendData={ Column:column, SortInfo:this.SortInfo, SymbolList:this.Data.Data, Result:null, PreventDefault:false };
138964
- event.Callback (event, sendData, this);
138965
- if (event.PreventDefault)
138966
- {
138967
- bLocalSrot=false;
138968
- if (Array.isArray(sendData.Result)) this.Data.Data=sendData.Result;
138969
- }
138970
- }
138971
-
138972
- if (bLocalSrot) this.Data.Data.sort((left, right)=> { return this.LocalSort(left, right, column, this.SortInfo.Sort); });
138970
+ this.LocalDataSort(column, this.SortInfo);
138973
138971
  }
138974
138972
 
138975
138973
  this.Draw();
@@ -139383,31 +139381,21 @@ function JSReportChartContainer(uielement)
139383
139381
  var chart=this.ChartPaint[0];
139384
139382
  if (!chart) return;
139385
139383
 
139384
+
139385
+
139386
139386
  var bUpdate=false;
139387
+ if (this.DataFilter()) bUpdate=true; //过滤数据每次都刷新
139388
+
139387
139389
  //实时本地数据排序
139388
139390
  var chart=this.ChartPaint[0];
139389
139391
  if (chart && (this.SortInfo.Sort==1 || this.SortInfo.Sort==2) && IFrameSplitOperator.IsNumber(this.SortInfo.Field) && this.SortInfo.Field>=0)
139390
139392
  {
139391
- var column=chart.Column[this.SortInfo.Field];
139392
- var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_REPORT_LOCAL_SORT);
139393
-
139394
139393
  //当前选中的股票
139395
139394
  var selectedSymbol=null;
139396
139395
  if (chart.SelectedRowData && chart.SelectedModel==1) selectedSymbol=chart.SelectedRowData.Symbol;
139397
139396
 
139398
- var bLocalSrot=true;
139399
- if (event && event.Callback)
139400
- {
139401
- var sendData={ Column:column, SortInfo:this.SortInfo, SymbolList:this.Data.Data, Result:null, PreventDefault:false };
139402
- event.Callback (event, sendData, this);
139403
- if (event.PreventDefault)
139404
- {
139405
- bLocalSrot=false;
139406
- if (Array.isArray(sendData.Result)) this.Data.Data=sendData.Result;
139407
- }
139408
- }
139409
-
139410
- if (bLocalSrot) this.Data.Data.sort((left, right)=> { return this.LocalSort(left, right, column, this.SortInfo.Sort); });
139397
+ var column=chart.Column[this.SortInfo.Field];
139398
+ this.LocalDataSort(column, this.SortInfo);
139411
139399
 
139412
139400
  if (selectedSymbol)
139413
139401
  {
@@ -141472,33 +141460,15 @@ function JSReportChartContainer(uielement)
141472
141460
  {
141473
141461
  if (sortInfo.Sort==0)
141474
141462
  {
141475
- this.Data.Data=[];
141476
- for(var i=0;i<this.SourceData.Data.length;++i)
141477
- {
141478
- this.Data.Data.push(this.SourceData.Data[i]);
141479
- }
141463
+ this.Data.Data=this.SourceData.Data.slice();
141464
+ this.DataFilter();
141480
141465
  }
141481
141466
  else
141482
141467
  {
141483
141468
  if (header.Column.Sort==1) //本地排序
141484
141469
  {
141485
- var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_REPORT_LOCAL_SORT);
141486
- var bLocalSort=true;
141487
- if (event && event.Callback)
141488
- {
141489
- var sendData={ Column:header.Column, SortInfo:sortInfo, SymbolList:this.Data.Data, Result:null, PreventDefault:false};
141490
- event.Callback (event, sendData, this);
141491
- if (sendData.PreventDefault)
141492
- {
141493
- if (Array.isArray(sendData.Result)) this.Data.Data=sendData.Result;
141494
- bLocalSort=false;
141495
- }
141496
-
141497
- }
141498
-
141499
-
141500
- if (bLocalSort) this.Data.Data.sort((left, right)=> { return this.LocalSort(left, right, header.Column, sortInfo.Sort); });
141501
-
141470
+ this.DataFilter();
141471
+ this.LocalDataSort(header.Column, sortInfo);
141502
141472
  }
141503
141473
  else if (header.Column.Sort==2) //远程排序
141504
141474
  {
@@ -141523,6 +141493,70 @@ function JSReportChartContainer(uielement)
141523
141493
  }
141524
141494
  }
141525
141495
 
141496
+ this.LocalDataSort=function(column, sortInfo)
141497
+ {
141498
+ var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_REPORT_LOCAL_SORT);
141499
+ var bLocalSort=true;
141500
+ if (event && event.Callback)
141501
+ {
141502
+ var sendData={ Column:header.Column, SortInfo:sortInfo, SymbolList:this.Data.Data, Result:null, PreventDefault:false};
141503
+ event.Callback (event, sendData, this);
141504
+ if (sendData.PreventDefault)
141505
+ {
141506
+ if (Array.isArray(sendData.Result)) this.Data.Data=sendData.Result;
141507
+ bLocalSort=false;
141508
+ }
141509
+ }
141510
+
141511
+ if (bLocalSort) this.Data.Data.sort((left, right)=> { return this.LocalSort(left, right, column, sortInfo.Sort); });
141512
+ }
141513
+
141514
+ //数据筛选
141515
+ this.DataFilter=function()
141516
+ {
141517
+ if (!this.DataFilterConfig.Enable) return false;
141518
+ if (!IFrameSplitOperator.IsNonEmptyArray(this.SourceData.Data)) return false;
141519
+
141520
+ var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_REPORT_DATA_FILTER);
141521
+ if (!event || !event.Callback) return false;
141522
+
141523
+ var aryData=this.SourceData.Data.slice(); //原始数据
141524
+
141525
+ var sendData={ AryData:aryData, PreventDefault:false };
141526
+ event.Callback(event, sendData, this);
141527
+ if (!sendData.PreventDefault) return false;
141528
+
141529
+ this.Data.Data=sendData.AryData;
141530
+
141531
+ return true;
141532
+ }
141533
+
141534
+ this.EnableDataFilter=function(enable, option)
141535
+ {
141536
+ if (!IFrameSplitOperator.IsBool(enable)) return false;
141537
+
141538
+ this.DataFilterConfig.Enable=enable;
141539
+ if (enable)
141540
+ {
141541
+ this.DataFilter();
141542
+ }
141543
+ else
141544
+ {
141545
+ this.Data.Data=this.SourceData.Data.slice();
141546
+ }
141547
+
141548
+ //排序
141549
+ var chart=this.GetReportChart();
141550
+ if (chart && (this.SortInfo.Sort==1 || this.SortInfo.Sort==2) && IFrameSplitOperator.IsNumber(this.SortInfo.Field) && this.SortInfo.Field>=0)
141551
+ {
141552
+ var column=chart.Column[this.SortInfo.Field];
141553
+ this.LocalDataSort(column, this.SortInfo);
141554
+ }
141555
+
141556
+ this.ResetReportStatus();
141557
+ this.Draw();
141558
+ }
141559
+
141526
141560
  this.PopupHeaderMenu=function(clickData, e)
141527
141561
  {
141528
141562
  if (!this.JSPopMenu) return;
@@ -162477,7 +162511,7 @@ function HQChartScriptWorker()
162477
162511
 
162478
162512
 
162479
162513
 
162480
- var HQCHART_VERSION="1.1.14918";
162514
+ var HQCHART_VERSION="1.1.14921";
162481
162515
 
162482
162516
  function PrintHQChartVersion()
162483
162517
  {