Index: /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/HeuristicLab.DataPreprocessing.Views-3.4.csproj
===================================================================
--- /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/HeuristicLab.DataPreprocessing.Views-3.4.csproj	(revision 14458)
+++ /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/HeuristicLab.DataPreprocessing.Views-3.4.csproj	(revision 14459)
@@ -239,10 +239,4 @@
     </Compile>
     <Compile Include="DataPreprocessorStarter.cs" />
-    <Compile Include="PreprocessingDataTableView.cs">
-      <SubType>UserControl</SubType>
-    </Compile>
-    <Compile Include="PreprocessingDataTableView.Designer.cs">
-      <DependentUpon>PreprocessingDataTableView.cs</DependentUpon>
-    </Compile>
     <Compile Include="FilterView.cs">
       <SubType>UserControl</SubType>
@@ -326,4 +320,9 @@
       <Name>HeuristicLab.DataPreprocessing-3.4</Name>
     </ProjectReference>
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="PreprocessingChartView.resx">
+      <DependentUpon>PreprocessingChartView.cs</DependentUpon>
+    </EmbeddedResource>
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Index: /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/HistogramView.Designer.cs
===================================================================
--- /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/HistogramView.Designer.cs	(revision 14458)
+++ /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/HistogramView.Designer.cs	(revision 14459)
@@ -46,5 +46,4 @@
     private void InitializeComponent() {
       this.optionsBox = new System.Windows.Forms.GroupBox();
-      this.displayDetailsCheckBox = new System.Windows.Forms.CheckBox();
       this.label1 = new System.Windows.Forms.Label();
       this.classifierComboBox = new System.Windows.Forms.ComboBox();
@@ -66,5 +65,4 @@
       this.optionsBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) 
             | System.Windows.Forms.AnchorStyles.Right)));
-      this.optionsBox.Controls.Add(this.displayDetailsCheckBox);
       this.optionsBox.Controls.Add(this.label1);
       this.optionsBox.Controls.Add(this.classifierComboBox);
@@ -75,17 +73,4 @@
       this.optionsBox.TabStop = false;
       this.optionsBox.Text = "Options";
-      // 
-      // displayDetailsCheckBox
-      // 
-      this.displayDetailsCheckBox.AutoSize = true;
-      this.displayDetailsCheckBox.Location = new System.Drawing.Point(5, 58);
-      this.displayDetailsCheckBox.Margin = new System.Windows.Forms.Padding(2);
-      this.displayDetailsCheckBox.Name = "displayDetailsCheckBox";
-      this.displayDetailsCheckBox.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
-      this.displayDetailsCheckBox.Size = new System.Drawing.Size(119, 17);
-      this.displayDetailsCheckBox.TabIndex = 3;
-      this.displayDetailsCheckBox.Text = "Display value count";
-      this.displayDetailsCheckBox.UseVisualStyleBackColor = true;
-      this.displayDetailsCheckBox.CheckedChanged += new System.EventHandler(this.displayDetailsCheckBox_CheckedChanged);
       // 
       // label1
@@ -130,5 +115,4 @@
     private System.Windows.Forms.ComboBox classifierComboBox;
     private System.Windows.Forms.Label label1;
-    private System.Windows.Forms.CheckBox displayDetailsCheckBox;
 
   }
Index: /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/HistogramView.cs
===================================================================
--- /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/HistogramView.cs	(revision 14458)
+++ /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/HistogramView.cs	(revision 14459)
@@ -21,4 +21,6 @@
 
 using System;
+using System.Collections.Generic;
+using System.Linq;
 using HeuristicLab.Analysis;
 using HeuristicLab.MainForm;
@@ -29,10 +31,10 @@
   [Content(typeof(HistogramContent), true)]
   public partial class HistogramView : PreprocessingChartView {
-    private const string HISTOGRAM_CHART_TITLE = "Histogram";
+
+    public List<double> Classification { get; set; }
+    public bool IsDetailedChartViewEnabled { get; set; }
 
     public HistogramView() {
       InitializeComponent();
-      chartType = DataRowVisualProperties.DataRowChartType.Histogram;
-      chartTitle = HISTOGRAM_CHART_TITLE;
     }
 
@@ -53,4 +55,28 @@
     }
 
+    protected override DataTable CreateDataTable(string variableName) {
+      var dt = new DataTable();
+      var row = Content.CreateDataRow(variableName, DataRowVisualProperties.DataRowChartType.Histogram);
+      if (Classification == null) {
+        dt.Rows.Add(row);
+      } else {
+        dt.VisualProperties.Title = variableName;
+        //var valuesPerClass = row.Values.Zip(Classification, (value, @class) => new { value, @class })
+        //                        .GroupBy(x => x.@class)
+        //                        .ToDictionary(x => x.Key, x => x.Select(v => v.value));
+        var valuesPerClass = row.Values.Select((i, index) => new { i, j = Classification.ToList()[index] })
+                                       .GroupBy((x) => x.j)
+                                       .ToDictionary(x => x.Key, x => x.Select(v => v.i)
+                                       .ToList());
+        foreach (var entry in valuesPerClass) {
+          var classRow = new DataRow(entry.Key.ToString());
+          classRow.VisualProperties.ChartType = DataRowVisualProperties.DataRowChartType.Histogram;
+          classRow.Values.AddRange(entry.Value);
+          dt.Rows.Add(classRow);
+        }
+      }
+      return dt;
+    }
+
     public new HistogramContent Content {
       get { return (HistogramContent)base.Content; }
@@ -64,5 +90,5 @@
       if (classifierComboBox.SelectedIndex != 0) {
         int columndIndex = Content.PreprocessingData.GetColumnIndex(classifierComboBox.SelectedItem.ToString());
-        Classification = Content.PreprocessingData.GetValues<double>(columndIndex);
+        Classification = Content.PreprocessingData.GetValues<double>(columndIndex).ToList();
       } else {
         Classification = null;
@@ -70,17 +96,8 @@
 
       Content.ClassifierVariableIndex = classifierComboBox.SelectedIndex;
-      if (Content.IsDetailedChartViewEnabled != IsDetailedChartViewEnabled) {
-        displayDetailsCheckBox.Checked = Content.IsDetailedChartViewEnabled;
-      } else {
-        GenerateChart();
-      }
-    }
-    private void displayDetailsCheckBox_CheckedChanged(object sender, EventArgs e) {
-      bool isChecked = displayDetailsCheckBox.Checked;
-      if (IsDetailedChartViewEnabled != isChecked) {
-        IsDetailedChartViewEnabled = isChecked;
-        Content.IsDetailedChartViewEnabled = isChecked;
-        GenerateChart();
-      }
+
+      // rebuild datatables
+      InitData();
+      GenerateLayout();
     }
   }
Index: /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/LineChartView.cs
===================================================================
--- /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/LineChartView.cs	(revision 14458)
+++ /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/LineChartView.cs	(revision 14459)
@@ -21,5 +21,10 @@
 
 using System;
+using System.Collections.Generic;
+using System.Linq;
 using HeuristicLab.Analysis;
+using HeuristicLab.Analysis.Views;
+using HeuristicLab.Collections;
+using HeuristicLab.Data;
 using HeuristicLab.MainForm;
 
@@ -30,10 +35,12 @@
   public partial class LineChartView : PreprocessingChartView {
 
-    private const string LINE_CHART_TITLE = "Line Chart";
+    protected Dictionary<string, DataRow> allInOneDataRows;
+    protected DataTable allInOneDataTable;
+    protected DataTableControl allInOneDataTableControl;
 
     public LineChartView() {
       InitializeComponent();
-      chartType = DataRowVisualProperties.DataRowChartType.Line;
-      chartTitle = LINE_CHART_TITLE;
+      allInOneDataRows = new Dictionary<string, DataRow>();
+      allInOneDataTable= new DataTable();
     }
 
@@ -43,8 +50,41 @@
     }
 
+    protected override void InitData() {
+      base.InitData();
+
+      allInOneDataRows.Clear();
+      foreach (var x in Content.VariableItemList.Select((v, i) => new { variable = v.Value, i })) {
+        var row = Content.CreateDataRow(x.variable, DataRowVisualProperties.DataRowChartType.Line);
+        row.VisualProperties.Color = Colors[x.i % Colors.Length];
+        allInOneDataRows.Add(x.variable, row);
+      }
+
+      allInOneDataTable.Rows.Clear();
+      foreach (var variable in Content.VariableItemList.CheckedItems) {
+        allInOneDataTable.Rows.Add(allInOneDataRows[variable.Value.Value]);
+      }
+    }
+
+    protected override int GetNumberOfVisibleDataTables() {
+      return Content.AllInOneMode ? 1 : base.GetNumberOfVisibleDataTables();
+    }
+    protected override IEnumerable<DataTableControl> GetVisibleDataTables() {
+      if (Content.AllInOneMode) {
+        if (allInOneDataTableControl == null)
+          allInOneDataTableControl = new DataTableControl() { Content = allInOneDataTable };
+        return new[] { allInOneDataTableControl };
+      }
+      return base.GetVisibleDataTables();
+    }
+    protected override DataTable CreateDataTable(string variableName) {
+      var dt = new DataTable();
+      dt.Rows.Add(Content.CreateDataRow(variableName, DataRowVisualProperties.DataRowChartType.Line));
+      return dt;
+    }
+
     private void allInOneCheckBox_CheckedChanged(object sender, EventArgs e) {
       Content.AllInOneMode = allInOneCheckBox.Checked;
 
-      GenerateChart();
+      GenerateLayout();
     }
 
@@ -55,4 +95,43 @@
       }
     }
+
+    protected override void CheckedItemsChanged(object sender, CollectionItemsChangedEventArgs<IndexedItem<StringValue>> checkedItems) {
+      base.CheckedItemsChanged(sender, checkedItems);
+
+      foreach (IndexedItem<StringValue> item in checkedItems.Items) {
+        string variableName = item.Value.Value;
+
+        if (IsVariableChecked(variableName)) {
+          // ToDo: avoid clearing all rows, but how?
+          allInOneDataTable.Rows.Clear();
+          foreach (var variable in Content.VariableItemList.CheckedItems) {
+            allInOneDataTable.Rows.Add(allInOneDataRows[variable.Value.Value]);
+          }
+        } else {
+          allInOneDataTable.Rows.Remove(variableName);
+        }
+      }
+    }
+
+    #region Add/Remove/Update Variable, Reset
+    protected override void AddVariable(string name) {
+      base.AddVariable(name);
+      var row = Content.CreateDataRow(name, DataRowVisualProperties.DataRowChartType.Line);
+      allInOneDataTable.Rows.Add(row);
+    }
+
+    // remove variable from data table and item list
+    protected override void RemoveVariable(string name) {
+      base.RemoveVariable(name);
+      allInOneDataTable.Rows.Remove(name);
+    }
+
+    protected override void UpdateVariable(string name) {
+      base.UpdateVariable(name);
+      allInOneDataTable.Rows.Remove(name);
+      var newRow = Content.CreateDataRow(name, DataRowVisualProperties.DataRowChartType.Line);
+      allInOneDataTable.Rows.Add(newRow);
+    }
+    #endregion
   }
 }
