Index: /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/HistogramView.cs
===================================================================
--- /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/HistogramView.cs	(revision 14724)
+++ /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/HistogramView.cs	(revision 14725)
@@ -21,5 +21,4 @@
 
 using System;
-using System.Linq;
 using HeuristicLab.Analysis;
 using HeuristicLab.MainForm;
@@ -46,5 +45,5 @@
 
       if (Content != null) {
-        foreach (string var in GetVariableNamesForGrouping(Content.PreprocessingData)) {
+        foreach (string var in PreprocessingChartContent.GetVariableNamesForGrouping(Content.PreprocessingData)) {
           classifierComboBox.Items.Add(var);
         }
@@ -55,40 +54,7 @@
 
     protected override DataTable CreateDataTable(string variableName) {
-      var dataTable = new DataTable();
-
-      if (string.IsNullOrEmpty(Content.GroupingVariableName)) {
-        var row = Content.CreateDataRow(variableName, DataRowVisualProperties.DataRowChartType.Histogram);
-        dataTable.Rows.Add(row);
-        return dataTable;
-      }
-
-      dataTable.VisualProperties.Title = variableName;
-
-      int variableIndex = Content.PreprocessingData.GetColumnIndex(variableName);
-      var variableValues = Content.PreprocessingData.GetValues<double>(variableIndex);
-      int groupVariableIndex = Content.PreprocessingData.GetColumnIndex(Content.GroupingVariableName);
-      var groupingValues = Enumerable.Empty<string>();
-
-      if (Content.PreprocessingData.VariableHasType<double>(groupVariableIndex)) {
-        groupingValues = Content.PreprocessingData.GetValues<double>(groupVariableIndex).Select(x => x.ToString());
-      } else if (Content.PreprocessingData.VariableHasType<string>(groupVariableIndex)) {
-        groupingValues = Content.PreprocessingData.GetValues<string>(groupVariableIndex);
-      } else if (Content.PreprocessingData.VariableHasType<DateTime>(groupVariableIndex)) {
-        groupingValues = Content.PreprocessingData.GetValues<DateTime>(groupVariableIndex).Select(x => x.ToString());
-      }
-
-      var groups = groupingValues.Zip(variableValues, Tuple.Create).GroupBy(t => t.Item1, t => t.Item2);
-
-      foreach (var group in groups) {
-        var classRow = new DataRow();
-        classRow.Name = group.Key;
-        classRow.VisualProperties.ChartType = DataRowVisualProperties.DataRowChartType.Histogram;
-        classRow.VisualProperties.Aggregation = (DataRowVisualProperties.DataRowHistogramAggregation)aggregationComboBox.SelectedItem;
-        classRow.Values.AddRange(group);
-        dataTable.Rows.Add(classRow);
-      }
-      return dataTable;
+      var aggregation = (DataRowVisualProperties.DataRowHistogramAggregation)aggregationComboBox.SelectedItem;
+      return HistogramContent.CreateHistogram(Content.PreprocessingData, variableName, Content.GroupingVariableName, aggregation);
     }
-
 
     private void classifierComboBox_SelectedIndexChanged(object sender, EventArgs e) {
Index: /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingChartView.cs
===================================================================
--- /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingChartView.cs	(revision 14724)
+++ /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingChartView.cs	(revision 14725)
@@ -35,6 +35,5 @@
   [View("Preprocessing Chart View")]
   [Content(typeof(PreprocessingChartContent), false)]
-  public partial class PreprocessingChartView : PreprocessingCheckedVariablesView {
-    private const int MAX_DISTINCT_VALUES_FOR_GROUPING = 20;
+  public partial class PreprocessingChartView : PreprocessingCheckedVariablesView {  
     protected Dictionary<string, DataTable> dataTables;
     protected Dictionary<string, DataTableControl> dataTableControls;
@@ -64,22 +63,4 @@
         GenerateLayout();
       }
-    }
-
-    protected static IEnumerable<string> GetVariableNamesForGrouping(IPreprocessingData preprocessingData) {
-      var variableNames = new List<string>();
-
-      for (int i = 0; i < preprocessingData.Columns; ++i) {
-        int distinctValues = Int32.MaxValue;
-        if (preprocessingData.VariableHasType<double>(i))
-          distinctValues = preprocessingData.GetValues<double>(i).GroupBy(x => x).Count();
-        else if (preprocessingData.VariableHasType<string>(i))
-          distinctValues = preprocessingData.GetValues<string>(i).GroupBy(x => x).Count();
-        else if (preprocessingData.VariableHasType<DateTime>(i))
-          distinctValues = preprocessingData.GetValues<DateTime>(i).GroupBy(x => x).Count();
-
-        if (distinctValues <= MAX_DISTINCT_VALUES_FOR_GROUPING)
-          variableNames.Add(preprocessingData.GetVariableName(i));
-      }
-      return variableNames;
     }
 
Index: /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotMultiView.Designer.cs
===================================================================
--- /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotMultiView.Designer.cs	(revision 14724)
+++ /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotMultiView.Designer.cs	(revision 14725)
@@ -62,4 +62,6 @@
       this.orderLabel = new System.Windows.Forms.Label();
       this.label4 = new System.Windows.Forms.Label();
+      this.groupingOptionsBox = new System.Windows.Forms.GroupBox();
+      this.groupingComboBox = new System.Windows.Forms.ComboBox();
       ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
       this.splitContainer.Panel1.SuspendLayout();
@@ -75,4 +77,5 @@
       this.regressionGroupBox.SuspendLayout();
       ((System.ComponentModel.ISupportInitialize)(this.polynomialRegressionOrderNumericUpDown)).BeginInit();
+      this.groupingOptionsBox.SuspendLayout();
       this.SuspendLayout();
       // 
@@ -83,4 +86,5 @@
       // 
       this.splitContainer.Panel1.Controls.Add(this.sizeGroupBox);
+      this.splitContainer.Panel1.Controls.Add(this.groupingOptionsBox);
       this.splitContainer.Panel1.Controls.Add(this.regressionGroupBox);
       // 
@@ -195,5 +199,5 @@
       this.sizeGroupBox.Controls.Add(this.widthTrackBar);
       this.sizeGroupBox.Dock = System.Windows.Forms.DockStyle.Bottom;
-      this.sizeGroupBox.Location = new System.Drawing.Point(0, 198);
+      this.sizeGroupBox.Location = new System.Drawing.Point(0, 154);
       this.sizeGroupBox.Name = "sizeGroupBox";
       this.sizeGroupBox.Size = new System.Drawing.Size(180, 130);
@@ -319,4 +323,27 @@
       this.label4.TabIndex = 13;
       this.label4.Text = "Type:";
+      // 
+      // groupingOptionsBox
+      // 
+      this.groupingOptionsBox.Controls.Add(this.groupingComboBox);
+      this.groupingOptionsBox.Dock = System.Windows.Forms.DockStyle.Bottom;
+      this.groupingOptionsBox.Location = new System.Drawing.Point(0, 284);
+      this.groupingOptionsBox.Name = "groupingOptionsBox";
+      this.groupingOptionsBox.Size = new System.Drawing.Size(180, 44);
+      this.groupingOptionsBox.TabIndex = 8;
+      this.groupingOptionsBox.TabStop = false;
+      this.groupingOptionsBox.Text = "Grouping Variable";
+      // 
+      // groupingComboBox
+      // 
+      this.groupingComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+      this.groupingComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+      this.groupingComboBox.FormattingEnabled = true;
+      this.groupingComboBox.Location = new System.Drawing.Point(6, 19);
+      this.groupingComboBox.Name = "groupingComboBox";
+      this.groupingComboBox.Size = new System.Drawing.Size(169, 21);
+      this.groupingComboBox.TabIndex = 1;
+      this.groupingComboBox.SelectedIndexChanged += new System.EventHandler(this.groupingComboBox_SelectedIndexChanged);
       // 
       // ScatterPlotMultiView
@@ -343,4 +370,5 @@
       this.regressionGroupBox.PerformLayout();
       ((System.ComponentModel.ISupportInitialize)(this.polynomialRegressionOrderNumericUpDown)).EndInit();
+      this.groupingOptionsBox.ResumeLayout(false);
       this.ResumeLayout(false);
 
@@ -366,4 +394,6 @@
     private System.Windows.Forms.Label orderLabel;
     private System.Windows.Forms.Label label4;
+    private System.Windows.Forms.GroupBox groupingOptionsBox;
+    private System.Windows.Forms.ComboBox groupingComboBox;
   }
 }
Index: /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotMultiView.cs
===================================================================
--- /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotMultiView.cs	(revision 14724)
+++ /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotMultiView.cs	(revision 14725)
@@ -55,4 +55,10 @@
       base.OnContentChanged();
       if (Content != null) {
+        groupingComboBox.Items.Add("");
+        foreach (string var in PreprocessingChartContent.GetVariableNamesForGrouping(Content.PreprocessingData)) {
+          groupingComboBox.Items.Add(var);
+        }
+        groupingComboBox.SelectedItem = Content.GroupingVariable;
+
         GenerateCharts();
       }
@@ -261,8 +267,8 @@
       if (!bodyCache.ContainsKey(key)) {
         if (rowVariable == colVariable) { // use historgram if x and y variable are equal
-          var dataTable = new DataTable();
-          DataRow dataRow = Content.CreateDataRow(rowVariable, DataRowVisualProperties.DataRowChartType.Histogram);
-          dataRow.VisualProperties.IsVisibleInLegend = false;
-          dataTable.Rows.Add(dataRow);
+          var dataTable = HistogramContent.CreateHistogram(Content.PreprocessingData, rowVariable, (string)groupingComboBox.SelectedItem, DataRowVisualProperties.DataRowHistogramAggregation.Overlapping);
+          foreach (var dataRow in dataTable.Rows)
+            dataRow.VisualProperties.IsVisibleInLegend = false;
+
           var pcv = new DataTableControl {
             Name = key.ToString(),
@@ -275,5 +281,5 @@
           bodyCache.Add(key, pcv);
         } else { //scatter plot
-          var scatterPlot = Content.CreateScatterPlot(colVariable, rowVariable);
+          var scatterPlot = ScatterPlotContent.CreateScatterPlot(Content.PreprocessingData, colVariable, rowVariable, (string)groupingComboBox.SelectedItem);
           var regressionType = (RegressionType)regressionTypeComboBox.SelectedValue;
           int order = (int)polynomialRegressionOrderNumericUpDown.Value;
@@ -486,4 +492,8 @@
     }
     #endregion
+
+    private void groupingComboBox_SelectedIndexChanged(object sender, EventArgs e) {
+      GenerateCharts();
+    }
   }
 }
Index: /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotSingleView.Designer.cs
===================================================================
--- /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotSingleView.Designer.cs	(revision 14724)
+++ /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotSingleView.Designer.cs	(revision 14725)
@@ -144,5 +144,5 @@
       // comboBoxGroup
       // 
-      this.comboBoxGroup.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+      this.comboBoxGroup.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
             | System.Windows.Forms.AnchorStyles.Right)));
       this.comboBoxGroup.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest;
