Index: trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionResidualsLineChartView.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionResidualsLineChartView.cs	(revision 14890)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionResidualsLineChartView.cs	(revision 14937)
@@ -25,5 +25,4 @@
 using HeuristicLab.MainForm;
 
-
 namespace HeuristicLab.Problems.DataAnalysis.Views {
   [View("Residuals Line Chart")]
@@ -31,8 +30,14 @@
   public partial class RegressionSolutionResidualsLineChartView : RegressionSolutionLineChartViewBase, IDataAnalysisSolutionEvaluationView {
 
+    public RegressionSolutionResidualsLineChartView() : base() {
+      InitializeComponent();
+    }
 
-    public RegressionSolutionResidualsLineChartView()
-      : base() {
-      InitializeComponent();
+    protected void CalcResiduals(int[] idx, double[] x) {
+      var problemData = Content.ProblemData;
+      var target = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, idx).ToArray();
+      for (int i = 0; i < idx.Length; i++) {
+        x[i] = target[i] - x[i];
+      }
     }
 
@@ -41,12 +46,4 @@
       y = Content.EstimatedTrainingValues.ToArray();
       CalcResiduals(idx, y);
-    }
-
-    protected void CalcResiduals(int[] idx, double[] x) {
-      var problemData = Content.ProblemData;
-      var target = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, idx).ToArray();
-      for (int i = 0; i < idx.Length; i++) {
-        x[i] -= target[i];
-      }
     }
 
@@ -69,25 +66,28 @@
 
     private void UpdateSeriesStyle() {
-      if (InvokeRequired) Invoke((Action)UpdateSeriesStyle);
-      else {
-        if (Content == null) return;
-        double[] res;
-        int[] idx;
-        GetTrainingSeries(out idx, out res);
-        base.chart.Series[RegressionSolutionLineChartView.ESTIMATEDVALUES_TRAINING_SERIES_NAME].YAxisType = AxisType.Secondary;
-        base.chart.Series[RegressionSolutionLineChartView.ESTIMATEDVALUES_TRAINING_SERIES_NAME].ChartType = SeriesChartType.RangeColumn;
-        base.chart.Series[RegressionSolutionLineChartView.ESTIMATEDVALUES_TRAINING_SERIES_NAME].Points.DataBindXY(idx, res.Select(_ => 0.0).ToArray(), res);
+      if (Content == null) return;
 
-        GetTestSeries(out idx, out res);
-        base.chart.Series[RegressionSolutionLineChartView.ESTIMATEDVALUES_TEST_SERIES_NAME].YAxisType = AxisType.Secondary;
-        base.chart.Series[RegressionSolutionLineChartView.ESTIMATEDVALUES_TEST_SERIES_NAME].ChartType = SeriesChartType.RangeColumn;
-        base.chart.Series[RegressionSolutionLineChartView.ESTIMATEDVALUES_TEST_SERIES_NAME].Points.DataBindXY(idx, res.Select(_ => 0.0).ToArray(), res);
+      if (InvokeRequired) {
+        Invoke((Action)UpdateSeriesStyle);
+        return;
+      }
 
-        GetAllValuesSeries(out idx, out res);
-        base.chart.Series[RegressionSolutionLineChartView.ESTIMATEDVALUES_ALL_SERIES_NAME].YAxisType = AxisType.Secondary;
-        base.chart.Series[RegressionSolutionLineChartView.ESTIMATEDVALUES_ALL_SERIES_NAME].ChartType = SeriesChartType.RangeColumn;
-        base.chart.Series[RegressionSolutionLineChartView.ESTIMATEDVALUES_ALL_SERIES_NAME].Points.DataBindXY(idx, res.Select(_ => 0.0).ToArray(), res);
-        ToggleSeriesData(base.chart.Series[RegressionSolutionLineChartView.ESTIMATEDVALUES_ALL_SERIES_NAME]); // don't show by default
-      }
+      double[] res;
+      int[] idx;
+      GetTrainingSeries(out idx, out res);
+      chart.Series[ESTIMATEDVALUES_TRAINING_SERIES_NAME].YAxisType = AxisType.Secondary;
+      chart.Series[ESTIMATEDVALUES_TRAINING_SERIES_NAME].ChartType = SeriesChartType.RangeColumn;
+      chart.Series[ESTIMATEDVALUES_TRAINING_SERIES_NAME].Points.DataBindXY(idx, res.Select(_ => 0.0).ToArray(), res);
+
+      GetTestSeries(out idx, out res);
+      chart.Series[ESTIMATEDVALUES_TEST_SERIES_NAME].YAxisType = AxisType.Secondary;
+      chart.Series[ESTIMATEDVALUES_TEST_SERIES_NAME].ChartType = SeriesChartType.RangeColumn;
+      chart.Series[ESTIMATEDVALUES_TEST_SERIES_NAME].Points.DataBindXY(idx, res.Select(_ => 0.0).ToArray(), res);
+
+      GetAllValuesSeries(out idx, out res);
+      chart.Series[ESTIMATEDVALUES_ALL_SERIES_NAME].YAxisType = AxisType.Secondary;
+      chart.Series[ESTIMATEDVALUES_ALL_SERIES_NAME].ChartType = SeriesChartType.RangeColumn;
+      chart.Series[ESTIMATEDVALUES_ALL_SERIES_NAME].Points.DataBindXY(idx, res.Select(_ => 0.0).ToArray(), res);
+      ToggleSeriesData(chart.Series[ESTIMATEDVALUES_ALL_SERIES_NAME]); // don't show by default
     }
 
