Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/21/16 11:26:54 (7 years ago)
Author:
pfleck
Message:

#2709

  • Added a VerticalLabel for the multi-scatterplot.
  • Added regression options for single- and multi-scatterplot
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotSingleView.cs

    r14495 r14514  
    2626using HeuristicLab.Core.Views;
    2727using HeuristicLab.MainForm;
     28using RegressionType = HeuristicLab.Analysis.ScatterPlotDataRowVisualProperties.ScatterPlotDataRowRegressionType;
    2829
    2930namespace HeuristicLab.DataPreprocessing.Views {
     
    4041    public ScatterPlotSingleView() {
    4142      InitializeComponent();
     43
     44      regressionTypeComboBox.DataSource = Enum.GetValues(typeof(RegressionType));
     45      regressionTypeComboBox.SelectedItem = RegressionType.None;
    4246    }
    4347
     
    8892        var groupVariable = (string)comboBoxGroup.SelectedItem;
    8993        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) {
    9197          row.VisualProperties.PointSize = 6;
     98          row.VisualProperties.IsRegressionVisibleInLegend = false;
     99          row.VisualProperties.RegressionType = regressionType;
     100          row.VisualProperties.PolynomialRegressionOrder = order;
     101        }
    92102        var vp = scatterPlot.VisualProperties;
    93103        vp.Title = string.Empty;
     
    144154      UpdateScatterPlot();
    145155    }
     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
    146179  }
    147180}
     181
Note: See TracChangeset for help on using the changeset viewer.