@@ -159,5 +159,5 @@
       // comboBoxYVariable
       // 
-      this.comboBoxYVariable.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+      this.comboBoxYVariable.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
             | System.Windows.Forms.AnchorStyles.Right)));
       this.comboBoxYVariable.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest;
@@ -173,5 +173,5 @@
       // comboBoxXVariable
       // 
-      this.comboBoxXVariable.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+      this.comboBoxXVariable.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
             | System.Windows.Forms.AnchorStyles.Right)));
       this.comboBoxXVariable.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest;
@@ -201,5 +201,5 @@
       // regressionTypeComboBox
       // 
-      this.regressionTypeComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+      this.regressionTypeComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
             | System.Windows.Forms.AnchorStyles.Right)));
       this.regressionTypeComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
@@ -213,5 +213,5 @@
       // polynomialRegressionOrderNumericUpDown
       // 
-      this.polynomialRegressionOrderNumericUpDown.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+      this.polynomialRegressionOrderNumericUpDown.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
             | System.Windows.Forms.AnchorStyles.Right)));
       this.polynomialRegressionOrderNumericUpDown.Location = new System.Drawing.Point(51, 47);
@@ -288,5 +288,5 @@
       // gradientPictureBox
       // 
-      this.gradientPictureBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+      this.gradientPictureBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
             | System.Windows.Forms.AnchorStyles.Left)));
       this.gradientPictureBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
