Index: trunk/sources/HeuristicLab.CEDMA.Charting/3.3/BubbleChart.cs
===================================================================
--- trunk/sources/HeuristicLab.CEDMA.Charting/3.3/BubbleChart.cs	(revision 2137)
+++ trunk/sources/HeuristicLab.CEDMA.Charting/3.3/BubbleChart.cs	(revision 2139)
@@ -56,5 +56,5 @@
     private double maxX = double.NegativeInfinity;
     private double maxY = double.NegativeInfinity;
-    private List<ResultsEntry> records;
+    private List<ResultsEntry> filteredEntries;
     private Results results;
     private Dictionary<IPrimitive, ResultsEntry> primitiveToEntryDictionary;
@@ -64,7 +64,8 @@
     public BubbleChart(Results results, PointD lowerLeft, PointD upperRight)
       : base(lowerLeft, upperRight) {
-      records = new List<ResultsEntry>();
+      //      records = new List<ResultsEntry>();
       primitiveToEntryDictionary = new Dictionary<IPrimitive, ResultsEntry>();
       this.results = results;
+      filteredEntries = new List<ResultsEntry>();
 
       foreach (var resultsEntry in results.GetEntries()) {
@@ -73,5 +74,5 @@
         if (resultsEntry.Get(Y_JITTER) == null)
           resultsEntry.Set(Y_JITTER, random.NextDouble() * 2.0 - 1.0);
-        records.Add(resultsEntry);
+        //        records.Add(resultsEntry);
       }
 
@@ -123,5 +124,5 @@
       double minSize = 1;
       if (sizeDimension != null && results.OrdinalVariables.Contains(sizeDimension)) {
-        var sizes = records
+        var sizes = results.GetEntries()
           .Select(x => Convert.ToDouble(x.Get(sizeDimension)))
           .Where(size => !double.IsInfinity(size) && size != double.MaxValue && size != double.MinValue)
@@ -139,5 +140,5 @@
       Group.Add(new Axis(this, 0, 0, AxisType.Both));
       UpdateViewSize(0, 0, 5);
-      foreach (ResultsEntry r in records) {
+      foreach (ResultsEntry r in results.GetEntries().Where(x => x.Visible)) {
         List<double> xs = new List<double>();
         List<double> ys = new List<double>();
@@ -145,8 +146,8 @@
         List<object> actualYValues = new List<object>();
         int size;
-        if (results.OrdinalVariables.Contains(xDimension)) {
+        if (results.OrdinalVariables.Contains(xDimension) && r.Get(xDimension) != null) {
           xs.Add(Convert.ToDouble(r.Get(xDimension)) + (double)r.Get(X_JITTER) * xJitterFactor);
           actualXValues.Add(r.Get(xDimension));
-        } else if (results.CategoricalVariables.Contains(xDimension)) {
+        } else if (results.CategoricalVariables.Contains(xDimension) && r.Get(xDimension) != null) {
           xs.Add(results.IndexOfCategoricalValue(xDimension, r.Get(xDimension)) + (double)r.Get(X_JITTER) * xJitterFactor);
           actualXValues.Add(r.Get(xDimension));
@@ -155,6 +156,8 @@
           IEnumerable<ResultsEntry> subEntries = (IEnumerable<ResultsEntry>)r.Get(path.ElementAt(0));
           foreach (ResultsEntry subEntry in subEntries) {
-            xs.Add(results.IndexOfCategoricalValue(xDimension, subEntry.Get(path.ElementAt(1))) + (double)r.Get(X_JITTER) * xJitterFactor);
-            actualXValues.Add(subEntry.Get(path.ElementAt(1)));
+            if (subEntry.Get(path.ElementAt(1)) != null) {
+              xs.Add(results.IndexOfCategoricalValue(xDimension, subEntry.Get(path.ElementAt(1))) + (double)r.Get(X_JITTER) * xJitterFactor);
+              actualXValues.Add(subEntry.Get(path.ElementAt(1)));
+            }
           }
         } else if (results.MultiDimensionalOrdinalVariables.Contains(xDimension)) {
@@ -162,12 +165,14 @@
           IEnumerable<ResultsEntry> subEntries = (IEnumerable<ResultsEntry>)r.Get(path.ElementAt(0));
           foreach (ResultsEntry subEntry in subEntries) {
-            xs.Add(Convert.ToDouble(subEntry.Get(path.ElementAt(1))) + (double)r.Get(X_JITTER) * xJitterFactor);
-            actualXValues.Add(subEntry.Get(path.ElementAt(1)));
-          }
-        }
-        if (results.OrdinalVariables.Contains(yDimension)) {
+            if (subEntry.Get(path.ElementAt(1)) != null) {
+              xs.Add(Convert.ToDouble(subEntry.Get(path.ElementAt(1))) + (double)r.Get(X_JITTER) * xJitterFactor);
+              actualXValues.Add(subEntry.Get(path.ElementAt(1)));
+            }
+          }
+        }
+        if (results.OrdinalVariables.Contains(yDimension) && r.Get(yDimension) != null) {
           ys.Add(Convert.ToDouble(r.Get(yDimension)) + (double)r.Get(Y_JITTER) * yJitterFactor);
           actualYValues.Add(r.Get(yDimension));
-        } else if (results.CategoricalVariables.Contains(yDimension)) {
+        } else if (results.CategoricalVariables.Contains(yDimension) && r.Get(yDimension) != null) {
           ys.Add(results.IndexOfCategoricalValue(yDimension, r.Get(yDimension)) + (double)r.Get(Y_JITTER) * yJitterFactor);
           actualYValues.Add(r.Get(yDimension));
@@ -176,6 +181,8 @@
           IEnumerable<ResultsEntry> subEntries = (IEnumerable<ResultsEntry>)r.Get(path.ElementAt(0));
           foreach (ResultsEntry subEntry in subEntries) {
-            ys.Add(results.IndexOfCategoricalValue(yDimension, subEntry.Get(path.ElementAt(1))) + (double)r.Get(Y_JITTER) * yJitterFactor);
-            actualYValues.Add(subEntry.Get(path.ElementAt(1)));
+            if (subEntry.Get(path.ElementAt(1)) != null) {
+              ys.Add(results.IndexOfCategoricalValue(yDimension, subEntry.Get(path.ElementAt(1))) + (double)r.Get(Y_JITTER) * yJitterFactor);
+              actualYValues.Add(subEntry.Get(path.ElementAt(1)));
+            }
           }
         } else if (results.MultiDimensionalOrdinalVariables.Contains(yDimension)) {
@@ -183,6 +190,8 @@
           IEnumerable<ResultsEntry> subEntries = (IEnumerable<ResultsEntry>)r.Get(path.ElementAt(0));
           foreach (ResultsEntry subEntry in subEntries) {
-            ys.Add(Convert.ToDouble(subEntry.Get(path.ElementAt(1))) + (double)r.Get(Y_JITTER) * yJitterFactor);
-            actualYValues.Add(subEntry.Get(path.ElementAt(1)));
+            if (subEntry.Get(path.ElementAt(1)) != null) {
+              ys.Add(Convert.ToDouble(subEntry.Get(path.ElementAt(1))) + (double)r.Get(Y_JITTER) * yJitterFactor);
+              actualYValues.Add(subEntry.Get(path.ElementAt(1)));
+            }
           }
         }
@@ -324,4 +333,37 @@
       }
     }
+
+    internal void ToggleSelected() {
+      foreach (ResultsEntry entry in results.GetEntries()) {
+        entry.ToggleSelected();
+      }
+      results.FireChanged();
+    }
+
+    internal void ClearSelection() {
+      foreach (ResultsEntry entry in results.GetEntries().Where(x=>x.Selected)) {
+        entry.ToggleSelected();
+      }
+      results.FireChanged();
+    }
+
+    internal void ApplyFilter(Func<ResultsEntry, bool> filterPred) {
+      foreach (ResultsEntry r in results.GetEntries()) {
+        if (filterPred(r)) {
+          r.Visible = false;
+          r.Selected = false;
+          filteredEntries.Add(r);
+        } 
+      }
+      results.FireChanged();
+    }
+
+    internal void ClearFilter() {
+      foreach (ResultsEntry r in filteredEntries) {
+        r.Visible = true;
+      }
+      filteredEntries.Clear();
+      results.FireChanged();
+    }
   }
 }
