Ignore:
Timestamp:
12/09/16 15:19:30 (4 years ago)
Author:
pfleck
Message:

#2709

  • Fixed bugs with double-click on view shortcut.
  • Reuse visual properties for single scatterplot.
File:
1 edited

Legend:

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

    r14467 r14470  
    8282    }
    8383
    84     private void comboBox_SelectedIndexChanged(object sender, EventArgs e) {
    85       UpdateScatterPlot();
    86     }
    87 
    8884    private void UpdateScatterPlot() {
    8985      if (comboBoxXVariable.SelectedItem != null && comboBoxYVariable.SelectedItem != null && comboBoxGroup.SelectedItem != null) {
     
    105101      }
    106102    }
     103
     104    private void comboBoxXVariable_SelectedIndexChanged(object sender, EventArgs e) {
     105      var oldPlot = scatterPlotControl.Content;
     106      UpdateScatterPlot();
     107      var newPlot = scatterPlotControl.Content;
     108
     109
     110      if (oldPlot == null || newPlot == null) return;
     111      newPlot.VisualProperties.YAxisMinimumAuto = oldPlot.VisualProperties.YAxisMinimumAuto;
     112      newPlot.VisualProperties.YAxisMaximumAuto = oldPlot.VisualProperties.YAxisMaximumAuto;
     113      newPlot.VisualProperties.YAxisMinimumFixedValue = oldPlot.VisualProperties.YAxisMinimumFixedValue;
     114      newPlot.VisualProperties.YAxisMaximumFixedValue = oldPlot.VisualProperties.YAxisMaximumFixedValue;
     115
     116      foreach (var x in newPlot.Rows.Zip(oldPlot.Rows, (nr, or) => new { nr, or })) {
     117        x.nr.VisualProperties.PointSize = x.or.VisualProperties.PointSize;
     118        x.nr.VisualProperties.PointStyle = x.or.VisualProperties.PointStyle;
     119        x.nr.VisualProperties.Color = x.or.VisualProperties.Color;
     120      }
     121    }
     122
     123    private void comboBoxYVariable_SelectedIndexChanged(object sender, EventArgs e) {
     124      var oldPlot = scatterPlotControl.Content;
     125      UpdateScatterPlot();
     126      var newPlot = scatterPlotControl.Content;
     127
     128      if (oldPlot == null || newPlot == null) return;
     129      newPlot.VisualProperties.XAxisMinimumAuto = oldPlot.VisualProperties.XAxisMinimumAuto;
     130      newPlot.VisualProperties.XAxisMaximumAuto = oldPlot.VisualProperties.XAxisMaximumAuto;
     131      newPlot.VisualProperties.XAxisMinimumFixedValue = oldPlot.VisualProperties.XAxisMinimumFixedValue;
     132      newPlot.VisualProperties.XAxisMaximumFixedValue = oldPlot.VisualProperties.XAxisMaximumFixedValue;
     133
     134      foreach (var x in newPlot.Rows.Zip(oldPlot.Rows, (nr, or) => new { nr, or })) {
     135        x.nr.VisualProperties.PointSize = x.or.VisualProperties.PointSize;
     136        x.nr.VisualProperties.PointStyle = x.or.VisualProperties.PointStyle;
     137        x.nr.VisualProperties.Color = x.or.VisualProperties.Color;
     138      }
     139    }
     140
     141    private void comboBoxGroup_SelectedIndexChanged(object sender, EventArgs e) {
     142      UpdateScatterPlot();
     143    }
    107144  }
    108145}
Note: See TracChangeset for help on using the changeset viewer.