Index: /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingChartView.Designer.cs
===================================================================
--- /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingChartView.Designer.cs	(revision 14458)
+++ /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingChartView.Designer.cs	(revision 14459)
@@ -45,5 +45,4 @@
     /// </summary>
     private void InitializeComponent() {
-      this.dataTableView = new HeuristicLab.DataPreprocessing.Views.PreprocessingDataTableView();
       this.tableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
       ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
@@ -51,5 +50,4 @@
       this.splitContainer.Panel2.SuspendLayout();
       this.splitContainer.SuspendLayout();
-      this.tableLayoutPanel.SuspendLayout();
       this.SuspendLayout();
       // 
@@ -61,27 +59,10 @@
       this.splitContainer.Panel2.Controls.Add(this.tableLayoutPanel);
       // 
-      // dataTableView
-      // 
-      this.dataTableView.AutoScroll = true;
-      this.dataTableView.Caption = "DataTable View";
-      this.dataTableView.Classification = null;
-      this.dataTableView.Content = null;
-      this.dataTableView.Dock = System.Windows.Forms.DockStyle.Fill;
-      this.dataTableView.IsDetailedChartViewEnabled = false;
-      this.dataTableView.Location = new System.Drawing.Point(3, 3);
-      this.dataTableView.Name = "dataTableView";
-      this.dataTableView.ReadOnly = false;
-      this.dataTableView.ShowLegend = true;
-      this.dataTableView.Size = new System.Drawing.Size(553, 397);
-      this.dataTableView.TabIndex = 0;
-      this.dataTableView.XAxisFormat = "";
-      this.dataTableView.YAxisFormat = "";
-      // 
       // tableLayoutPanel
       // 
+      this.tableLayoutPanel.AutoScroll = true;
       this.tableLayoutPanel.ColumnCount = 1;
       this.tableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
       this.tableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
-      this.tableLayoutPanel.Controls.Add(this.dataTableView, 0, 0);
       this.tableLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill;
       this.tableLayoutPanel.Location = new System.Drawing.Point(0, 0);
@@ -103,5 +84,4 @@
       ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit();
       this.splitContainer.ResumeLayout(false);
-      this.tableLayoutPanel.ResumeLayout(false);
       this.ResumeLayout(false);
 
@@ -110,6 +90,5 @@
     #endregion
 
-    private DataPreprocessing.Views.PreprocessingDataTableView dataTableView;
-    private System.Windows.Forms.TableLayoutPanel tableLayoutPanel;
+    protected System.Windows.Forms.TableLayoutPanel tableLayoutPanel;
   }
 }
Index: /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingChartView.cs
===================================================================
--- /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingChartView.cs	(revision 14458)
+++ /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingChartView.cs	(revision 14459)
@@ -20,12 +20,14 @@
 #endregion
 
-using System;
 using System.Collections.Generic;
+using System.Drawing;
 using System.Linq;
 using System.Windows.Forms;
 using HeuristicLab.Analysis;
+using HeuristicLab.Analysis.Views;
 using HeuristicLab.Collections;
 using HeuristicLab.Data;
 using HeuristicLab.MainForm;
+using HeuristicLab.MainForm.WindowsForms;
 
 namespace HeuristicLab.DataPreprocessing.Views {
@@ -34,24 +36,23 @@
   public partial class PreprocessingChartView : PreprocessingCheckedVariablesView {
 
-    protected PreprocessingDataTable dataTable;
-    protected List<PreprocessingDataTable> dataTablePerVariable;
-    protected List<DataRow> dataRows;
-    protected List<DataRow> selectedDataRows;
-
-    protected DataRowVisualProperties.DataRowChartType chartType;
-    protected string chartTitle;
-
-    private const string DEFAULT_CHART_TITLE = "Chart";
+    protected Dictionary<string, DataTable> dataTables;
+    protected Dictionary<string, DataTableControl> dataTableControls;
+
     private const int FIXED_CHART_SIZE = 300;
     private const int MAX_TABLE_AUTO_SIZE_ROWS = 3;
 
-
-    public IEnumerable<double> Classification { get; set; }
-    public bool IsDetailedChartViewEnabled { get; set; }
+    protected static readonly Color[] Colors = {
+      Color.FromArgb(59, 136, 239), Color.FromArgb(252, 177, 59), Color.FromArgb(226, 64, 10),
+      Color.FromArgb(5, 100, 146), Color.FromArgb(191, 191, 191), Color.FromArgb(26, 59, 105),
+      Color.FromArgb(255, 226, 126), Color.FromArgb(18, 156, 221), Color.FromArgb(202, 107, 75),
+      Color.FromArgb(0, 92, 219), Color.FromArgb(243, 210, 136), Color.FromArgb(80, 99, 129),
+      Color.FromArgb(241, 185, 168), Color.FromArgb(224, 131, 10), Color.FromArgb(120, 147, 190)
+    };
+
 
     public PreprocessingChartView() {
       InitializeComponent();
-      chartType = DataRowVisualProperties.DataRowChartType.Line;
-      chartTitle = DEFAULT_CHART_TITLE;
+      dataTables = new Dictionary<string, DataTable>();
+      dataTableControls= new Dictionary<string, DataTableControl>();
     }
 
@@ -60,37 +61,30 @@
       if (Content != null) {
         InitData();
-        GenerateChart();
-
-        foreach (var row in dataRows) {
-          string variableName = row.Name;
-          if (!IsVariableChecked(variableName)) {
-            dataTableView.SetRowEnabled(variableName, false);
-            dataTable.SelectedRows.Remove(variableName);
-            dataTablePerVariable.Remove(dataTablePerVariable.Find(x => (x.Name == variableName)));
-          }
-        }
-      }
-    }
-
-    private void InitData() {
-      //Create data tables and data rows
-      dataRows = Content.CreateAllDataRows(chartType);
-      dataTable = new PreprocessingDataTable(chartTitle);
-      dataTablePerVariable = new List<PreprocessingDataTable>();
-
-      //add data rows to data tables according to checked item list
-      foreach (var row in dataRows) {
-        string variableName = row.Name;
-
-        //add row to data table
-        dataTable.Rows.Add(row);
-
-        //add row to data table per variable
-        PreprocessingDataTable d = new PreprocessingDataTable(variableName);
-        d.Rows.Add(row);
-        dataTablePerVariable.Add(d);
-      }
-
-      UpdateSelection();
+        GenerateLayout();
+      }
+    }
+
+    protected virtual int GetNumberOfVisibleDataTables() {
+      return checkedItemList.Content.CheckedItems.Count();
+    }
+
+    protected virtual IEnumerable<DataTableControl> GetVisibleDataTables() {
+      foreach (var name in Content.VariableItemList.CheckedItems) {
+        if (!dataTableControls.ContainsKey(name.Value.Value))
+          dataTableControls.Add(name.Value.Value, new DataTableControl() { Content = dataTables[name.Value.Value] });
+        yield return dataTableControls[name.Value.Value];
+      }
+    }
+
+    protected virtual DataTable CreateDataTable(string variableName) {
+      return null;
+    }
+
+    protected virtual void InitData() {
+      dataTables.Clear();
+      dataTableControls.Clear();
+      foreach (var variable in Content.VariableItemList.Select(v => v.Value)) {
+        dataTables.Add(variable, CreateDataTable(variable));
+      }
     }
 
@@ -101,61 +95,35 @@
         string variableName = item.Value.Value;
 
-
         if (!IsVariableChecked(variableName)) {
           // not checked -> remove
-          dataTableView.SetRowEnabled(variableName, false);
-          dataTable.SelectedRows.Remove(variableName);
-          dataTablePerVariable.Remove(dataTablePerVariable.Find(x => (x.Name == variableName)));
+          //dataTableView.SetRowEnabled(variableName, false);
+          //dataTablePerVariable.Remove(dataTablePerVariable.Find(x => (x.Name == variableName)));
         } else {
           // checked -> add
-          DataRow row = GetDataRow(variableName);
-          DataRow selectedRow = GetSelectedDataRow(variableName);
-          dataTableView.SetRowEnabled(variableName, true);
-
-          PreprocessingDataTable pdt = new PreprocessingDataTable(variableName);
-          pdt.Rows.Add(row);
+          //DataRow row = GetDataRow(variableName);
+          //dataTableView.SetRowEnabled(variableName, true);
+
+          //var pdt = new DataTable(variableName);
+          //pdt.VisualProperties.Title = string.Empty;
+          //pdt.Rows.Add(row);
           // dataTablePerVariable does not contain unchecked variables => reduce insert position by number of uncheckt variables to correct the index
-          int uncheckedUntilVariable = checkedItemList.Content.TakeWhile(x => x.Value != variableName).Count(x => !checkedItemList.Content.ItemChecked(x));
-          dataTablePerVariable.Insert(item.Index - uncheckedUntilVariable, pdt);
-
-          //update selection
-          if (selectedRow != null) {
-            dataTable.SelectedRows.Add(selectedRow);
-            pdt.SelectedRows.Add(selectedRow);
-          }
+          //int uncheckedUntilVariable = checkedItemList.Content.TakeWhile(x => x.Value != variableName).Count(x => !checkedItemList.Content.ItemChecked(x));
+          //dataTables.Insert(item.Index - uncheckedUntilVariable, pdt);
         }
       }
 
       // update chart if not in all in one mode
-      if (Content != null && !Content.AllInOneMode)
-        GenerateChart();
-    }
-
-    private DataRow GetSelectedDataRow(string variableName) {
-      foreach (DataRow row in selectedDataRows) {
-        if (row.Name == variableName)
-          return row;
-      }
-      return null;
-    }
-    private DataRow GetDataRow(string variableName) {
-      foreach (DataRow row in dataRows) {
-        if (row.Name == variableName)
-          return row;
-      }
-      return null;
-    }
+      //if (Content != null && !Content.AllInOneMode)
+      //GenerateChart();??
+      GenerateLayout();
+    }
+
 
     #region Add/Remove/Update Variable, Reset
     protected override void AddVariable(string name) {
       base.AddVariable(name);
-      DataRow row = Content.CreateDataRow(name, chartType);
-      dataTable.Rows.Add(row);
-      PreprocessingDataTable d = new PreprocessingDataTable(name);
-      d.Rows.Add(row);
-      dataTablePerVariable.Add(d);
-
-      if (!Content.AllInOneMode)
-        GenerateChart();
+      dataTables.Add(name, CreateDataTable(name));
+
+      GenerateLayout();
     }
 
