Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/27/17 10:06:34 (7 years ago)
Author:
pfleck
Message:

#2715 Moved the histogram properties (nr of bins, exact/approximate bins, aggregation) from DataRowVisualProperties to DataTableVisualProperties

  • Adapted DataRow/TableVisualPropertiesControl
  • Backwards compatability is handled in the DataTable (DataTableVisualProperties has no access to the DataRowVisualProperties)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Analysis.Views/3.3/DataTableView.cs

    r15042 r15068  
    206206          break;
    207207        case DataRowVisualProperties.DataRowChartType.Histogram:
    208           bool stacked = row.VisualProperties.Aggregation == DataRowVisualProperties.DataRowHistogramAggregation.Stacked;
     208          bool stacked = Content.VisualProperties.HistogramAggregation == DataTableVisualProperties.DataTableHistogramAggregation.Stacked;
    209209          series.ChartType = stacked ? SeriesChartType.StackedColumn : SeriesChartType.Column;
    210           bool sideBySide = row.VisualProperties.Aggregation == DataRowVisualProperties.DataRowHistogramAggregation.SideBySide;
     210          bool sideBySide = Content.VisualProperties.HistogramAggregation == DataTableVisualProperties.DataTableHistogramAggregation.SideBySide;
    211211          series.SetCustomProperty("DrawSideBySide", sideBySide ? "True" : "False");
    212212          series.SetCustomProperty("PointWidth", "1");
     
    330330    private bool RequiresTransparency(DataRow row) {
    331331      return row.VisualProperties.ChartType == DataRowVisualProperties.DataRowChartType.Histogram
    332              && row.VisualProperties.Aggregation == DataRowVisualProperties.DataRowHistogramAggregation.Overlapping;
     332             && Content.VisualProperties.HistogramAggregation == DataTableVisualProperties.DataTableHistogramAggregation.Overlapping;
    333333    }
    334334
     
    349349        ConfigureChartArea(chart.ChartAreas[0]);
    350350        RecalculateAxesScale(chart.ChartAreas[0]); // axes min/max could have changed
     351        foreach (var row in Content.Rows.Where(r => r.VisualProperties.ChartType == DataRowVisualProperties.DataRowChartType.Histogram))
     352          Row_VisualPropertiesChanged(row, EventArgs.Empty); // Histogram properties could have changed
     353        chart.Update(); // side-by-side series are not always correctly displayed without an update
    351354      }
    352355    }
     
    562565      switch (row.VisualProperties.ChartType) {
    563566        case DataRowVisualProperties.DataRowChartType.Histogram:
    564           // when a single histogram is updated, all histograms must be updated. otherwise the value ranges and bin sizes may not be equal.
     567          // when a single histogram is updated, all histograms must be updated. otherwise the value ranges may not be equal.
    565568          var histograms = Content.Rows
    566569            .Where(r => r.VisualProperties.ChartType == DataRowVisualProperties.DataRowChartType.Histogram)
     
    606609      if (!validValues.Any()) return;
    607610
    608       int bins = histogramRows.Max(r => r.VisualProperties.Bins);
     611      int bins = Content.VisualProperties.HistogramBins;
    609612      decimal minValue = (decimal)validValues.Min();
    610613      decimal maxValue = (decimal)validValues.Max();
     
    616619      }
    617620
    618       if (!histogramRows.Any(r => r.VisualProperties.ExactBins)) {
     621      if (!Content.VisualProperties.HistogramExactBins) {
    619622        intervalWidth = (decimal)HumanRoundRange((double)intervalWidth);
    620623        minValue = Math.Floor(minValue / intervalWidth) * intervalWidth;
Note: See TracChangeset for help on using the changeset viewer.