@@ -363,5 +363,5 @@
     private System.Windows.Forms.Label gradientMinimumLabel;
     private System.Windows.Forms.Label gradientMaximumLabel;
-    protected System.Windows.Forms.PictureBox gradientPictureBox;
+    private System.Windows.Forms.PictureBox gradientPictureBox;
   }
 }
Index: /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotSingleView.cs
===================================================================
--- /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotSingleView.cs	(revision 14724)
+++ /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotSingleView.cs	(revision 14725)
@@ -36,5 +36,4 @@
   [Content(typeof(SingleScatterPlotContent), true)]
   public sealed partial class ScatterPlotSingleView : ItemView {
-    private const int MAX_DISTINCT_VALUES_FOR_GROUPING = 20;
     private readonly string NoGroupItem = "";
 
@@ -74,14 +73,14 @@
       comboBoxYVariable.Items.AddRange(variables.ToArray());
       comboBoxGroup.Items.Add(NoGroupItem);
-      foreach (string var in GetVariableNamesForGrouping(Content.PreprocessingData)) {
+      foreach (string var in PreprocessingChartContent.GetVariableNamesForGrouping(Content.PreprocessingData)) {
         comboBoxGroup.Items.Add(var);
       }
-      comboBoxGroup.SelectedItem = Content.SelectedGroupVariable;
+      comboBoxGroup.SelectedItem = Content.GroupingVariable;
 
       // use x and y variable from content
-      if (Content.SelectedXVariable != null && Content.SelectedYVariable != null && Content.SelectedGroupVariable != null) {
+      if (Content.SelectedXVariable != null && Content.SelectedYVariable != null && Content.GroupingVariable != null) {
         comboBoxXVariable.SelectedItem = Content.SelectedXVariable;
         comboBoxYVariable.SelectedItem = Content.SelectedYVariable;
-        comboBoxGroup.SelectedItem = Content.SelectedGroupVariable;
+        comboBoxGroup.SelectedItem = Content.GroupingVariable;
       } else {
         if (variables.Count() >= 2) {
@@ -100,5 +99,5 @@
         var groupVariable = (string)comboBoxGroup.SelectedItem;
 
-        ScatterPlot scatterPlot = Content.CreateScatterPlot(xVariable, yVariable, groupVariable);
+        ScatterPlot scatterPlot = ScatterPlotContent.CreateScatterPlot(Content.PreprocessingData, xVariable, yVariable, groupVariable);
         //rows are saved and removed to avoid firing of visual property changed events
         var rows = scatterPlot.Rows.ToList();
@@ -124,5 +123,5 @@
         this.Content.SelectedXVariable = (string)comboBoxXVariable.SelectedItem;
         this.Content.SelectedYVariable = (string)comboBoxYVariable.SelectedItem;
-        this.Content.SelectedGroupVariable = (string)comboBoxGroup.SelectedItem;
+        this.Content.GroupingVariable = (string)comboBoxGroup.SelectedItem;
       }
     }
@@ -241,22 +240,4 @@
       return colors[index];
     }
-
-    private static IEnumerable<string> GetVariableNamesForGrouping(IPreprocessingData preprocessingData) {
-      var variableNames = new List<string>();
-
-      for (int i = 0; i < preprocessingData.Columns; ++i) {
-        int distinctValues = Int32.MaxValue;
-        if (preprocessingData.VariableHasType<double>(i))
-          distinctValues = preprocessingData.GetValues<double>(i).GroupBy(x => x).Count();
-        else if (preprocessingData.VariableHasType<string>(i))
-          distinctValues = preprocessingData.GetValues<string>(i).GroupBy(x => x).Count();
-        else if (preprocessingData.VariableHasType<DateTime>(i))
-          distinctValues = preprocessingData.GetValues<DateTime>(i).GroupBy(x => x).Count();
-
-        if (distinctValues <= MAX_DISTINCT_VALUES_FOR_GROUPING)
-          variableNames.Add(preprocessingData.GetVariableName(i));
-      }
-      return variableNames;
-    }
   }
 }
