Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/18/17 13:17:00 (7 years ago)
Author:
pfleck
Message:

#2715

  • Added 3 types of histogram aggregation: Overlapping (transparent), SideBySide and Stacked
  • Added a "clear color"-button in the DataRowVisualPropertiesControl to set the color back to the default color palette color.
  • Set the legend ordering to "reversed". Otherwise legend entries of multiple histograms are not ordered according tho the DataRow ordering.
File:
1 edited

Legend:

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

    r14437 r14582  
    2323using System.Drawing;
    2424using System.Windows.Forms;
     25using HeuristicLab.Common.Resources;
    2526using HeuristicLab.MainForm;
    2627using HeuristicLab.MainForm.WindowsForms;
     
    4546      chartTypeComboBox.DataSource = Enum.GetValues(typeof(DataRowVisualProperties.DataRowChartType));
    4647      lineStyleComboBox.DataSource = Enum.GetValues(typeof(DataRowVisualProperties.DataRowLineStyle));
     48      aggregationComboBox.DataSource = Enum.GetValues(typeof(DataRowVisualProperties.DataRowHistogramAggregation));
     49      clearColorButton.BackColor = Color.Transparent;
     50      clearColorButton.BackgroundImage = VSImageLibrary.Delete;
    4751      SetEnabledStateOfControls();
    4852    }
     
    6569          binsApproximatelyRadioButton.Checked = false;
    6670          binsExactRadioButton.Checked = false;
     71          aggregationComboBox.SelectedIndex = -1;
    6772          displayNameTextBox.Text = String.Empty;
    6873        } else {
     
    9398          binsApproximatelyRadioButton.Checked = !Content.ExactBins;
    9499          binsExactRadioButton.Checked = Content.ExactBins;
     100          aggregationComboBox.SelectedItem = Content.Aggregation;
    95101          displayNameTextBox.Text = Content.DisplayName;
    96102          isVisibleInLegendCheckBox.Checked = Content.IsVisibleInLegend;
     
    102108    protected virtual void SetEnabledStateOfControls() {
    103109      commonGroupBox.Enabled = Content != null;
     110      clearColorButton.Visible = Content != null && !Content.Color.IsEmpty;
    104111      lineChartGroupBox.Enabled = Content != null && Content.ChartType == DataRowVisualProperties.DataRowChartType.Line;
    105112      histoGramGroupBox.Enabled = Content != null && Content.ChartType == DataRowVisualProperties.DataRowChartType.Histogram;
     
    128135        colorButton.BackColor = Content.Color;
    129136        colorButton.Text = String.Empty;
     137        clearColorButton.Visible = true;
     138      }
     139    }
     140
     141    private void clearColorButton_Click(object sender, EventArgs e) {
     142      if (!SuppressEvents && Content != null) {
     143        SuppressEvents = true;
     144        try {
     145          Content.Color = Color.Empty;
     146          colorButton.BackColor = SystemColors.Control;
     147          colorButton.Text = "?";
     148          clearColorButton.Visible = false;
     149        } finally { SuppressEvents = false; }
    130150      }
    131151    }
     
    178198        try {
    179199          Content.ExactBins = binsExactRadioButton.Checked;
     200        } finally { SuppressEvents = false; }
     201      }
     202    }
     203
     204    private void aggregationComboBox_SelectedValueChanged(object sender, EventArgs e) {
     205      if (!SuppressEvents && Content != null) {
     206        SuppressEvents = true;
     207        try {
     208          Content.Aggregation = (DataRowVisualProperties.DataRowHistogramAggregation)aggregationComboBox.SelectedValue;
    180209        } finally { SuppressEvents = false; }
    181210      }
Note: See TracChangeset for help on using the changeset viewer.