Changeset 15619
- Timestamp:
- 01/16/18 16:56:13 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Analysis.Views/3.3/DataTableView.cs
r15583 r15619 398 398 DataRow row = (DataRow)sender; 399 399 Series series = chart.Series[row.Name]; 400 series.Points.Clear();400 ClearPoints(series.Points); 401 401 ConfigureSeries(series, row); 402 402 if (!invisibleSeries.Contains(series)) { … … 426 426 Series rowSeries = chart.Series[row.Name]; 427 427 if (!invisibleSeries.Contains(rowSeries)) { 428 rowSeries.Points.Clear();428 ClearPoints(rowSeries.Points); 429 429 FillSeriesWithRowValues(rowSeries, row); 430 430 RecalculateAxesScale(chart.ChartAreas[0]); … … 443 443 Series rowSeries = chart.Series[row.Name]; 444 444 if (!invisibleSeries.Contains(rowSeries)) { 445 rowSeries.Points.Clear();445 ClearPoints(rowSeries.Points); 446 446 FillSeriesWithRowValues(rowSeries, row); 447 447 RecalculateAxesScale(chart.ChartAreas[0]); … … 461 461 if (!invisibleSeries.Contains(rowSeries)) { 462 462 if (row.VisualProperties.ChartType == DataRowVisualProperties.DataRowChartType.Histogram) { 463 rowSeries.Points.Clear();463 ClearPoints(rowSeries.Points); 464 464 FillSeriesWithRowValues(rowSeries, row); 465 465 } else { … … 488 488 Series rowSeries = chart.Series[row.Name]; 489 489 if (!invisibleSeries.Contains(rowSeries)) { 490 rowSeries.Points.Clear();490 ClearPoints(rowSeries.Points); 491 491 FillSeriesWithRowValues(rowSeries, row); 492 492 RecalculateAxesScale(chart.ChartAreas[0]); … … 506 506 Series rowSeries = chart.Series[row.Name]; 507 507 if (!invisibleSeries.Contains(rowSeries)) { 508 rowSeries.Points.Clear();508 ClearPoints(rowSeries.Points); 509 509 FillSeriesWithRowValues(rowSeries, row); 510 510 RecalculateAxesScale(chart.ChartAreas[0]); … … 549 549 private void ToggleSeriesVisible(Series series) { 550 550 if (!invisibleSeries.Contains(series)) { 551 series.Points.Clear();551 ClearPoints(series.Points); 552 552 invisibleSeries.Add(series); 553 553 } else { … … 580 580 where !invisibleSeries.Contains(s) 581 581 select new { row = r, series = s }) { 582 h.series.Points.Clear();582 ClearPoints(h.series.Points); 583 583 CalculateHistogram(h.series, h.row, histograms); 584 584 } … … 607 607 608 608 protected virtual void CalculateHistogram(Series series, DataRow row, IEnumerable<DataRow> histogramRows) { 609 series.Points.Clear();609 ClearPoints(series.Points); 610 610 if (!row.Values.Any()) return; 611 611 … … 740 740 return double.IsNaN(x) || x < (double)decimal.MinValue || x > (double)decimal.MaxValue; 741 741 } 742 743 // workaround for performance problem as described in https://stackoverflow.com/questions/5744930/datapointcollection-clear-performance 744 public static void ClearPoints(DataPointCollection points) { 745 points.SuspendUpdates(); 746 while (points.Count > 0) 747 points.RemoveAt(points.Count - 1); 748 points.ResumeUpdates(); 749 } 742 750 #endregion 743 751 }
Note: See TracChangeset
for help on using the changeset viewer.