Index: /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing/3.4/Content/HistogramContent.cs
===================================================================
--- /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing/3.4/Content/HistogramContent.cs	(revision 14724)
+++ /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing/3.4/Content/HistogramContent.cs	(revision 14725)
@@ -20,5 +20,8 @@
 #endregion
 
+using System;
 using System.Drawing;
+using System.Linq;
+using HeuristicLab.Analysis;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
@@ -49,4 +52,43 @@
     }
 
+    public static DataTable CreateHistogram(IFilteredPreprocessingData preprocessingData, string variableName, string groupingVariableName, DataRowVisualProperties.DataRowHistogramAggregation aggregation) {
+      {
+        var dataTable = new DataTable();
+
+        if (string.IsNullOrEmpty(groupingVariableName)) {
+          var row = PreprocessingChartContent.CreateDataRow(preprocessingData, variableName, DataRowVisualProperties.DataRowChartType.Histogram);
+          dataTable.Rows.Add(row);
+          return dataTable;
+        }
+
+        dataTable.VisualProperties.Title = variableName;
+
+        int variableIndex = preprocessingData.GetColumnIndex(variableName);
+        var variableValues = preprocessingData.GetValues<double>(variableIndex);
+        int groupVariableIndex = preprocessingData.GetColumnIndex(groupingVariableName);
+        var groupingValues = Enumerable.Empty<string>();
+
+        if (preprocessingData.VariableHasType<double>(groupVariableIndex)) {
+          groupingValues = preprocessingData.GetValues<double>(groupVariableIndex).Select(x => x.ToString());
+        } else if (preprocessingData.VariableHasType<string>(groupVariableIndex)) {
+          groupingValues = preprocessingData.GetValues<string>(groupVariableIndex);
+        } else if (preprocessingData.VariableHasType<DateTime>(groupVariableIndex)) {
+          groupingValues = preprocessingData.GetValues<DateTime>(groupVariableIndex).Select(x => x.ToString());
+        }
+
+        var groups = groupingValues.Zip(variableValues, Tuple.Create).GroupBy(t => t.Item1, t => t.Item2);
+
+        foreach (var group in groups) {
+          var classRow = new DataRow();
+          classRow.Name = group.Key;
+          classRow.VisualProperties.ChartType = DataRowVisualProperties.DataRowChartType.Histogram;
+          classRow.VisualProperties.Aggregation = aggregation;
+          classRow.Values.AddRange(group);
+          dataTable.Rows.Add(classRow);
+        }
+        return dataTable;
+      }
+    }
+
 
   }