Index: trunk/sources/HeuristicLab.CEDMA.Charting/3.3/BubbleChartControl.Designer.cs
===================================================================
--- trunk/sources/HeuristicLab.CEDMA.Charting/3.3/BubbleChartControl.Designer.cs	(revision 2137)
+++ trunk/sources/HeuristicLab.CEDMA.Charting/3.3/BubbleChartControl.Designer.cs	(revision 2139)
@@ -51,5 +51,10 @@
       this.zoomToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
       this.selectToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+      this.invertSelectionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+      this.filterToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
       this.toolTip = new System.Windows.Forms.ToolTip(this.components);
+      this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
+      this.clearSelectionMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+      this.showHiddenToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
       ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).BeginInit();
       this.pictureBoxContextMenuStrip.SuspendLayout();
@@ -82,12 +87,17 @@
             this.moveToolStripMenuItem,
             this.zoomToolStripMenuItem,
-            this.selectToolStripMenuItem});
+            this.selectToolStripMenuItem,
+            this.toolStripSeparator1,
+            this.clearSelectionMenuItem,
+            this.invertSelectionToolStripMenuItem,
+            this.filterToolStripMenuItem,
+            this.showHiddenToolStripMenuItem});
       this.pictureBoxContextMenuStrip.Name = "pictureBoxContextMenuStrip";
-      this.pictureBoxContextMenuStrip.Size = new System.Drawing.Size(153, 92);
+      this.pictureBoxContextMenuStrip.Size = new System.Drawing.Size(155, 186);
       // 
       // moveToolStripMenuItem
       // 
       this.moveToolStripMenuItem.Name = "moveToolStripMenuItem";
