Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/04/14 15:32:33 (10 years ago)
Author:
aesterer
Message:

Completed scatter plot view

File:
1 edited

Legend:

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

    r10915 r10952  
    1919
    2020  [View("Single Scatter Plot View")]
    21   [Content(typeof(ScatterPlotContent), false)]
     21  [Content(typeof(ScatterPlotContent), true)]
    2222  public partial class SingleScatterPlotView : ItemView {
    2323
     
    4242      comboBoxYVariable.Items.AddRange(variables.ToArray());
    4343
    44       if (variables.Count() >= 2) {
    45         comboBoxXVariable.SelectedIndex = 0;
    46         comboBoxYVariable.SelectedIndex = 1;
    47         UpdateScatterPlot();
    48        
     44      // use x and y variable from content
     45      if (Content.SelectedXVariable != null && Content.SelectedYVariable != null) {
     46        comboBoxXVariable.SelectedItem = Content.SelectedXVariable;
     47        comboBoxYVariable.SelectedItem = Content.SelectedYVariable;
     48      } else {
     49        if (variables.Count() >= 2) {
     50          comboBoxXVariable.SelectedIndex = 0;
     51          comboBoxYVariable.SelectedIndex = 1;
     52          UpdateScatterPlot();
     53
     54        }
    4955      }
    5056
     
    6773        ScatterPlot scatterPlot = logic.CreateScatterPlot((string)comboBoxXVariable.SelectedItem, (string)comboBoxYVariable.SelectedItem);
    6874        scatterPlotView.Content = scatterPlot;
     75
     76        //save selected x and y variable in content
     77        this.Content.SelectedXVariable = (string)comboBoxXVariable.SelectedItem;
     78        this.Content.SelectedYVariable = (string)comboBoxYVariable.SelectedItem;
    6979      }
    7080    }
Note: See TracChangeset for help on using the changeset viewer.