Changeset 17056
- Timestamp:
- 07/04/19 13:05:02 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
stable/HeuristicLab.Analysis.Views/3.3/DataTableView.cs
r16838 r17056 390 390 DataRow row = (DataRow)sender; 391 391 Series series = chart.Series[row.Name]; 392 series.Points.Clear();392 ClearPoints(series.Points); 393 393 ConfigureSeries(series, row); 394 394 if (!invisibleSeries.Contains(series)) { … … 418 418 Series rowSeries = chart.Series[row.Name]; 419 419 if (!invisibleSeries.Contains(rowSeries)) { 420 rowSeries.Points.Clear();420 ClearPoints(rowSeries.Points); 421 421 FillSeriesWithRowValues(rowSeries, row); 422 422 RecalculateAxesScale(chart.ChartAreas[0]); … … 435 435 Series rowSeries = chart.Series[row.Name]; 436 436 if (!invisibleSeries.Contains(rowSeries)) { 437 rowSeries.Points.Clear();437 ClearPoints(rowSeries.Points); 438 438 FillSeriesWithRowValues(rowSeries, row); 439 439 RecalculateAxesScale(chart.ChartAreas[0]); … … 453 453 if (!invisibleSeries.Contains(rowSeries)) { 454 454 if (row.VisualProperties.ChartType == DataRowVisualProperties.DataRowChartType.Histogram) { 455 rowSeries.Points.Clear();455 ClearPoints(rowSeries.Points); 456 456 FillSeriesWithRowValues(rowSeries, row); 457 457 } else { … … 480 480 Series rowSeries = chart.Series[row.Name]; 481 481 if (!invisibleSeries.Contains(rowSeries)) { 482 rowSeries.Points.Clear();482 ClearPoints(rowSeries.Points); 483 483 FillSeriesWithRowValues(rowSeries, row); 484 484 RecalculateAxesScale(chart.ChartAreas[0]); … … 498 498 Series rowSeries = chart.Series[row.Name]; 499 499 if (!invisibleSeries.Contains(rowSeries)) { 500 rowSeries.Points.Clear();500 ClearPoints(rowSeries.Points); 501 501 FillSeriesWithRowValues(rowSeries, row); 502 502 RecalculateAxesScale(chart.ChartAreas[0]); … … 541 541 private void ToggleSeriesVisible(Series series) { 542 542 if (!invisibleSeries.Contains(series)) { 543 series.Points.Clear();543 ClearPoints(series.Points); 544 544 invisibleSeries.Add(series); 545 545 } else { … … 572 572 where !invisibleSeries.Contains(s) 573 573 select new { row = r, series = s }) { 574 h.series.Points.Clear();574 ClearPoints(h.series.Points); 575 575 CalculateHistogram(h.series, h.row, histograms); 576 576 } … … 599 599 600 600 protected virtual void CalculateHistogram(Series series, DataRow row, IEnumerable<DataRow> histogramRows) { 601 series.Points.Clear();601 ClearPoints(series.Points); 602 602 if (!row.Values.Any()) return; 603 603 … … 732 732 return double.IsNaN(x) || x < (double)decimal.MinValue || x > (double)decimal.MaxValue; 733 733 } 734 735 // workaround for performance problem as described in https://stackoverflow.com/questions/5744930/datapointcollection-clear-performance 736 public static void ClearPoints(DataPointCollection points) { 737 points.SuspendUpdates(); 738 while (points.Count > 0) 739 points.RemoveAt(points.Count - 1); 740 points.ResumeUpdates(); 741 } 734 742 #endregion 735 743 }
Note: See TracChangeset
for help on using the changeset viewer.