Index: /branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingChartView.cs
===================================================================
--- /branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingChartView.cs	(revision 10971)
+++ /branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingChartView.cs	(revision 10972)
@@ -48,4 +48,6 @@
 
     private const string DEFAULT_CHART_TITLE = "Chart";
+    private const int FIXED_CHART_SIZE = 300;
+    private const int MAX_TABLE_ROWS = 3;
 
     public IEnumerable<double> Classification { get; set; }
@@ -57,4 +59,6 @@
     }
 
+    //Variable selection changed
+    //Add or remove data row
     private void CheckedItemsChanged(object sender, CollectionItemsChangedEventArgs<IndexedItem<StringValue>> checkedItems) {
       foreach (IndexedItem<StringValue> item in checkedItems.Items) {
@@ -71,15 +75,19 @@
           DataRow selectedRow = GetSelectedDataRow(variableName);
           dataTable.Rows.Add(row);
-          PreprocessingDataTable d = new PreprocessingDataTable(variableName);
-          d.Rows.Add(row);
-          dataTablePerVariable.Add(d);
+
+          PreprocessingDataTable pdt = new PreprocessingDataTable(variableName);
+          pdt.Rows.Add(row);
+          dataTablePerVariable.Add(pdt);
+
+          //update selection
           if (selectedRow != null)
           {
             dataTable.SelectedRows.Add(selectedRow);
-            d.SelectedRows.Add(selectedRow);
+            pdt.SelectedRows.Add(selectedRow);
         }
       }
       }
 
+      // update chart if not in all in one mode
       if (Content != null && !Content.AllInOneMode)
         GenerateChart();
@@ -120,6 +128,7 @@
       }
       checkedItemList.Content = Content.VariableItemList;
+
+      //Create data tables and data rows
       dataRows = logic.CreateAllDataRows(chartType);
-
       dataTable = new PreprocessingDataTable(chartTitle);
       dataTablePerVariable = new List<PreprocessingDataTable>();
@@ -261,5 +270,4 @@
 
       ClearTableLayout();
-
       if (Content.AllInOneMode)
       {
@@ -289,4 +297,27 @@
     }
 
+    private int GetNrOfMultiChartColumns(int itemCount) {
+      int columns = 0;
+      if (itemCount <= 2)
+        columns = 1;
+      else if (itemCount <= 6)
+        columns = 2;
+      else
+        columns = 3;
+      return columns;
+    }
+
+    private int GetNrOfMultiChartRows(int itemCount, int columns) {
+      int rows = 0;
+      if (columns == 3)
+        rows = (itemCount + 2) / columns;
+      else if (columns == 2)
+        rows = (itemCount + 1) / columns;
+      else
+        rows = itemCount / columns;
+      return rows;
+    }
+
+
     private void GenerateMultiChartLayout() {
       int checkedItemsCnt = 0;
@@ -294,23 +325,8 @@
         checkedItemsCnt++;
 
-      int rows = 0;
-      int columns = 0;
-
       // set columns and rows based on number of items
-      if (checkedItemsCnt <= 2)
-        columns = 1;
-      else if (checkedItemsCnt <= 6)
-        columns = 2;
-      else
-        columns = 3;
-
-      if (columns == 3)
-        rows = (checkedItemsCnt + 2) / columns;
-      else if (columns == 2)
-        rows = (checkedItemsCnt + 1) / columns;
-      else
-        rows = checkedItemsCnt / columns;
-
-      //Now we will generate the table, setting up the row and column counts first
+      int columns = GetNrOfMultiChartColumns(checkedItemsCnt);
+      int rows = GetNrOfMultiChartRows(checkedItemsCnt, columns);
+      
       tableLayoutPanel.ColumnCount = columns;
       tableLayoutPanel.RowCount = rows;
@@ -319,5 +335,5 @@
       for (int x = 0; x < columns; x++) {
 
-        if (rows <= 3)
+        if (rows <= MAX_TABLE_ROWS)
           tableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100 / columns));
         else
@@ -328,25 +344,31 @@
           if (x == 0) {
             // fixed chart size when there are more than 3 tables
-            if (rows > 3)
-              tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, 300));
+            if (rows > MAX_TABLE_ROWS)
+              tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, FIXED_CHART_SIZE));
             else
               tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 100 / rows));
           }
 
-          PreprocessingDataTableView dataView = new PreprocessingDataTableView();
-          dataView.Classification = Classification;
           enumerator.MoveNext();
           PreprocessingDataTable d = enumerator.Current;
-          if (d == null) {
-            // dummy panel for empty field 
-            Panel p = new Panel();
-            p.Dock = DockStyle.Fill;
-            tableLayoutPanel.Controls.Add(p, y, x);
-          } else {
-            dataView.Content = d;
-            dataView.Dock = DockStyle.Fill;
-            tableLayoutPanel.Controls.Add(dataView, y, x);
-          }
+          AddDataTableToTableLayout(d, x, y);
+          
         }
+      }
+    }
+
+    private void AddDataTableToTableLayout(PreprocessingDataTable dataTable, int x, int y) {
+      PreprocessingDataTableView dataView = new PreprocessingDataTableView();
+      dataView.Classification = Classification;
+
+      if (dataTable == null) {
+        // dummy panel for empty field 
+        Panel p = new Panel();
+        p.Dock = DockStyle.Fill;
+        tableLayoutPanel.Controls.Add(p, y, x);
+      } else {
+        dataView.Content = dataTable;
+        dataView.Dock = DockStyle.Fill;
+        tableLayoutPanel.Controls.Add(dataView, y, x);
       }
     }
@@ -364,13 +386,4 @@
     }
 
-    private void radioButton1_CheckedChanged(object sender, EventArgs e) {
-      if (Content.AllInOneMode == false)
-        Content.AllInOneMode = true;
-      else
-        Content.AllInOneMode = false;
-      GenerateChart();
-    }
-
-
   }
 }
Index: /branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.4/SingleScatterPlotView.cs
===================================================================
--- /branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.4/SingleScatterPlotView.cs	(revision 10971)
+++ /branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.4/SingleScatterPlotView.cs	(revision 10972)
@@ -36,7 +36,8 @@
 
       IEnumerable<string> variables = logic.GetVariableNames();
+
+      // add variables to combo boxes
       comboBoxXVariable.Items.Clear();
       comboBoxYVariable.Items.Clear();
-
       comboBoxXVariable.Items.AddRange(variables.ToArray());
       comboBoxYVariable.Items.AddRange(variables.ToArray());
@@ -54,5 +55,4 @@
         }
       }
-
     }
 
@@ -71,4 +71,5 @@
     private void UpdateScatterPlot() {
       if (comboBoxXVariable.SelectedItem != null && comboBoxYVariable.SelectedItem != null) {
+        //get scatter plot with selected x and y variable
         ScatterPlot scatterPlot = logic.CreateScatterPlot((string)comboBoxXVariable.SelectedItem, (string)comboBoxYVariable.SelectedItem);
         scatterPlotView.Content = scatterPlot;