-      this.moveToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
+      this.moveToolStripMenuItem.Size = new System.Drawing.Size(154, 22);
       this.moveToolStripMenuItem.Text = "Move";
       this.moveToolStripMenuItem.Click += new System.EventHandler(this.moveToolStripMenuItem_Click);
@@ -96,5 +106,5 @@
       // 
       this.zoomToolStripMenuItem.Name = "zoomToolStripMenuItem";
-      this.zoomToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
+      this.zoomToolStripMenuItem.Size = new System.Drawing.Size(154, 22);
       this.zoomToolStripMenuItem.Text = "&Zoom";
       this.zoomToolStripMenuItem.Click += new System.EventHandler(this.zoomToolStripMenuItem_Click);
@@ -103,7 +113,41 @@
       // 
       this.selectToolStripMenuItem.Name = "selectToolStripMenuItem";
-      this.selectToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
+      this.selectToolStripMenuItem.Size = new System.Drawing.Size(154, 22);
       this.selectToolStripMenuItem.Text = "&Select";
       this.selectToolStripMenuItem.Click += new System.EventHandler(this.selectToolStripMenuItem_Click);
+      // 
+      // invertSelectionToolStripMenuItem
+      // 
+      this.invertSelectionToolStripMenuItem.Name = "invertSelectionToolStripMenuItem";
+      this.invertSelectionToolStripMenuItem.Size = new System.Drawing.Size(154, 22);
+      this.invertSelectionToolStripMenuItem.Text = "Invert selection";
+      this.invertSelectionToolStripMenuItem.Click += new System.EventHandler(this.invertSelectionToolStripMenuItem_Click);
+      // 
+      // filterToolStripMenuItem
+      // 
+      this.filterToolStripMenuItem.Name = "filterToolStripMenuItem";
+      this.filterToolStripMenuItem.Size = new System.Drawing.Size(154, 22);
+      this.filterToolStripMenuItem.Text = "Hide selected";
+      this.filterToolStripMenuItem.Click += new System.EventHandler(this.hideSelectedToolStripMenuItem_Click);
+      // 
+      // toolStripSeparator1
+      // 
+      this.toolStripSeparator1.Name = "toolStripSeparator1";
+      this.toolStripSeparator1.Size = new System.Drawing.Size(151, 6);
+      // 
+      // clearSelectionMenuItem
+      // 
+      this.clearSelectionMenuItem.Name = "clearSelectionMenuItem";
+      this.clearSelectionMenuItem.Size = new System.Drawing.Size(154, 22);
+      this.clearSelectionMenuItem.Text = "Clear selection";
+      this.clearSelectionMenuItem.Click += new System.EventHandler(this.clearSelectionMenuItem_Click);
+      // 
+      // showHiddenToolStripMenuItem
+      // 
+      this.showHiddenToolStripMenuItem.Enabled = false;
+      this.showHiddenToolStripMenuItem.Name = "showHiddenToolStripMenuItem";
+      this.showHiddenToolStripMenuItem.Size = new System.Drawing.Size(154, 22);
+      this.showHiddenToolStripMenuItem.Text = "Show hidden";
+      this.showHiddenToolStripMenuItem.Click += new System.EventHandler(this.showHiddenToolStripMenuItem_Click);
       // 
       // BubbleChartControl
@@ -129,4 +173,9 @@
     protected System.Windows.Forms.ToolStripMenuItem selectToolStripMenuItem;
     private System.Windows.Forms.ToolStripMenuItem moveToolStripMenuItem;
+    private System.Windows.Forms.ToolStripMenuItem invertSelectionToolStripMenuItem;
+    private System.Windows.Forms.ToolStripMenuItem filterToolStripMenuItem;
+    private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
+    private System.Windows.Forms.ToolStripMenuItem clearSelectionMenuItem;
+    private System.Windows.Forms.ToolStripMenuItem showHiddenToolStripMenuItem;
 
   }
Index: trunk/sources/HeuristicLab.CEDMA.Charting/3.3/BubbleChartControl.cs
===================================================================
--- trunk/sources/HeuristicLab.CEDMA.Charting/3.3/BubbleChartControl.cs	(revision 2137)
+++ trunk/sources/HeuristicLab.CEDMA.Charting/3.3/BubbleChartControl.cs	(revision 2139)
@@ -177,4 +177,22 @@
       Chart.MouseDoubleClick(e.Location, e.Button);
     }
+
+    private void invertSelectionToolStripMenuItem_Click(object sender, EventArgs e) {
+      Chart.ToggleSelected();
+    }
+
+    private void hideSelectedToolStripMenuItem_Click(object sender, EventArgs e) {
+      showHiddenToolStripMenuItem.Enabled = true;
+      Chart.ApplyFilter(x => x.Selected == true && x.Visible==true);
+    }
+
+    private void clearSelectionMenuItem_Click(object sender, EventArgs e) {
+      Chart.ClearSelection();
+    }
+
+    private void showHiddenToolStripMenuItem_Click(object sender, EventArgs e) {
+      Chart.ClearFilter();
+      showHiddenToolStripMenuItem.Enabled = false;
+    }
   }
 }