@@ -163,21 +131,17 @@
     protected override void RemoveVariable(string name) {
       base.RemoveVariable(name);
-      dataTable.Rows.Remove(name);
-      dataTablePerVariable.Remove(dataTablePerVariable.Find(x => (x.Name == name)));
-
-      if (!Content.AllInOneMode)
-        GenerateChart();
+      dataTables.Remove(name);
+      dataTableControls.Remove(name);
+
+      GenerateLayout();
     }
 
     protected override void UpdateVariable(string name) {
       base.UpdateVariable(name);
-      DataRow newRow = Content.CreateDataRow(name, chartType);
-      dataTable.Rows.Remove(name);
-      dataTable.Rows.Add(newRow);
-      DataTable dt = dataTablePerVariable.Find(x => x.Rows.Find(y => y.Name == name) != null);
-      if (dt != null) {
-        dt.Rows.Remove(name);
-        dt.Rows.Add(newRow);
-      }
+      dataTables.Remove(name);
+      var newDataTable = CreateDataTable(name);
+      dataTables.Add(name, newDataTable);
+      dataTableControls[name].Content = newDataTable;
+      GenerateLayout();
     }
     protected override void ResetAllVariables() {
@@ -186,59 +150,44 @@
     #endregion
 
-    #region Generate Charts
-    protected void GenerateChart() {
+    #region Generate Layout
+    protected void GenerateLayout() {
+      tableLayoutPanel.SuspendRepaint();
+
       ClearTableLayout();
-      if (Content.AllInOneMode) {
-        GenerateSingleChartLayout();
-      } else
-        GenerateMultiChartLayout();
-    }
-
-    private void GenerateSingleChartLayout() {
-      tableLayoutPanel.ColumnCount = 1;
-      tableLayoutPanel.RowCount = 1;
-      tableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100));
-      tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 100));
-      tableLayoutPanel.Controls.Add(dataTableView, 0, 0);
-      dataTableView.Content = dataTable;
-    }
-
-    private void GenerateMultiChartLayout() {
-      int checkedItemsCnt = 0;
-      foreach (var item in Content.VariableItemList.CheckedItems)
-        checkedItemsCnt++;
-
-      // set columns and rows based on number of items
-      int columns = GetNrOfMultiChartColumns(checkedItemsCnt);
-      int rows = GetNrOfMultiChartRows(checkedItemsCnt, columns);
+
+      int nrCharts = GetNumberOfVisibleDataTables();
+
+      // Set columns and rows based on number of items
+      int columns = GetNrOfMultiChartColumns(nrCharts);
+      int rows = GetNrOfMultiChartRows(nrCharts, columns);
 
       tableLayoutPanel.ColumnCount = columns;
       tableLayoutPanel.RowCount = rows;
 
-      List<PreprocessingDataTable>.Enumerator enumerator = dataTablePerVariable.GetEnumerator();
-      for (int x = 0; x < columns; x++) {
-
-        if (rows <= MAX_TABLE_AUTO_SIZE_ROWS)
-          tableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100 / columns));
-        else
-          //scrollbar is shown if there are more than 3 rows -> remove scroll bar width from total width
-          tableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, (tableLayoutPanel.Width - System.Windows.Forms.SystemInformation.VerticalScrollBarWidth) / columns));
-        for (int y = 0; y < rows; y++) {
-          //Add a row only when creating the first column
-          if (x == 0) {
-            // fixed chart size when there are more than 3 tables
-            if (rows > MAX_TABLE_AUTO_SIZE_ROWS)
-              tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, FIXED_CHART_SIZE));
-            else
-              tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 100 / rows));
+      using (var enumerator = GetVisibleDataTables().GetEnumerator()) {
+        for (int x = 0; x < columns; x++) {
+          var columnStyle = rows <= MAX_TABLE_AUTO_SIZE_ROWS
+            ? new ColumnStyle(SizeType.Percent, 100 / columns)
+            : new ColumnStyle(SizeType.Absolute, (tableLayoutPanel.Width - SystemInformation.VerticalScrollBarWidth) / columns);
+          tableLayoutPanel.ColumnStyles.Add(columnStyle);
+
+          for (int y = 0; y < rows; y++) {
+            // Add a row only when creating the first column
+            if (x == 0) {
+              var rowStyle = rows > MAX_TABLE_AUTO_SIZE_ROWS
+                ? new RowStyle(SizeType.Absolute, FIXED_CHART_SIZE)
+                : new RowStyle(SizeType.Percent, 100 / rows);
+              tableLayoutPanel.RowStyles.Add(rowStyle);
+            }
+
+            if (enumerator.MoveNext())
+              AddDataTableToTableLayout(enumerator.Current, x, y);
           }
-
-          enumerator.MoveNext();
-          PreprocessingDataTable d = enumerator.Current;
-          AddDataTableToTableLayout(d, x, y);
-
         }
       }
-    }
+
+      tableLayoutPanel.ResumeRepaint(true);
+    }
+
     private int GetNrOfMultiChartColumns(int itemCount) {
       int columns = 0;
@@ -262,18 +211,15 @@
     }
 
-    private void AddDataTableToTableLayout(PreprocessingDataTable dataTable, int x, int y) {
-      PreprocessingDataTableView dataView = new PreprocessingDataTableView();
-      dataView.Classification = Classification;
-      dataView.IsDetailedChartViewEnabled = IsDetailedChartViewEnabled;
+    private void AddDataTableToTableLayout(DataTableControl dataTable, int x, int y) {
+      //dataView.Classification = Classification;
+      //dataView.IsDetailedChartViewEnabled = IsDetailedChartViewEnabled;
 
       if (dataTable == null) {
         // dummy panel for empty field 
-        Panel p = new Panel();
-        p.Dock = DockStyle.Fill;
+        Panel p = new Panel { Dock = DockStyle.Fill };
         tableLayoutPanel.Controls.Add(p, y, x);
       } else {
-        dataView.Content = dataTable;
-        dataView.Dock = DockStyle.Fill;
-        tableLayoutPanel.Controls.Add(dataView, y, x);
+        dataTable.Dock = DockStyle.Fill;
+        tableLayoutPanel.Controls.Add(dataTable, y, x);
       }
     }
@@ -286,4 +232,8 @@
       tableLayoutPanel.ColumnStyles.Clear();
       tableLayoutPanel.RowStyles.Clear();
+
+      tableLayoutPanel.Width = 0;
+      tableLayoutPanel.Height = 0;
+
       tableLayoutPanel.AutoScroll = false;
       tableLayoutPanel.AutoScroll = true;
@@ -301,29 +251,4 @@
     }
     #endregion
-
-    #region Update Selection
-    protected override void PreprocessingData_SelctionChanged(object sender, EventArgs e) {
-      base.PreprocessingData_SelctionChanged(sender, e);
-      UpdateSelection();
-    }
-
-    private void UpdateSelection() {
-      //update data table selection
-      selectedDataRows = Content.CreateAllSelectedDataRows(chartType);
-      dataTable.SelectedRows.Clear();
-      foreach (var selectedRow in selectedDataRows) {
-        if (IsVariableChecked(selectedRow.Name))
-          dataTable.SelectedRows.Add(selectedRow);
-      }
-
-      //update data table per variable selection
-      foreach (PreprocessingDataTable d in dataTablePerVariable) {
-        d.SelectedRows.Clear();
-        DataRow row = selectedDataRows.Find(x => x.Name == d.Name);
-        if (row != null)
-          d.SelectedRows.Add(row);
-      }
-    }
-    #endregion
   }
 }
Index: /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingCheckedVariablesView.cs
===================================================================
--- /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingCheckedVariablesView.cs	(revision 14458)
+++ /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingCheckedVariablesView.cs	(revision 14459)
@@ -33,5 +33,5 @@
   [View("Preprocessing Checked Variables View")]
   [Content(typeof(PreprocessingChartContent), false)]