Index: /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing/3.4/Content/PreprocessingChartContent.cs
===================================================================
--- /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing/3.4/Content/PreprocessingChartContent.cs	(revision 14724)
+++ /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing/3.4/Content/PreprocessingChartContent.cs	(revision 14725)
@@ -66,5 +66,9 @@
 
     public DataRow CreateDataRow(string variableName, DataRowVisualProperties.DataRowChartType chartType) {
-      IList<double> values = PreprocessingData.GetValues<double>(PreprocessingData.GetColumnIndex(variableName));
+      return CreateDataRow(PreprocessingData, variableName, chartType);
+    }
+
+    public static DataRow CreateDataRow(IFilteredPreprocessingData preprocessingData, string variableName, DataRowVisualProperties.DataRowChartType chartType) {
+      IList<double> values = preprocessingData.GetValues<double>(preprocessingData.GetColumnIndex(variableName));
       DataRow row = new DataRow(variableName, "", values);
       row.VisualProperties.ChartType = chartType;
@@ -81,4 +85,23 @@
       return new ReadOnlyCheckedItemList<StringValue>(itemList);
     }
+
+    private const int MAX_DISTINCT_VALUES_FOR_GROUPING = 20;
+    public static IEnumerable<string> GetVariableNamesForGrouping(IPreprocessingData preprocessingData) {
+      var variableNames = new List<string>();
+
+      for (int i = 0; i < preprocessingData.Columns; ++i) {
+        int distinctValues = Int32.MaxValue;
+        if (preprocessingData.VariableHasType<double>(i))
+          distinctValues = preprocessingData.GetValues<double>(i).GroupBy(x => x).Count();
+        else if (preprocessingData.VariableHasType<string>(i))
+          distinctValues = preprocessingData.GetValues<string>(i).GroupBy(x => x).Count();
+        else if (preprocessingData.VariableHasType<DateTime>(i))
+          distinctValues = preprocessingData.GetValues<DateTime>(i).GroupBy(x => x).Count();
+
+        if (distinctValues <= MAX_DISTINCT_VALUES_FOR_GROUPING)
+          variableNames.Add(preprocessingData.GetVariableName(i));
+      }
+      return variableNames;
+    }
   }
 }
