Changeset 14467 for branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotSingleView.cs
- Timestamp:
- 12/09/16 11:35:42 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotSingleView.cs
r14446 r14467 30 30 31 31 [View("Scatter Plot Single View")] 32 [Content(typeof(S catterPlotContent), true)]32 [Content(typeof(SingleScatterPlotContent), true)] 33 33 public partial class ScatterPlotSingleView : ItemView { 34 34 35 public new S catterPlotContent Content {36 get { return (S catterPlotContent)base.Content; }35 public new SingleScatterPlotContent Content { 36 get { return (SingleScatterPlotContent)base.Content; } 37 37 set { base.Content = value; } 38 38 } … … 48 48 comboBoxXVariable.Items.Clear(); 49 49 comboBoxYVariable.Items.Clear(); 50 comboBox Color.Items.Clear();50 comboBoxGroup.Items.Clear(); 51 51 comboBoxXVariable.Items.AddRange(variables.ToArray()); 52 52 comboBoxYVariable.Items.AddRange(variables.ToArray()); 53 comboBox Color.Items.Add("-");53 comboBoxGroup.Items.Add("-"); 54 54 for (int i = 0; i < Content.PreprocessingData.Columns; ++i) { 55 55 if (Content.PreprocessingData.VariableHasType<double>(i)) { 56 56 double distinctValueCount = Content.PreprocessingData.GetValues<double>(i).GroupBy(x => x).Count(); 57 57 if (distinctValueCount <= 20) 58 comboBox Color.Items.Add(Content.PreprocessingData.GetVariableName(i));58 comboBoxGroup.Items.Add(Content.PreprocessingData.GetVariableName(i)); 59 59 } 60 60 } 61 61 62 62 // use x and y variable from content 63 if (Content.SelectedXVariable != null && Content.SelectedYVariable != null && Content.Selected ColorVariable != null) {63 if (Content.SelectedXVariable != null && Content.SelectedYVariable != null && Content.SelectedGroupVariable != null) { 64 64 comboBoxXVariable.SelectedItem = Content.SelectedXVariable; 65 65 comboBoxYVariable.SelectedItem = Content.SelectedYVariable; 66 comboBox Color.SelectedItem = Content.SelectedColorVariable;66 comboBoxGroup.SelectedItem = Content.SelectedGroupVariable; 67 67 } else { 68 68 if (variables.Count() >= 2) { 69 69 comboBoxXVariable.SelectedIndex = 0; 70 70 comboBoxYVariable.SelectedIndex = 1; 71 comboBox Color.SelectedIndex = 0;71 comboBoxGroup.SelectedIndex = 0; 72 72 UpdateScatterPlot(); 73 73 } … … 87 87 88 88 private void UpdateScatterPlot() { 89 if (comboBoxXVariable.SelectedItem != null && comboBoxYVariable.SelectedItem != null && comboBox Color.SelectedItem != null) {89 if (comboBoxXVariable.SelectedItem != null && comboBoxYVariable.SelectedItem != null && comboBoxGroup.SelectedItem != null) { 90 90 var xVariable = (string)comboBoxXVariable.SelectedItem; 91 91 var yVariable = (string)comboBoxYVariable.SelectedItem; 92 var colorVariable = (string)comboBoxColor.SelectedItem;93 ScatterPlot scatterPlot = Content.CreateScatterPlot(xVariable, yVariable, colorVariable);92 var groupVariable = (string)comboBoxGroup.SelectedItem; 93 ScatterPlot scatterPlot = Content.CreateScatterPlot(xVariable, yVariable, groupVariable); 94 94 var vp = scatterPlot.VisualProperties; 95 95 vp.Title = string.Empty; … … 98 98 99 99 scatterPlotControl.Content = scatterPlot; 100 100 101 101 //save selected x and y variable in content 102 102 this.Content.SelectedXVariable = (string)comboBoxXVariable.SelectedItem; 103 103 this.Content.SelectedYVariable = (string)comboBoxYVariable.SelectedItem; 104 this.Content.Selected ColorVariable = (string)comboBoxColor.SelectedItem;104 this.Content.SelectedGroupVariable = (string)comboBoxGroup.SelectedItem; 105 105 } 106 106 }
Note: See TracChangeset
for help on using the changeset viewer.