-  public abstract partial class PreprocessingCheckedVariablesView : ItemView {
+  public partial class PreprocessingCheckedVariablesView : ItemView {
 
     public new PreprocessingChartContent Content {
Index: anches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingDataTableView.Designer.cs
===================================================================
--- /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingDataTableView.Designer.cs	(revision 14458)
+++ 	(revision )
@@ -1,109 +1,0 @@
-#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-namespace HeuristicLab.DataPreprocessing.Views {
-  partial class PreprocessingDataTableView {
-    /// <summary> 
-    /// Required designer variable.
-    /// </summary>
-    private System.ComponentModel.IContainer components = null;
-
-    /// <summary> 
-    /// Clean up any resources being used.
-    /// </summary>
-    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
-    protected override void Dispose(bool disposing) {
-      if (disposing) {
-        if (components != null) components.Dispose();
-      }
-      base.Dispose(disposing);
-    }
-
-    #region Component Designer generated code
-
-    /// <summary> 
-    /// Required method for Designer support - do not modify 
-    /// the contents of this method with the code editor.
-    /// </summary>
-    private void InitializeComponent() {
-      this.components = new System.ComponentModel.Container();
-      System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
-      System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend();
-      System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series();
-      System.Windows.Forms.DataVisualization.Charting.Title title1 = new System.Windows.Forms.DataVisualization.Charting.Title();
-      this.chart = new HeuristicLab.Visualization.ChartControlsExtensions.EnhancedChart();
-      ((System.ComponentModel.ISupportInitialize)(this.chart)).BeginInit();
-      this.SuspendLayout();
-      // 
-      // chart
-      // 
-      this.chart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
-            | System.Windows.Forms.AnchorStyles.Left)
-            | System.Windows.Forms.AnchorStyles.Right)));
-      this.chart.BorderlineColor = System.Drawing.Color.Black;
-      this.chart.BorderlineDashStyle = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Solid;
-      chartArea1.AxisX.Minimum = 0D;
-      chartArea1.CursorX.IsUserEnabled = true;
-      chartArea1.CursorX.IsUserSelectionEnabled = true;
-      chartArea1.CursorY.IsUserEnabled = true;
-      chartArea1.CursorY.IsUserSelectionEnabled = true;
-      chartArea1.Name = "Default";
-      this.chart.ChartAreas.Add(chartArea1);
-      legend1.Alignment = System.Drawing.StringAlignment.Center;
-      legend1.Docking = System.Windows.Forms.DataVisualization.Charting.Docking.Top;
-      legend1.Name = "Default";
-      this.chart.Legends.Add(legend1);
-      this.chart.Location = new System.Drawing.Point(0, 0);
-      this.chart.Name = "chart";
-      series1.ChartArea = "Default";
-      series1.Legend = "Default";
-      series1.Name = "Default";
-      this.chart.Series.Add(series1);
-      this.chart.Size = new System.Drawing.Size(359, 274);
-      this.chart.TabIndex = 3;
-      this.chart.Text = "chart";
-      title1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
-      title1.Name = "Default";
-      title1.Text = "Title";
-      title1.Visible = false;
-      this.chart.Titles.Add(title1);
-      this.chart.CustomizeLegend += new System.EventHandler<System.Windows.Forms.DataVisualization.Charting.CustomizeLegendEventArgs>(this.chart_CustomizeLegend);
-      this.chart.DoubleClick += new System.EventHandler(this.chart_DoubleClick);
-      this.chart.MouseDown += new System.Windows.Forms.MouseEventHandler(this.chart_MouseDown);
-      this.chart.MouseMove += new System.Windows.Forms.MouseEventHandler(this.chart_MouseMove);
-      // 
-      // PreprocessingDataTableView
-      // 
-      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
-      this.Controls.Add(this.chart);
-      this.Name = "PreprocessingDataTableView";
-      this.Size = new System.Drawing.Size(359, 274);
-      ((System.ComponentModel.ISupportInitialize)(this.chart)).EndInit();
-      this.ResumeLayout(false);
-
-    }
-
-    #endregion
-
-    protected HeuristicLab.Visualization.ChartControlsExtensions.EnhancedChart chart;
-
-  }
-}
Index: anches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingDataTableView.cs
===================================================================
--- /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingDataTableView.cs	(revision 14458)
+++ 	(revision )
@@ -1,869 +1,0 @@
-#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-using System;
-using System.Collections.Generic;
-using System.Drawing;
-using System.Linq;
-using System.Windows.Forms;
-using System.Windows.Forms.DataVisualization.Charting;
-using HeuristicLab.Analysis;
-using HeuristicLab.Analysis.Views;
-using HeuristicLab.Collections;
-using HeuristicLab.Core.Views;
-using HeuristicLab.MainForm;
-
-namespace HeuristicLab.DataPreprocessing.Views {
-  [View("Preprocessing DataTable View")]
-  [Content(typeof(PreprocessingDataTable), false)]
-  public partial class PreprocessingDataTableView : ItemView, IConfigureableView {
-    protected List<Series> invisibleSeries;
-    protected Dictionary<IObservableList<double>, DataRow> valuesRowsTable;
-    private event EventHandler chartDoubleClick;
-
-    public new PreprocessingDataTable Content {
-      get { return (PreprocessingDataTable)base.Content; }
-      set { base.Content = value; }
-    }
-
-    public bool ShowLegend {
-      get { return chart.Legends[0].Enabled; }
-      set { chart.Legends[0].Enabled = value; }
-    }
-
-    public string XAxisFormat {
-      get { return chart.ChartAreas[0].AxisX.LabelStyle.Format; }
-      set { chart.ChartAreas[0].AxisX.LabelStyle.Format = value; }
-    }
-    public string YAxisFormat {
-      get { return chart.ChartAreas[0].AxisY.LabelStyle.Format; }
-      set { chart.ChartAreas[0].AxisY.LabelStyle.Format = value; }
-    }
-
-    public IEnumerable<double> Classification { get; set; }
-    public bool IsDetailedChartViewEnabled { get; set; }
-
-    public PreprocessingDataTableView() {
-      InitializeComponent();
-      valuesRowsTable = new Dictionary<IObservableList<double>, DataRow>();
-      invisibleSeries = new List<Series>();
-      chart.CustomizeAllChartAreas();
-      chart.ChartAreas[0].CursorX.Interval = 1;
-    }
-
-    #region Event Handler Registration
-    protected override void DeregisterContentEvents() {
-      foreach (DataRow row in Content.Rows)
-        DeregisterDataRowEvents(row);
-      Content.VisualPropertiesChanged -= new EventHandler(Content_VisualPropertiesChanged);
-      Content.Rows.ItemsAdded -= new CollectionItemsChangedEventHandler<DataRow>(Rows_ItemsAdded);
-      Content.Rows.ItemsRemoved -= new CollectionItemsChangedEventHandler<DataRow>(Rows_ItemsRemoved);
-      Content.Rows.ItemsReplaced -= new CollectionItemsChangedEventHandler<DataRow>(Rows_ItemsReplaced);
-      Content.Rows.CollectionReset -= new CollectionItemsChangedEventHandler<DataRow>(Rows_CollectionReset);
-
-      Content.SelectedRows.ItemsAdded -= new CollectionItemsChangedEventHandler<DataRow>(Rows_ItemsAdded);
-      Content.SelectedRows.ItemsRemoved -= new CollectionItemsChangedEventHandler<DataRow>(Rows_ItemsRemoved);
-      Content.SelectedRows.ItemsReplaced -= new CollectionItemsChangedEventHandler<DataRow>(Rows_ItemsReplaced);
-      Content.SelectedRows.CollectionReset -= new CollectionItemsChangedEventHandler<DataRow>(Rows_CollectionReset);
-      base.DeregisterContentEvents();
-    }
-    protected override void RegisterContentEvents() {
-      base.RegisterContentEvents();
-      Content.VisualPropertiesChanged += new EventHandler(Content_VisualPropertiesChanged);
-      Content.Rows.ItemsAdded += new CollectionItemsChangedEventHandler<DataRow>(Rows_ItemsAdded);
-      Content.Rows.ItemsRemoved += new CollectionItemsChangedEventHandler<DataRow>(Rows_ItemsRemoved);
-      Content.Rows.ItemsReplaced += new CollectionItemsChangedEventHandler<DataRow>(Rows_ItemsReplaced);
-      Content.Rows.CollectionReset += new CollectionItemsChangedEventHandler<DataRow>(Rows_CollectionReset);
-
-      Content.SelectedRows.ItemsAdded += new CollectionItemsChangedEventHandler<DataRow>(SelectedRows_ItemsAdded);
-      Content.SelectedRows.ItemsRemoved += new CollectionItemsChangedEventHandler<DataRow>(SelectedRows_ItemsRemoved);
-      Content.SelectedRows.ItemsReplaced += new CollectionItemsChangedEventHandler<DataRow>(SelectedRows_ItemsReplaced);
-      Content.SelectedRows.CollectionReset += new CollectionItemsChangedEventHandler<DataRow>(SelectedRows_CollectionReset);
-    }
-
-
-    protected virtual void RegisterDataRowEvents(DataRow row) {
-      row.NameChanged += new EventHandler(Row_NameChanged);
-      row.VisualPropertiesChanged += new EventHandler(Row_VisualPropertiesChanged);
-      valuesRowsTable.Add(row.Values, row);
-      row.Values.ItemsAdded += new CollectionItemsChangedEventHandler<IndexedItem<double>>(Values_ItemsAdded);
-      row.Values.ItemsRemoved += new CollectionItemsChangedEventHandler<IndexedItem<double>>(Values_ItemsRemoved);
-      row.Values.ItemsReplaced += new CollectionItemsChangedEventHandler<IndexedItem<double>>(Values_ItemsReplaced);
-      row.Values.ItemsMoved += new CollectionItemsChangedEventHandler<IndexedItem<double>>(Values_ItemsMoved);
-      row.Values.CollectionReset += new CollectionItemsChangedEventHandler<IndexedItem<double>>(Values_CollectionReset);
-    }
-    protected virtual void DeregisterDataRowEvents(DataRow row) {
-      row.Values.ItemsAdded -= new CollectionItemsChangedEventHandler<IndexedItem<double>>(Values_ItemsAdded);
-      row.Values.ItemsRemoved -= new CollectionItemsChangedEventHandler<IndexedItem<double>>(Values_ItemsRemoved);
-      row.Values.ItemsReplaced -= new CollectionItemsChangedEventHandler<IndexedItem<double>>(Values_ItemsReplaced);
-      row.Values.ItemsMoved -= new CollectionItemsChangedEventHandler<IndexedItem<double>>(Values_ItemsMoved);
-      row.Values.CollectionReset -= new CollectionItemsChangedEventHandler<IndexedItem<double>>(Values_CollectionReset);
-      valuesRowsTable.Remove(row.Values);
-      row.VisualPropertiesChanged -= new EventHandler(Row_VisualPropertiesChanged);
-      row.NameChanged -= new EventHandler(Row_NameChanged);
-    }
-    #endregion
-
-    protected override void OnContentChanged() {
-      base.OnContentChanged();
-      invisibleSeries.Clear();
-      chart.ChartAreas[0].AxisX.Title = string.Empty;
-      chart.ChartAreas[0].AxisY.Title = string.Empty;
-      chart.ChartAreas[0].AxisY2.Title = string.Empty;
-      chart.Series.Clear();
-      if (Content != null) {
-
-        if (Classification != null)
-          chart.Titles[0].Text = Content.Name;
-
-        AddDataRows(Content.Rows);
-        AddSelectedDataRows(Content.SelectedRows);
-        ConfigureChartArea(chart.ChartAreas[0]);
-        RecalculateAxesScale(chart.ChartAreas[0]);
-      }
-    }
-
-    protected override void SetEnabledStateOfControls() {
-      base.SetEnabledStateOfControls();
-      chart.Enabled = Content != null;
-    }
-
-    public void ShowConfiguration() {
-      if (Content != null) {
-        using (var dialog = new DataTableVisualPropertiesDialog(Content)) {
-          dialog.ShowDialog(this);
-        }
-      } else MessageBox.Show("Nothing to configure.");
-    }
-
-    public bool IsRowEnabled(string name) {
-      return chart.Series.FindByName(name) != null && chart.Series[name].Enabled;
-    }
-    public void SetRowEnabled(string name, bool enabled) {
-      if (chart.Series.FindByName(name) != null)
-        chart.Series[name].Enabled = enabled;
-    }
-
-    protected virtual void AddDataRows(IEnumerable<DataRow> rows) {
-      foreach (var row in rows) {
-        RegisterDataRowEvents(row);
-        var series = new Series(row.Name);
-        if (row.VisualProperties.DisplayName.Trim() != String.Empty)
-          series.LegendText = row.VisualProperties.DisplayName;
-        else series.LegendText = row.Name;
-
-        ConfigureSeries(series, row);
-        FillSeriesWithRowValues(series, row);
-
-        if (IsDetailedChartViewEnabled) {
-          series.LegendText += " Values: " + row.Values.Count;
-        }
-        if (Classification == null)
-          chart.Series.Add(series);
-      }
-
-      ConfigureChartArea(chart.ChartAreas[0]);
-      RecalculateAxesScale(chart.ChartAreas[0]);
-      UpdateYCursorInterval();
-    }
-
-    protected virtual void AddSelectedDataRows(IEnumerable<DataRow> rows) {
-
-      // only paint selection for line chart
-      if (rows.Count() > 0 && rows.ElementAt(0).VisualProperties.ChartType == DataRowVisualProperties.DataRowChartType.Line) {
-        // add dummy series for selction entry in legend
-        if (rows.Count() > 0 && chart.Series.FindByName("(Selection)") == null) {
-          Series series = new Series("(Selection)");
-          series.IsVisibleInLegend = true;
-          series.Color = Color.Green;
-          series.BorderWidth = 1;
-          series.BorderDashStyle = ChartDashStyle.Solid;
-          series.BorderColor = Color.Empty;
-          series.ChartType = SeriesChartType.FastLine;
-          chart.Series.Add(series);
-        }
-
-        foreach (var row in rows) {
-          row.VisualProperties.IsVisibleInLegend = false;
-          row.VisualProperties.Color = Color.Green;
-          //add selected to name in order to avoid naming conflict
-          var series = new Series(row.Name + "(Selected)");
-          ConfigureSeries(series, row);
-          FillSeriesWithRowValues(series, row);
-
-          if (Classification == null)
-            chart.Series.Add(series);
-
-        }
-      }
-    }
-
-    protected virtual void RemoveSelectedDataRows(IEnumerable<DataRow> rows) {
-
-      // only remove selection for line chart
-      if (rows.Count() > 0 && rows.ElementAt(0).VisualProperties.ChartType == DataRowVisualProperties.DataRowChartType.Line) {
-        //remove selection entry in legend
-        if (Content.SelectedRows.Count == 0) {
-          Series series = chart.Series["(Selection)"];
-          chart.Series.Remove(series);
-        }
-
-        foreach (var row in rows) {
-          Series series = chart.Series[row.Name + "(Selected)"];
-          chart.Series.Remove(series);
-        }
-      }
-    }
-
-    protected virtual void RemoveDataRows(IEnumerable<DataRow> rows) {
-      foreach (var row in rows) {
-        DeregisterDataRowEvents(row);
-        Series series = chart.Series[row.Name];
-        chart.Series.Remove(series);
-        if (invisibleSeries.Contains(series))
-          invisibleSeries.Remove(series);
-      }
-      RecalculateAxesScale(chart.ChartAreas[0]);
-    }
-
-    private void ConfigureSeries(Series series, DataRow row) {
-      RemoveCustomPropertyIfExists(series, "PointWidth");
-      series.BorderWidth = 1;
-      series.BorderDashStyle = ChartDashStyle.Solid;
-      series.BorderColor = Color.Empty;
-
-      if (row.VisualProperties.Color != Color.Empty)
-        series.Color = row.VisualProperties.Color;
-      else series.Color = Color.Empty;
-      series.IsVisibleInLegend = row.VisualProperties.IsVisibleInLegend;
-
-      switch (row.VisualProperties.ChartType) {
-        case DataRowVisualProperties.DataRowChartType.Line:
-          series.ChartType = SeriesChartType.FastLine;
-          series.BorderWidth = row.VisualProperties.LineWidth;
-          series.BorderDashStyle = ConvertLineStyle(row.VisualProperties.LineStyle);
-          break;
-        case DataRowVisualProperties.DataRowChartType.Bars:
-          // Bar is incompatible with anything but Bar and StackedBar*
-          if (!chart.Series.Any(x => x.ChartType != SeriesChartType.Bar && x.ChartType != SeriesChartType.StackedBar && x.ChartType != SeriesChartType.StackedBar100))
-            series.ChartType = SeriesChartType.Bar;
-          else {
-            series.ChartType = SeriesChartType.FastPoint; //default
-            row.VisualProperties.ChartType = DataRowVisualProperties.DataRowChartType.Points;
-          }
-          break;
-        case DataRowVisualProperties.DataRowChartType.Columns:
-          series.ChartType = SeriesChartType.Column;
-          break;
-        case DataRowVisualProperties.DataRowChartType.Points:
-          series.ChartType = SeriesChartType.FastPoint;
-          break;
-        case DataRowVisualProperties.DataRowChartType.Histogram:
-          series.ChartType = SeriesChartType.StackedColumn;
-          series.SetCustomProperty("PointWidth", "1");
-          if (!series.Color.IsEmpty && series.Color.GetBrightness() < 0.25)
-            series.BorderColor = Color.White;
-          else series.BorderColor = Color.Black;
-          break;
-        case DataRowVisualProperties.DataRowChartType.StepLine:
-          series.ChartType = SeriesChartType.StepLine;
-          series.BorderWidth = row.VisualProperties.LineWidth;
-          series.BorderDashStyle = ConvertLineStyle(row.VisualProperties.LineStyle);
-          break;
-        default:
-          series.ChartType = SeriesChartType.FastPoint;
-          break;
-      }
-      series.YAxisType = row.VisualProperties.SecondYAxis ? AxisType.Secondary : AxisType.Primary;
-      series.XAxisType = row.VisualProperties.SecondXAxis ? AxisType.Secondary : AxisType.Primary;
-      if (row.VisualProperties.DisplayName.Trim() != String.Empty) series.LegendText = row.VisualProperties.DisplayName;
-      else series.LegendText = row.Name;
-
-      string xAxisTitle = string.IsNullOrEmpty(Content.VisualProperties.XAxisTitle)
-                      ? "X"
-                      : Content.VisualProperties.XAxisTitle;
-      string yAxisTitle = string.IsNullOrEmpty(Content.VisualProperties.YAxisTitle)
-                            ? "Y"
-                            : Content.VisualProperties.YAxisTitle;
-      series.ToolTip =
-        series.LegendText + Environment.NewLine +
-        xAxisTitle + " = " + "#INDEX," + Environment.NewLine +
-        yAxisTitle + " = " + "#VAL";
-    }
-
-    private void ConfigureChartArea(ChartArea area) {
-      if (Content.VisualProperties.TitleFont != null) chart.Titles[0].Font = Content.VisualProperties.TitleFont;
-      if (!Content.VisualProperties.TitleColor.IsEmpty) chart.Titles[0].ForeColor = Content.VisualProperties.TitleColor;
-      chart.Titles[0].Text = Content.VisualProperties.Title;
-
-      if (Content.VisualProperties.AxisTitleFont != null) area.AxisX.TitleFont = Content.VisualProperties.AxisTitleFont;
-      if (!Content.VisualProperties.AxisTitleColor.IsEmpty) area.AxisX.TitleForeColor = Content.VisualProperties.AxisTitleColor;
-      area.AxisX.Title = Content.VisualProperties.XAxisTitle;
-
-      if (Content.VisualProperties.AxisTitleFont != null) area.AxisX2.TitleFont = Content.VisualProperties.AxisTitleFont;
-      if (!Content.VisualProperties.AxisTitleColor.IsEmpty) area.AxisX2.TitleForeColor = Content.VisualProperties.AxisTitleColor;
-      area.AxisX2.Title = Content.VisualProperties.SecondXAxisTitle;
-
-      if (Content.VisualProperties.AxisTitleFont != null) area.AxisY.TitleFont = Content.VisualProperties.AxisTitleFont;
-      if (!Content.VisualProperties.AxisTitleColor.IsEmpty) area.AxisY.TitleForeColor = Content.VisualProperties.AxisTitleColor;
-      area.AxisY.Title = Content.VisualProperties.YAxisTitle;
-
-      if (Content.VisualProperties.AxisTitleFont != null) area.AxisY2.TitleFont = Content.VisualProperties.AxisTitleFont;
-      if (!Content.VisualProperties.AxisTitleColor.IsEmpty) area.AxisY2.TitleForeColor = Content.VisualProperties.AxisTitleColor;
-      area.AxisY2.Title = Content.VisualProperties.SecondYAxisTitle;
-
-      area.AxisX.IsLogarithmic = Content.VisualProperties.XAxisLogScale;
-      area.AxisX2.IsLogarithmic = Content.VisualProperties.SecondXAxisLogScale;
-      area.AxisY.IsLogarithmic = Content.VisualProperties.YAxisLogScale;
-      area.AxisY2.IsLogarithmic = Content.VisualProperties.SecondYAxisLogScale;
-    }
-
-    private void RecalculateAxesScale(ChartArea area) {
-      // Reset the axes bounds so that RecalculateAxesScale() will assign new bounds
-      foreach (Axis a in area.Axes) {
-        a.Minimum = double.NaN;
-        a.Maximum = double.NaN;
-      }
-      area.RecalculateAxesScale();
-      area.AxisX.IsMarginVisible = false;
-      area.AxisX2.IsMarginVisible = false;
-
-      if (!Content.VisualProperties.XAxisMinimumAuto && !double.IsNaN(Content.VisualProperties.XAxisMinimumFixedValue)) area.AxisX.Minimum = Content.VisualProperties.XAxisMinimumFixedValue;
-      if (!Content.VisualProperties.XAxisMaximumAuto && !double.IsNaN(Content.VisualProperties.XAxisMaximumFixedValue)) area.AxisX.Maximum = Content.VisualProperties.XAxisMaximumFixedValue;
-      if (!Content.VisualProperties.SecondXAxisMinimumAuto && !double.IsNaN(Content.VisualProperties.SecondXAxisMinimumFixedValue)) area.AxisX2.Minimum = Content.VisualProperties.SecondXAxisMinimumFixedValue;
-      if (!Content.VisualProperties.SecondXAxisMaximumAuto && !double.IsNaN(Content.VisualProperties.SecondXAxisMaximumFixedValue)) area.AxisX2.Maximum = Content.VisualProperties.SecondXAxisMaximumFixedValue;
-      if (!Content.VisualProperties.YAxisMinimumAuto && !double.IsNaN(Content.VisualProperties.YAxisMinimumFixedValue)) area.AxisY.Minimum = Content.VisualProperties.YAxisMinimumFixedValue;
-      if (!Content.VisualProperties.YAxisMaximumAuto && !double.IsNaN(Content.VisualProperties.YAxisMaximumFixedValue)) area.AxisY.Maximum = Content.VisualProperties.YAxisMaximumFixedValue;
-      if (!Content.VisualProperties.SecondYAxisMinimumAuto && !double.IsNaN(Content.VisualProperties.SecondYAxisMinimumFixedValue)) area.AxisY2.Minimum = Content.VisualProperties.SecondYAxisMinimumFixedValue;
-      if (!Content.VisualProperties.SecondYAxisMaximumAuto && !double.IsNaN(Content.VisualProperties.SecondYAxisMaximumFixedValue)) area.AxisY2.Maximum = Content.VisualProperties.SecondYAxisMaximumFixedValue;
-      if (area.AxisX.Minimum >= area.AxisX.Maximum) area.AxisX.Maximum = area.AxisX.Minimum + 1;
-      if (area.AxisX2.Minimum >= area.AxisX2.Maximum) area.AxisX2.Maximum = area.AxisX2.Minimum + 1;
-      if (area.AxisY.Minimum >= area.AxisY.Maximum) area.AxisY.Maximum = area.AxisY.Minimum + 1;
-      if (area.AxisY2.Minimum >= area.AxisY2.Maximum) area.AxisY2.Maximum = area.AxisY2.Minimum + 1;
-    }
-
-    protected virtual void UpdateYCursorInterval() {
-      double interestingValuesRange = (
-        from series in chart.Series
-        where series.Enabled
-        let values = (from point in series.Points
-                      where !point.IsEmpty
-                      select point.YValues[0]).DefaultIfEmpty(1.0)
-        let range = values.Max() - values.Min()
-        where range > 0.0
-        select range
-        ).DefaultIfEmpty(1.0).Min();
-
-      double digits = (int)Math.Log10(interestingValuesRange) - 3;
-      double yZoomInterval = Math.Pow(10, digits);
-      this.chart.ChartAreas[0].CursorY.Interval = yZoomInterval;
-    }
-
-    #region Event Handlers
-    #region Content Event Handlers
-    private void Content_VisualPropertiesChanged(object sender, EventArgs e) {
-      if (InvokeRequired)
-        Invoke(new EventHandler(Content_VisualPropertiesChanged), sender, e);
-      else {
-        ConfigureChartArea(chart.ChartAreas[0]);
-        RecalculateAxesScale(chart.ChartAreas[0]); // axes min/max could have changed
-      }
-    }
-    #endregion
-    #region Rows Event Handlers
-
-    private void SelectedRows_CollectionReset(object sender, CollectionItemsChangedEventArgs<DataRow> e) {
-      if (InvokeRequired)
-        Invoke(new CollectionItemsChangedEventHandler<DataRow>(Rows_ItemsReplaced), sender, e);
-      else {
-        RemoveSelectedDataRows(e.OldItems);
-        AddSelectedDataRows(e.Items);
-      }
-    }
-
-    private void SelectedRows_ItemsReplaced(object sender, CollectionItemsChangedEventArgs<DataRow> e) {
-      if (InvokeRequired)
-        Invoke(new CollectionItemsChangedEventHandler<DataRow>(Rows_ItemsReplaced), sender, e);
-      else {
-        RemoveSelectedDataRows(e.OldItems);
-        AddSelectedDataRows(e.Items);
-      }
-    }
-
-    private void SelectedRows_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<DataRow> e) {
-      if (InvokeRequired)
-        Invoke(new CollectionItemsChangedEventHandler<DataRow>(Rows_ItemsRemoved), sender, e);
-      else {
-        RemoveSelectedDataRows(e.Items);
-      }
-    }
-
-    private void SelectedRows_ItemsAdded(object sender, CollectionItemsChangedEventArgs<DataRow> e) {
-      if (InvokeRequired)
-        Invoke(new CollectionItemsChangedEventHandler<DataRow>(Rows_ItemsAdded), sender, e);
-      else {
-        AddSelectedDataRows(e.Items);
-      }
-    }
-
-
-    private void Rows_ItemsAdded(object sender, CollectionItemsChangedEventArgs<DataRow> e) {
-      if (InvokeRequired)
-        Invoke(new CollectionItemsChangedEventHandler<DataRow>(Rows_ItemsAdded), sender, e);
-      else {
-        AddDataRows(e.Items);
-      }
-    }
-    private void Rows_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<DataRow> e) {
-      if (InvokeRequired)
-        Invoke(new CollectionItemsChangedEventHandler<DataRow>(Rows_ItemsRemoved), sender, e);
-      else {
-        RemoveDataRows(e.Items);
-      }
-    }
-    private void Rows_ItemsReplaced(object sender, CollectionItemsChangedEventArgs<DataRow> e) {
-      if (InvokeRequired)
-        Invoke(new CollectionItemsChangedEventHandler<DataRow>(Rows_ItemsReplaced), sender, e);
-      else {
-        RemoveDataRows(e.OldItems);
-        AddDataRows(e.Items);
-      }
-    }
-    private void Rows_CollectionReset(object sender, CollectionItemsChangedEventArgs<DataRow> e) {
-      if (InvokeRequired)
-        Invoke(new CollectionItemsChangedEventHandler<DataRow>(Rows_CollectionReset), sender, e);
-      else {
-        RemoveDataRows(e.OldItems);
-        AddDataRows(e.Items);
-      }
-    }
-    #endregion
-    #region Row Event Handlers
-    private void Row_VisualPropertiesChanged(object sender, EventArgs e) {
-      if (InvokeRequired)
-        Invoke(new EventHandler(Row_VisualPropertiesChanged), sender, e);
-      else {
-        DataRow row = (DataRow)sender;
-        Series series = chart.Series[row.Name];
-        series.Points.Clear();
-        ConfigureSeries(series, row);
-        FillSeriesWithRowValues(series, row);
-        RecalculateAxesScale(chart.ChartAreas[0]);
-      }
-    }
-    private void Row_NameChanged(object sender, EventArgs e) {
-      if (InvokeRequired)
-        Invoke(new EventHandler(Row_NameChanged), sender, e);
-      else {
-        DataRow row = (DataRow)sender;
-        chart.Series[row.Name].Name = row.Name;
-      }
-    }
-    #endregion
-    #region Values Event Handlers
-    private void Values_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IndexedItem<double>> e) {
-      if (InvokeRequired)
-        Invoke(new CollectionItemsChangedEventHandler<IndexedItem<double>>(Values_ItemsAdded), sender, e);
-      else {
-        DataRow row = null;
-        valuesRowsTable.TryGetValue((IObservableList<double>)sender, out row);
-        if (row != null) {
-          Series rowSeries = chart.Series[row.Name];
-          if (!invisibleSeries.Contains(rowSeries)) {
-            rowSeries.Points.Clear();
-            FillSeriesWithRowValues(rowSeries, row);
-            RecalculateAxesScale(chart.ChartAreas[0]);
-            UpdateYCursorInterval();
-          }
-        }
-      }
-    }
-    private void Values_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<IndexedItem<double>> e) {
-      if (InvokeRequired)
-        Invoke(new CollectionItemsChangedEventHandler<IndexedItem<double>>(Values_ItemsRemoved), sender, e);
-      else {
-        DataRow row = null;
-        valuesRowsTable.TryGetValue((IObservableList<double>)sender, out row);
-        if (row != null) {
-          Series rowSeries = chart.Series[row.Name];
-          if (!invisibleSeries.Contains(rowSeries)) {
-            rowSeries.Points.Clear();
-            FillSeriesWithRowValues(rowSeries, row);
-            RecalculateAxesScale(chart.ChartAreas[0]);
-            UpdateYCursorInterval();
-          }
-        }
-      }
-    }
-    private void Values_ItemsReplaced(object sender, CollectionItemsChangedEventArgs<IndexedItem<double>> e) {
-      if (InvokeRequired)
-        Invoke(new CollectionItemsChangedEventHandler<IndexedItem<double>>(Values_ItemsReplaced), sender, e);
-      else {
-        DataRow row = null;
-        valuesRowsTable.TryGetValue((IObservableList<double>)sender, out row);
-        if (row != null) {
-          Series rowSeries = chart.Series[row.Name];
-          if (!invisibleSeries.Contains(rowSeries)) {
-            if (row.VisualProperties.ChartType == DataRowVisualProperties.DataRowChartType.Histogram) {
-              rowSeries.Points.Clear();
-              FillSeriesWithRowValues(rowSeries, row);
-            } else {
-              foreach (IndexedItem<double> item in e.Items) {
-                if (IsInvalidValue(item.Value))
-                  rowSeries.Points[item.Index].IsEmpty = true;
-                else {
-                  rowSeries.Points[item.Index].YValues = new double[] { item.Value };
-                  rowSeries.Points[item.Index].IsEmpty = false;
-                }
-              }
-            }
-            RecalculateAxesScale(chart.ChartAreas[0]);
-            UpdateYCursorInterval();
-          }
-        }
-      }
-    }
-    private void Values_ItemsMoved(object sender, CollectionItemsChangedEventArgs<IndexedItem<double>> e) {
-      if (InvokeRequired)
-        Invoke(new CollectionItemsChangedEventHandler<IndexedItem<double>>(Values_ItemsMoved), sender, e);
-      else {
-        DataRow row = null;
-        valuesRowsTable.TryGetValue((IObservableList<double>)sender, out row);
-        if (row != null) {
-          Series rowSeries = chart.Series[row.Name];
-          if (!invisibleSeries.Contains(rowSeries)) {
-            rowSeries.Points.Clear();
-            FillSeriesWithRowValues(rowSeries, row);
-            RecalculateAxesScale(chart.ChartAreas[0]);
-            UpdateYCursorInterval();
-          }
-        }
-      }
-    }
-
-    private void Values_CollectionReset(object sender, CollectionItemsChangedEventArgs<IndexedItem<double>> e) {
-      if (InvokeRequired)
-        Invoke(new CollectionItemsChangedEventHandler<IndexedItem<double>>(Values_CollectionReset), sender, e);
-      else {
-        DataRow row = null;
-        valuesRowsTable.TryGetValue((IObservableList<double>)sender, out row);
-        if (row != null) {
-          Series rowSeries = chart.Series[row.Name];
-          if (!invisibleSeries.Contains(rowSeries)) {
-            rowSeries.Points.Clear();
-            FillSeriesWithRowValues(rowSeries, row);
-            RecalculateAxesScale(chart.ChartAreas[0]);
-            UpdateYCursorInterval();
-          }
-        }
-      }
-    }
-    #endregion
-    #endregion
-
-    #region Chart Event Handlers
-    private void chart_MouseDown(object sender, MouseEventArgs e) {
-      HitTestResult result = chart.HitTest(e.X, e.Y);
-      if (result.ChartElementType == ChartElementType.LegendItem) {
-        ToggleSeriesVisible(result.Series);
-      }
-    }
-    private void chart_MouseMove(object sender, MouseEventArgs e) {
-      HitTestResult result = chart.HitTest(e.X, e.Y);
-      if (result.ChartElementType == ChartElementType.LegendItem)
-        this.Cursor = Cursors.Hand;
-      else
-        this.Cursor = Cursors.Default;
-    }
-    private void chart_CustomizeLegend(object sender, CustomizeLegendEventArgs e) {
-      foreach (LegendItem legendItem in e.LegendItems) {
-        var series = chart.Series[legendItem.SeriesName];
-        if (series != null) {
-          bool seriesIsInvisible = invisibleSeries.Contains(series);
-          foreach (LegendCell cell in legendItem.Cells) {
-            cell.ForeColor = seriesIsInvisible ? Color.Gray : Color.Black;
-          }
-        }
-      }
-    }
-    #endregion
-
-    private void ToggleSeriesVisible(Series series) {
-
-      if (!Content.Rows.Any(x => x.Name == series.Name))
-        return;
-
-      if (!invisibleSeries.Contains(series)) {
-        series.Points.Clear();
-        invisibleSeries.Add(series);
-      } else {
-        invisibleSeries.Remove(series);
-        if (Content != null) {
-
-          var row = (from r in Content.Rows
-                     where r.Name == series.Name
-                     select r).Single();
-          FillSeriesWithRowValues(series, row);
-          this.chart.Legends[series.Legend].ForeColor = Color.Black;
-          RecalculateAxesScale(chart.ChartAreas[0]);
-          UpdateYCursorInterval();
-        }
-      }
-    }
-
-    private void FillSeriesWithRowValues(Series series, DataRow row) {
-      switch (row.VisualProperties.ChartType) {
-        case DataRowVisualProperties.DataRowChartType.Histogram:
-          CalculateHistogram(series, row);
-          break;
-        default: {
-            bool yLogarithmic = series.YAxisType == AxisType.Primary
-                                  ? Content.VisualProperties.YAxisLogScale
-                                  : Content.VisualProperties.SecondYAxisLogScale;
-            bool xLogarithmic = series.XAxisType == AxisType.Primary
-                                  ? Content.VisualProperties.XAxisLogScale
-                                  : Content.VisualProperties.SecondXAxisLogScale;
-            for (int i = 0; i < row.Values.Count; i++) {
-              var value = row.Values[i];
-              var point = new DataPoint();
-              point.XValue = row.VisualProperties.StartIndexZero && !xLogarithmic ? i : i + 1;
-              if (IsInvalidValue(value) || (yLogarithmic && value <= 0))
-                point.IsEmpty = true;
-              else
-                point.YValues = new double[] { value };
-              series.Points.Add(point);
-            }
-          }
-          break;
-      }
-    }
-
-    // get minimum ignores nan values
-    private double GetMinimum(IEnumerable<double> values) {
-      double min = Double.MaxValue;
-
-      foreach (double value in values) {
-        if (!Double.IsNaN(value) && value < min)
-          min = value;
-      }
-      return min;
-    }
-
-    //get maximium ignores nan values
-    private double GetMaximum(IEnumerable<double> values) {
-      double max = Double.MinValue;
-
-      foreach (double value in values) {
-        if (!Double.IsNaN(value) && value > max)
-          max = value;
-      }
-      return max;
-    }
-
-    protected virtual void CalculateHistogram(Series series, DataRow row) {
-      if (Classification != null) {
-
-        var valuesPerClass = row.Values.Select((i, index) => new { i, j = Classification.ToList()[index] })
-                                       .GroupBy((x) => x.j)
-                                       .ToDictionary(x => x.Key, x => x.Select(v => v.i)
-                                       .ToList());
-
-        chart.Titles.Add(row.Name);
-        int featureOverallValueCount = 0;
-        if (IsDetailedChartViewEnabled)
-          featureOverallValueCount = row.Values.Count(x => !IsInvalidValue(x));
-        foreach (KeyValuePair<double, List<double>> entry in valuesPerClass) {
-          var s = new Series(row.Name + entry.Key);
-
-          ConfigureSeries(s, row);
-          AddPointsToHistogramSeries(s, row, entry.Value);
-
-          s.LegendText = entry.Key.ToString();
-          if (IsDetailedChartViewEnabled) {
-            int featureValueCount = entry.Value.Count(x => !IsInvalidValue(x));
-            s.LegendText += " Values: ";
-            s.LegendText += (featureOverallValueCount > 0) ?
-              string.Format("{0} ({1:F2}%)", featureValueCount, (featureValueCount / (double)featureOverallValueCount) * 100)
-            : "0";
-          }
-          chart.Series.Add(s);
-        }
-      } else {
-        series.Points.Clear();
-        ConfigureSeries(series, row);
-        AddPointsToHistogramSeries(series, row, null);
-      }
-    }
-
-    private void AddPointsToHistogramSeries(Series series, DataRow row, List<double> values) {
-      if (!row.Values.Any()) return;
-      int bins = row.VisualProperties.Bins;
-
-      double minValue = GetMinimum(row.Values);
-      double maxValue = GetMaximum(row.Values);
-      double intervalWidth = (maxValue - minValue) / bins;
-      if (intervalWidth < 0) return;
-      if (intervalWidth == 0) {
-        series.Points.AddXY(minValue, row.Values.Count);
-        return;
-      }
-
-
-      if (!row.VisualProperties.ExactBins) {
-        intervalWidth = HumanRoundRange(intervalWidth);
-        minValue = Math.Floor(minValue / intervalWidth) * intervalWidth;
-        maxValue = Math.Ceiling(maxValue / intervalWidth) * intervalWidth;
-      }
-
-      double intervalCenter = intervalWidth / 2;
-
-      double min = 0.0, max = 0.0;
-      if (!Double.IsNaN(Content.VisualProperties.XAxisMinimumFixedValue) && !Content.VisualProperties.XAxisMinimumAuto)
-        min = Content.VisualProperties.XAxisMinimumFixedValue;
-      else min = minValue;
-      if (!Double.IsNaN(Content.VisualProperties.XAxisMaximumFixedValue) && !Content.VisualProperties.XAxisMaximumAuto)
-        max = Content.VisualProperties.XAxisMaximumFixedValue;
-      else max = maxValue + intervalWidth;
-
-      double axisInterval = intervalWidth / row.VisualProperties.ScaleFactor;
-
-      var area = chart.ChartAreas[0];
-      area.AxisX.Interval = axisInterval;
-
-      series.SetCustomProperty("PointWidth", "1"); // 0.8 is the default value
-
-      // get the range or intervals which define the grouping of the frequency values
-      var doubleRange = DoubleRange(min, max, intervalWidth).Skip(1).ToList();
-
-
-      if (values == null) {
-        values = row.Values.ToList(); ;
-      }
-
-      // aggregate the row values by unique key and frequency value
-      var valueFrequencies = (from v in values
-                              where !IsInvalidValue(v)
-                              orderby v
-                              group v by v into g
-                              select new Tuple<double, double>(g.First(), g.Count())).ToList();
-
-      //  shift the chart to the left so the bars are placed on the intervals
-      if (Classification != null || (valueFrequencies.Any() && valueFrequencies.First().Item1 < doubleRange.First())) {
-        series.Points.Add(new DataPoint(min - intervalWidth, 0));
-        series.Points.Add(new DataPoint(max + intervalWidth, 0));
-      }
-
-      // add data points
-      int j = 0;
-      foreach (var d in doubleRange) {
-        double sum = 0.0;
-        // sum the frequency values that fall within the same interval
-        while (j < valueFrequencies.Count && valueFrequencies[j].Item1 < d) {
-          sum += valueFrequencies[j].Item2;
-          ++j;
-        }
-        string xAxisTitle = string.IsNullOrEmpty(Content.VisualProperties.XAxisTitle)
-                              ? "X"
-                              : Content.VisualProperties.XAxisTitle;
-        string yAxisTitle = string.IsNullOrEmpty(Content.VisualProperties.YAxisTitle)
-                              ? "Y"
-                              : Content.VisualProperties.YAxisTitle;
-        DataPoint newDataPoint = new DataPoint(d - intervalCenter, sum);
-        newDataPoint.ToolTip =
-          xAxisTitle + ": [" + (d - intervalWidth) + "-" + d + ")" + Environment.NewLine +
-          yAxisTitle + ": " + sum;
-        int overallValueCount = row.Values.Count();
-        if (overallValueCount > 0)
-          newDataPoint.ToolTip += string.Format(" ({0:F2}%)", (sum / overallValueCount) * 100);
-        series.Points.Add(newDataPoint);
-      }
-    }
-
-    public event EventHandler ChartDoubleClick {
-      add { chartDoubleClick += value; }
-      remove { chartDoubleClick -= value; }
-    }
-
-    #region Helpers
-    public static IEnumerable<double> DoubleRange(double min, double max, double step) {
-      double i;
-      for (i = min; i <= max; i += step)
-        yield return i;
-
-      if (i != max + step)
-        yield return i;
-    }
-
-    protected void RemoveCustomPropertyIfExists(Series series, string property) {
-      if (series.IsCustomPropertySet(property)) series.DeleteCustomProperty(property);
-    }
-
-    private double HumanRoundRange(double range) {
-      double base10 = Math.Pow(10.0, Math.Floor(Math.Log10(range)));
-      double rounding = range / base10;
-      if (rounding <= 1.5) rounding = 1;
-      else if (rounding <= 2.25) rounding = 2;
-      else if (rounding <= 3.75) rounding = 2.5;
-      else if (rounding <= 7.5) rounding = 5;
-      else rounding = 10;
-      return rounding * base10;
-    }
-
-    private double HumanRoundMax(double max) {
-      double base10;
-      if (max > 0) base10 = Math.Pow(10.0, Math.Floor(Math.Log10(max)));
-      else base10 = Math.Pow(10.0, Math.Ceiling(Math.Log10(-max)));
-      double rounding = (max > 0) ? base10 : -base10;
-      while (rounding < max) rounding += base10;
-      return rounding;
-    }
-
-    private ChartDashStyle ConvertLineStyle(DataRowVisualProperties.DataRowLineStyle dataRowLineStyle) {
-      switch (dataRowLineStyle) {
-        case DataRowVisualProperties.DataRowLineStyle.Dash:
-          return ChartDashStyle.Dash;
-        case DataRowVisualProperties.DataRowLineStyle.DashDot:
-          return ChartDashStyle.DashDot;
-        case DataRowVisualProperties.DataRowLineStyle.DashDotDot:
-          return ChartDashStyle.DashDotDot;
-        case DataRowVisualProperties.DataRowLineStyle.Dot:
-          return ChartDashStyle.Dot;
-        case DataRowVisualProperties.DataRowLineStyle.NotSet:
-          return ChartDashStyle.NotSet;
-        case DataRowVisualProperties.DataRowLineStyle.Solid:
-          return ChartDashStyle.Solid;
-        default:
-          return ChartDashStyle.NotSet;
-      }
-    }
-
-    protected static bool IsInvalidValue(double x) {
-      return double.IsNaN(x) || x < (double)decimal.MinValue || x > (double)decimal.MaxValue;
-    }
-    #endregion
-
-    //bubble double click event with data table view as sender
-    private void chart_DoubleClick(object sender, EventArgs e) {
-      if (chartDoubleClick != null)
-        chartDoubleClick(this, e);
-    }
-  }
-}
Index: /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotMultiView.cs
===================================================================
--- /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotMultiView.cs	(revision 14458)
+++ /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotMultiView.cs	(revision 14459)
@@ -253,15 +253,16 @@
       if (!bodyCache.ContainsKey(key)) {
         if (rowVariable == colVariable) { // use historgram if x and y variable are equal
-          PreprocessingDataTable dataTable = new PreprocessingDataTable();
+          var dataTable = new DataTable();
           DataRow dataRow = Content.CreateDataRow(rowVariable, DataRowVisualProperties.DataRowChartType.Histogram);
+          dataRow.VisualProperties.IsVisibleInLegend = false;
           dataTable.Rows.Add(dataRow);
-          PreprocessingDataTableView pcv = new PreprocessingDataTableView {
+          var pcv = new DataTableControl {
             Name = key.ToString(),
             Content = dataTable,
             Dock = DockStyle.Fill,
-            ShowLegend = false,
-            XAxisFormat = "G3"
+            //ShowLegend = false,
+            //XAxisFormat = "G3"
           };
-          pcv.ChartDoubleClick += HistogramDoubleClick;
+          //pcv.ChartDoubleClick += HistogramDoubleClick;
           bodyCache.Add(key, pcv);
         } else { //scatter plot
@@ -361,8 +362,8 @@
     //open histogram in new tab with new content when double clicked
     private void HistogramDoubleClick(object sender, EventArgs e) {
-      PreprocessingDataTableView pcv = (PreprocessingDataTableView)sender;
+      DataTableControl pcv = (DataTableControl)sender;
       HistogramContent histoContent = new HistogramContent(Content.PreprocessingData);  // create new content     
       histoContent.VariableItemList = Content.CreateVariableItemList();
-      PreprocessingDataTable dataTable = pcv.Content;
+      var dataTable = pcv.Content;
 
       //Set variable item list from with variable from data table
Index: /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing/3.4/Content/HistogramContent.cs
===================================================================
--- /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing/3.4/Content/HistogramContent.cs	(revision 14458)
+++ /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing/3.4/Content/HistogramContent.cs	(revision 14459)
@@ -35,16 +35,13 @@
     private const int MAX_DISTINCT_VALUES_FOR_CLASSIFCATION = 20;
 
-    private int classifierVariableIndex = 0;
+    public int ClassifierVariableIndex { get; set; }
 
-    public int ClassifierVariableIndex {
-      get { return this.classifierVariableIndex; }
-      set { this.classifierVariableIndex = value; }
-    }
-    public bool IsDetailedChartViewEnabled { get; set; }
-
+    public int Bins { get; set; }
+    public bool ExactBins { get; set; }
 
     public HistogramContent(IFilteredPreprocessingData preprocessingData)
       : base(preprocessingData) {
-      AllInOneMode = false;
+      Bins = 10;
+      ExactBins = false;
     }
 
@@ -70,5 +67,4 @@
       return doubleVariableNames;
     }
-
   }
 }
Index: /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing/3.4/Content/LineChartContent.cs
===================================================================
--- /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing/3.4/Content/LineChartContent.cs	(revision 14458)
+++ /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing/3.4/Content/LineChartContent.cs	(revision 14459)
@@ -29,4 +29,10 @@
   public class LineChartContent : PreprocessingChartContent {
 
+    private bool allInOneMode = true;
+    public bool AllInOneMode {
+      get { return this.allInOneMode; }
+      set { this.allInOneMode = value; }
+    }
+
     public static new Image StaticItemImage {
       get { return HeuristicLab.Common.Resources.VSImageLibrary.Performance; }
@@ -39,4 +45,5 @@
     public LineChartContent(LineChartContent content, Cloner cloner)
       : base(content, cloner) {
+      this.allInOneMode = content.allInOneMode;
     }
     public override IDeepCloneable Clone(Cloner cloner) {
Index: /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing/3.4/Content/PreprocessingChartContent.cs
===================================================================
--- /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing/3.4/Content/PreprocessingChartContent.cs	(revision 14458)
+++ /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing/3.4/Content/PreprocessingChartContent.cs	(revision 14459)
@@ -20,5 +20,4 @@
 #endregion
 
-using System;
 using System.Collections.Generic;
 using System.Drawing;
@@ -33,10 +32,4 @@
     public static new Image StaticItemImage {
       get { return HeuristicLab.Common.Resources.VSImageLibrary.PieChart; }
-    }
-
-    private bool allInOneMode = true;
-    public bool AllInOneMode {
-      get { return this.allInOneMode; }
-      set { this.allInOneMode = value; }
     }
 
@@ -55,5 +48,4 @@
     public PreprocessingChartContent(PreprocessingChartContent content, Cloner cloner)
       : base(content, cloner) {
-      this.allInOneMode = content.allInOneMode;
       this.PreprocessingData = content.PreprocessingData;
       this.variableItemList = cloner.Clone<ICheckedItemList<StringValue>>(variableItemList);
@@ -62,5 +54,4 @@
       return new PreprocessingChartContent(this, cloner);
     }
-
 
     public DataRow CreateDataRow(string variableName, DataRowVisualProperties.DataRowChartType chartType) {
@@ -71,56 +62,5 @@
     }
 
-    public List<DataRow> CreateAllDataRows(DataRowVisualProperties.DataRowChartType chartType) {
-      List<DataRow> dataRows = new List<DataRow>();
-      foreach (var name in PreprocessingData.GetDoubleVariableNames())
-        dataRows.Add(CreateDataRow(name, chartType));
-      return dataRows;
-    }
 
-    public DataRow CreateSelectedDataRow(string variableName, DataRowVisualProperties.DataRowChartType chartType) {
-
-      IDictionary<int, IList<int>> selection = PreprocessingData.Selection;
-      int variableIndex = PreprocessingData.GetColumnIndex(variableName);
-
-      if (selection.Keys.Contains(variableIndex)) {
-        List<int> selectedIndices = new List<int>(selection[variableIndex]);
-        //need selection with more than 1 value
-        if (selectedIndices.Count < 2)
-          return null;
-
-        selectedIndices.Sort();
-        int start = selectedIndices[0];
-        int end = selectedIndices[selectedIndices.Count - 1];
-
-        DataRow rowSelect = CreateDataRowRange(variableName, start, end, chartType);
-        return rowSelect;
-      } else
-        return null;
-    }
-
-    public DataRow CreateDataRowRange(string variableName, int start, int end, DataRowVisualProperties.DataRowChartType chartType) {
-      IList<double> values = PreprocessingData.GetValues<double>(PreprocessingData.GetColumnIndex(variableName));
-      IList<double> valuesRange = new List<double>();
-      for (int i = 0; i < values.Count; i++) {
-        if (i >= start && i <= end)
-          valuesRange.Add(values[i]);
-        else
-          valuesRange.Add(Double.NaN);
-      }
-
-      DataRow row = new DataRow(variableName, "", valuesRange);
-      row.VisualProperties.ChartType = chartType;
-      return row;
-    }
-
-    public List<DataRow> CreateAllSelectedDataRows(DataRowVisualProperties.DataRowChartType chartType) {
-      List<DataRow> dataRows = new List<DataRow>();
-      foreach (var name in PreprocessingData.GetDoubleVariableNames()) {
-        DataRow row = CreateSelectedDataRow(name, chartType);
-        if (row != null)
-          dataRows.Add(row);
-      }
-      return dataRows;
-    }
 
 
Index: anches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing/3.4/Content/PreprocessingDataTable.cs
===================================================================
--- /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing/3.4/Content/PreprocessingDataTable.cs	(revision 14458)
+++ 	(revision )
@@ -1,58 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-using System;
-using HeuristicLab.Analysis;
-using HeuristicLab.Common;
-using HeuristicLab.Core;
-
-namespace HeuristicLab.DataPreprocessing {
-  [Item("PreprossingDataTable", "A table of data values.")]
-  public class PreprocessingDataTable : DataTable {
-
-    public PreprocessingDataTable()
-      : base() {
-      SelectedRows = new NamedItemCollection<DataRow>();
-    }
-    public PreprocessingDataTable(string name)
-      : base(name) {
-      SelectedRows = new NamedItemCollection<DataRow>();
-    }
-
-    protected PreprocessingDataTable(PreprocessingDataTable original, Cloner cloner)
-      : base(original, cloner) {
-      this.selectedRows = cloner.Clone(original.selectedRows);
-    }
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new PreprocessingDataTable(this, cloner);
-    }
-
-    private NamedItemCollection<DataRow> selectedRows;
-    public NamedItemCollection<DataRow> SelectedRows {
-      get { return selectedRows; }
-      private set {
-        if (selectedRows != null) throw new InvalidOperationException("Rows already set");
-        selectedRows = value;
-      }
-    }
-
-  }
-}
Index: /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing/3.4/HeuristicLab.DataPreprocessing-3.4.csproj
===================================================================
--- /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing/3.4/HeuristicLab.DataPreprocessing-3.4.csproj	(revision 14458)
+++ /branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing/3.4/HeuristicLab.DataPreprocessing-3.4.csproj	(revision 14459)
@@ -126,5 +126,4 @@
     <Compile Include="Content\PreprocessingChartContent.cs" />
     <Compile Include="Data\PreprocessingData.cs" />
-    <Compile Include="Content\PreprocessingDataTable.cs" />
     <Compile Include="Content\IViewChartShortcut.cs" />
     <Compile Include="Data\IFilteredPreprocessingData.cs" />
