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;
     }
 
