Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/30/17 16:41:06 (7 years ago)
Author:
pfleck
Message:

#2713 #2715 #2765
Merged to stable

  • 14435-14439,14493,14516,14519,14982,14987,14992,15042 (from #2713)
  • 14457-14458,14508,14582,14740,14984,15068,15095 (from #2715)
  • 14860-14861 (from #2765)
Location:
stable
Files:
2 edited
1 copied

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.Analysis.Views

  • stable/HeuristicLab.Analysis.Views/3.3/DataTableView.cs

    r14982 r15097  
    3636    protected List<Series> invisibleSeries;
    3737    protected Dictionary<IObservableList<double>, DataRow> valuesRowsTable;
     38    protected bool showChartOnly = false;
    3839
    3940    public new DataTable Content {
     
    4243    }
    4344
    44     public bool ShowName {
    45       get { return nameTextBox.Visible; }
     45    public bool ShowChartOnly {
     46      get { return showChartOnly; }
    4647      set {
    47         if (nameTextBox.Visible != value) {
    48           foreach (Control c in Controls) {
    49             if (c == chart) continue;
    50             c.Visible = value;
    51           }
    52           chart.Dock = value ? DockStyle.None : DockStyle.Fill;
     48        if (showChartOnly != value) {
     49          showChartOnly = value;
     50          UpdateControlsVisibility();
    5351        }
    5452      }
     
    133131      } else MessageBox.Show("Nothing to configure.");
    134132    }
     133
     134    protected void UpdateControlsVisibility() {
     135      if (InvokeRequired)
     136        Invoke(new Action(UpdateControlsVisibility));
     137      else {
     138        foreach (Control c in Controls) {
     139          if (c == chart) continue;
     140          c.Visible = !showChartOnly;
     141        }
     142        chart.Dock = showChartOnly ? DockStyle.Fill : DockStyle.None;
     143      }
     144    }
     145
    135146    protected virtual void AddDataRows(IEnumerable<DataRow> rows) {
    136147      foreach (var row in rows) {
     
    195206          break;
    196207        case DataRowVisualProperties.DataRowChartType.Histogram:
    197           bool stacked = row.VisualProperties.Aggregation == DataRowVisualProperties.DataRowHistogramAggregation.Stacked;
     208          bool stacked = Content.VisualProperties.HistogramAggregation == DataTableVisualProperties.DataTableHistogramAggregation.Stacked;
    198209          series.ChartType = stacked ? SeriesChartType.StackedColumn : SeriesChartType.Column;
    199           bool sideBySide = row.VisualProperties.Aggregation == DataRowVisualProperties.DataRowHistogramAggregation.SideBySide;
     210          bool sideBySide = Content.VisualProperties.HistogramAggregation == DataTableVisualProperties.DataTableHistogramAggregation.SideBySide;
    200211          series.SetCustomProperty("DrawSideBySide", sideBySide ? "True" : "False");
    201212          series.SetCustomProperty("PointWidth", "1");
     
    319330    private bool RequiresTransparency(DataRow row) {
    320331      return row.VisualProperties.ChartType == DataRowVisualProperties.DataRowChartType.Histogram
    321              && row.VisualProperties.Aggregation == DataRowVisualProperties.DataRowHistogramAggregation.Overlapping;
     332             && Content.VisualProperties.HistogramAggregation == DataTableVisualProperties.DataTableHistogramAggregation.Overlapping;
    322333    }
    323334
     
    338349        ConfigureChartArea(chart.ChartAreas[0]);
    339350        RecalculateAxesScale(chart.ChartAreas[0]); // axes min/max could have changed
     351
     352        chart.Update(); // side-by-side and stacked histograms are not always correctly displayed without an update
     353        // (chart update is required before the series are updated, otherwise the widths of the bars are updated incorrectly)
     354        foreach (var row in Content.Rows.Where(r => r.VisualProperties.ChartType == DataRowVisualProperties.DataRowChartType.Histogram))
     355          Row_VisualPropertiesChanged(row, EventArgs.Empty); // Histogram properties could have changed
    340356      }
    341357    }
     
    551567      switch (row.VisualProperties.ChartType) {
    552568        case DataRowVisualProperties.DataRowChartType.Histogram:
    553           // when a single histogram is updated, all histograms must be updated. otherwise the value ranges and bin sizes may not be equal.
     569          // when a single histogram is updated, all histograms must be updated. otherwise the value ranges may not be equal.
    554570          var histograms = Content.Rows
    555571            .Where(r => r.VisualProperties.ChartType == DataRowVisualProperties.DataRowChartType.Histogram)
     
    595611      if (!validValues.Any()) return;
    596612
    597       int bins = histogramRows.Max(r => r.VisualProperties.Bins);
     613      int bins = Content.VisualProperties.HistogramBins;
    598614      decimal minValue = (decimal)validValues.Min();
    599615      decimal maxValue = (decimal)validValues.Max();
     
    605621      }
    606622
    607       if (!histogramRows.Any(r => r.VisualProperties.ExactBins)) {
     623      if (!Content.VisualProperties.HistogramExactBins) {
    608624        intervalWidth = (decimal)HumanRoundRange((double)intervalWidth);
    609625        minValue = Math.Floor(minValue / intervalWidth) * intervalWidth;
Note: See TracChangeset for help on using the changeset viewer.