Changeset 14514 for branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotSingleView.cs
- Timestamp:
- 12/21/16 11:26:54 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotSingleView.cs
r14495 r14514 26 26 using HeuristicLab.Core.Views; 27 27 using HeuristicLab.MainForm; 28 using RegressionType = HeuristicLab.Analysis.ScatterPlotDataRowVisualProperties.ScatterPlotDataRowRegressionType; 28 29 29 30 namespace HeuristicLab.DataPreprocessing.Views { … … 40 41 public ScatterPlotSingleView() { 41 42 InitializeComponent(); 43 44 regressionTypeComboBox.DataSource = Enum.GetValues(typeof(RegressionType)); 45 regressionTypeComboBox.SelectedItem = RegressionType.None; 42 46 } 43 47 … … 88 92 var groupVariable = (string)comboBoxGroup.SelectedItem; 89 93 ScatterPlot scatterPlot = Content.CreateScatterPlot(xVariable, yVariable, groupVariable); 90 foreach (var row in scatterPlot.Rows) 94 var regressionType = (RegressionType)regressionTypeComboBox.SelectedValue; 95 int order = (int)polynomialRegressionOrderNumericUpDown.Value; 96 foreach (var row in scatterPlot.Rows) { 91 97 row.VisualProperties.PointSize = 6; 98 row.VisualProperties.IsRegressionVisibleInLegend = false; 99 row.VisualProperties.RegressionType = regressionType; 100 row.VisualProperties.PolynomialRegressionOrder = order; 101 } 92 102 var vp = scatterPlot.VisualProperties; 93 103 vp.Title = string.Empty; … … 144 154 UpdateScatterPlot(); 145 155 } 156 157 #region Regression Line 158 private void regressionTypeComboBox_SelectedIndexChanged(object sender, EventArgs e) { 159 var regressionType = (RegressionType)regressionTypeComboBox.SelectedValue; 160 polynomialRegressionOrderNumericUpDown.Enabled = regressionType == RegressionType.Polynomial; 161 UpdateRegressionLine(); 162 } 163 164 private void polynomialRegressionOrderNumericUpDown_ValueChanged(object sender, EventArgs e) { 165 UpdateRegressionLine(); 166 } 167 168 private void UpdateRegressionLine() { 169 var regressionType = (RegressionType)regressionTypeComboBox.SelectedValue; 170 int order = (int)polynomialRegressionOrderNumericUpDown.Value; 171 172 foreach (var row in scatterPlotControl.Content.Rows) { 173 row.VisualProperties.IsRegressionVisibleInLegend = false; 174 row.VisualProperties.RegressionType = regressionType; 175 row.VisualProperties.PolynomialRegressionOrder = order; 176 } 177 } 178 #endregion 146 179 } 147 180 } 181
Note: See TracChangeset
for help on using the changeset viewer.