Index: /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing/3.4/Content/ScatterPlotContent.cs
===================================================================
--- /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing/3.4/Content/ScatterPlotContent.cs	(revision 14724)
+++ /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing/3.4/Content/ScatterPlotContent.cs	(revision 14725)
@@ -30,4 +30,6 @@
 
   public abstract class ScatterPlotContent : PreprocessingChartContent {
+    public string GroupingVariable { get; set; }
+
     protected ScatterPlotContent(IFilteredPreprocessingData preprocessingData)
       : base(preprocessingData) {
@@ -38,9 +40,9 @@
     }
 
-    public ScatterPlot CreateScatterPlot(string variableNameX, string variableNameY, string variableNameGroup = "-") {
+    public static ScatterPlot CreateScatterPlot(IFilteredPreprocessingData preprocessingData, string variableNameX, string variableNameY, string variableNameGroup = "-") {
       ScatterPlot scatterPlot = new ScatterPlot();
 
-      IList<double> xValues = PreprocessingData.GetValues<double>(PreprocessingData.GetColumnIndex(variableNameX));
-      IList<double> yValues = PreprocessingData.GetValues<double>(PreprocessingData.GetColumnIndex(variableNameY));
+      IList<double> xValues = preprocessingData.GetValues<double>(preprocessingData.GetColumnIndex(variableNameX));
+      IList<double> yValues = preprocessingData.GetValues<double>(preprocessingData.GetColumnIndex(variableNameY));
 
       var points = xValues.Zip(yValues, (x, y) => new Point2D<double>(x, y)).ToList();
@@ -77,13 +79,13 @@
 
       //Grouping
-      int groupVariableIndex = PreprocessingData.GetColumnIndex(variableNameGroup);
+      int groupVariableIndex = preprocessingData.GetColumnIndex(variableNameGroup);
       var groupingValues = Enumerable.Empty<string>();
 
-      if (PreprocessingData.VariableHasType<double>(groupVariableIndex)) {
-        groupingValues = PreprocessingData.GetValues<double>(groupVariableIndex).Select(x => x.ToString());
-      } else if (PreprocessingData.VariableHasType<string>(groupVariableIndex)) {
-        groupingValues = PreprocessingData.GetValues<string>(groupVariableIndex);
-      } else if (PreprocessingData.VariableHasType<DateTime>(groupVariableIndex)) {
-        groupingValues = PreprocessingData.GetValues<DateTime>(groupVariableIndex).Select(x => x.ToString());
+      if (preprocessingData.VariableHasType<double>(groupVariableIndex)) {
+        groupingValues = preprocessingData.GetValues<double>(groupVariableIndex).Select(x => x.ToString());
+      } else if (preprocessingData.VariableHasType<string>(groupVariableIndex)) {
+        groupingValues = preprocessingData.GetValues<string>(groupVariableIndex);
+      } else if (preprocessingData.VariableHasType<DateTime>(groupVariableIndex)) {
+        groupingValues = preprocessingData.GetValues<DateTime>(groupVariableIndex).Select(x => x.ToString());
       }
       var groups = groupingValues.Zip(validPoints, Tuple.Create).GroupBy(t => t.Item1, t => t.Item2);
Index: /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing/3.4/Content/SingleScatterPlotContent.cs
===================================================================
--- /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing/3.4/Content/SingleScatterPlotContent.cs	(revision 14724)
+++ /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing/3.4/Content/SingleScatterPlotContent.cs	(revision 14725)
@@ -31,5 +31,4 @@
     public string SelectedXVariable { get; set; }
     public string SelectedYVariable { get; set; }
-    public string SelectedGroupVariable { get; set; }
 
     public SingleScatterPlotContent(IFilteredPreprocessingData preprocessingData)
@@ -41,5 +40,5 @@
       this.SelectedXVariable = content.SelectedXVariable;
       this.SelectedYVariable = content.SelectedYVariable;
-      this.SelectedGroupVariable = content.SelectedGroupVariable;
+      this.GroupingVariable = content.GroupingVariable;
     }
 
