Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/16/16 14:31:36 (8 years ago)
Author:
pfleck
Message:

#2713 Added option in the ScatterPlotControl to show a regression curve for a ScatterPlotDataRow (linear, poly, exp, log, pow).

File:
1 edited

Legend:

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

    r14185 r14493  
    4444      InitializeComponent();
    4545      pointStyleComboBox.DataSource = Enum.GetValues(typeof(ScatterPlotDataRowVisualProperties.ScatterPlotDataRowPointStyle));
     46      regressionTypeComboBox.DataSource = Enum.GetValues(typeof(ScatterPlotDataRowVisualProperties.ScatterPlotDataRowRegressionType));
    4647      SetEnabledStateOfControls();
    4748    }
     
    5758          pointSizeNumericUpDown.Value = 1;
    5859          displayNameTextBox.Text = String.Empty;
     60          regressionTypeComboBox.SelectedIndex = -1;
     61          polynomialRegressionOrderNumericUpDown.Value = 2;
     62          isRegressionVisibleInLegendCheckBox.Checked = false;
     63          regressionLegendTextBox.Text = string.Empty;
    5964        } else {
    6065          displayNameTextBox.Text = Content.DisplayName;
     
    6974          pointSizeNumericUpDown.Value = Content.PointSize;
    7075          isVisibleInLegendCheckBox.Checked = Content.IsVisibleInLegend;
     76          regressionTypeComboBox.SelectedItem = Content.RegressionType;
     77          polynomialRegressionOrderNumericUpDown.Value = Content.PolynomialRegressionOrder;
     78          isRegressionVisibleInLegendCheckBox.Checked = Content.IsRegressionVisibleInLegend;
     79          regressionLegendTextBox.Text = content.RegressionDisplayName;
    7180        }
    7281      }
     
    8291      pointSizeNumericUpDown.Enabled = Content != null;
    8392      displayNameTextBox.Enabled = Content != null;
     93      regressionTypeComboBox.Enabled = Content != null;
     94      polynomialRegressionOrderNumericUpDown.Enabled = Content != null && Content.RegressionType == ScatterPlotDataRowVisualProperties.ScatterPlotDataRowRegressionType.Polynomial;
     95      orderLabel.Enabled = polynomialRegressionOrderNumericUpDown.Enabled;
     96      isRegressionVisibleInLegendCheckBox.Enabled = Content != null && Content.RegressionType != ScatterPlotDataRowVisualProperties.ScatterPlotDataRowRegressionType.None;
     97      regressionLegendTextBox.Enabled = Content != null && Content.RegressionType != ScatterPlotDataRowVisualProperties.ScatterPlotDataRowRegressionType.None;
    8498    }
    8599
     
    87101    private void pointStyleComboBox_SelectedValueChanged(object sender, EventArgs e) {
    88102      if (!SuppressEvents && Content != null) {
    89         ScatterPlotDataRowVisualProperties.ScatterPlotDataRowPointStyle selected = (ScatterPlotDataRowVisualProperties.ScatterPlotDataRowPointStyle)pointStyleComboBox.SelectedValue;
     103        var selected = (ScatterPlotDataRowVisualProperties.ScatterPlotDataRowPointStyle)pointStyleComboBox.SelectedValue;
    90104        Content.PointStyle = selected;
    91105      }
     
    121135      }
    122136    }
     137
     138    private void regressionTypeComboBox_SelectedValueChanged(object sender, EventArgs e) {
     139      if (!SuppressEvents && Content != null) {
     140        var selected = (ScatterPlotDataRowVisualProperties.ScatterPlotDataRowRegressionType)regressionTypeComboBox.SelectedValue;
     141        Content.RegressionType = selected;
     142        SetEnabledStateOfControls();
     143      }
     144    }
     145
     146    private void polynomialRegressionOrderNumericUpDown_ValueChanged(object sender, EventArgs e) {
     147      if (!SuppressEvents && Content != null) {
     148        Content.PolynomialRegressionOrder = (int)polynomialRegressionOrderNumericUpDown.Value;
     149      }
     150    }
     151
     152    private void isRegressionVisibleInLegendCheckBox_CheckedChanged(object sender, EventArgs e) {
     153      if (!SuppressEvents && Content != null) {
     154        Content.IsRegressionVisibleInLegend = isRegressionVisibleInLegendCheckBox.Checked;
     155      }
     156    }
     157
     158    private void regressionLegendTextBox_Validated(object sender, EventArgs e) {
     159      if (!SuppressEvents && Content != null) {
     160        Content.RegressionDisplayName = regressionLegendTextBox.Text;
     161      }
     162    }
    123163    #endregion
    124164  }
Note: See TracChangeset for help on using the changeset viewer.