Index: branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Controllers/ChartController.cs
===================================================================
--- branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Controllers/ChartController.cs	(revision 6226)
+++ branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Controllers/ChartController.cs	(revision 6242)
@@ -33,10 +33,10 @@
       QueryServiceClient client = Query.GetClientFactory("okbtester", "okbtester");
 
-      long[] runIds = new long[5];
-      for (int i = 0; i < 5; i++) {
+      long[] runIds = new long[104];
+      for (int i = 0; i < 104; i++) {
         runIds[i] = i;
       }
       Run[] runs = client.GetRuns(runIds, false);
-
+      //cm.Runs = runs;
       cm.UpdateRunCollection(runs);
       cm.UpdateBubbleChart(selectedAxisY, selectedAxisX, selectedBubbleSize);
@@ -49,10 +49,9 @@
     public FileResult CreateBubbleChart(ChartModel model)
     {
-        IList<int> items = new List<int>();
-
-        items.Add(1);
-        items.Add(2);
-        items.Add(5);
-        items.Add(10);
+        //IList<int> items = new List<int>();
+        //items.Add(1);
+        //items.Add(2);
+        //items.Add(5);
+        //items.Add(10);
 
         Chart chart = new Chart();
@@ -72,7 +71,6 @@
         chart.Titles.Add("Bubble Chart");
         //chart.Legends.Add(CreateLegend());
-        chart.Series.Add(CreateSeries(items,SeriesChartType.Bubble));
+        chart.Series.Add(CreateSeries(model,SeriesChartType.Bubble));
         chart.ChartAreas.Add(CreateChartArea());
-
 
 
@@ -82,7 +80,65 @@
     }
 
-
-
-    public Series CreateSeries(IList<int> results, SeriesChartType chartType)
+    private Dictionary<string, Dictionary<object, double>> categoricalMap = new Dictionary<string,Dictionary<object,double>>();
+    private Dictionary<string, Dictionary<object, double>> CategoricalMap {
+        get { return categoricalMap; }
+        set { categoricalMap = value; }
+    }
+
+    private double GetCategoricalValue(string columnName, string value) {
+        if (!this.CategoricalMap.ContainsKey(columnName)) {
+            this.CategoricalMap[columnName] = new Dictionary<object, double>();
+        }
+        if (!this.CategoricalMap[columnName].ContainsKey(value)) {
+            if (this.CategoricalMap[columnName].Values.Count == 0) {
+                this.CategoricalMap[columnName][value] = 1.0;
+            }
+            else {
+                this.CategoricalMap[columnName][value] = this.CategoricalMap[columnName].Values.Max() + 1.0;
+            }
+        }
+        return this.CategoricalMap[columnName][value];
+    }
+
+    private double? GetValue(Run run, String columnName) {
+        if ((run == null) || string.IsNullOrEmpty(columnName)) {
+            return null;
+        }
+        Value value = run.ResultValues.FirstOrDefault(x => x.Name == columnName);
+
+        if (value == null) {
+            return null;
+        }
+
+        DoubleValue doubleValue = value as DoubleValue;
+        IntValue intValue = value as IntValue;
+        BoolValue boolValue = value as BoolValue;
+        FloatValue floatValue = value as FloatValue;
+        BinaryValue binaryValue = value as BinaryValue;
+        LongValue longValue = value as LongValue;
+        StringValue stringValue = value as StringValue;
+
+        double? ret = null;
+        if (doubleValue != null) {
+            if (!double.IsNaN(doubleValue.Value) && !double.IsInfinity(doubleValue.Value)) {
+                ret = doubleValue.Value;
+            }
+        }
+        else if (intValue != null) {
+            ret = intValue.Value;
+        }
+        else if (floatValue != null) {
+            ret = floatValue.Value;
+        }
+        else if (longValue != null) {
+            ret = longValue.Value;
+        }
+        else {
+            ret = GetCategoricalValue(columnName, value.ToString());
+        }
+        return ret;
+    }
+
+    public Series CreateSeries(ChartModel model, SeriesChartType chartType)
     {
         Series seriesDetail = new Series();
@@ -94,11 +150,30 @@
         DataPoint point;
 
-        foreach (int result in results)
-        {
-            point = new DataPoint();
-            point.AxisLabel = result.ToString();
-            point.YValues = new double[] { (double)result };
-            seriesDetail.Points.Add(point);
-        }
+        foreach (Run run in model.Runs) {
+            double? xValue, yValue, sValue;
+            xValue = GetValue(run, model.xAxisValue);
+            yValue = GetValue(run, model.yAxisValue);
+            sValue = GetValue(run, model.sizeAxisValue);
+
+            if (xValue.HasValue && yValue.HasValue && sValue.HasValue) {
+                xValue = xValue.Value;
+                yValue = yValue.Value;
+                sValue = sValue.Value;
+                double[] yValues = { (double)yValue, (double)sValue };
+                point = new DataPoint(xValue.Value, yValues);
+                point.Tag = run;
+                point.MarkerStyle = MarkerStyle.Circle;
+                point.Color = Color.Blue; ;
+                seriesDetail.Points.Add(point);
+            }
+        }
+
+        //foreach (int result in results)
+        //{
+        //    point = new DataPoint();
+        //    point.AxisLabel = result.ToString();
+        //    point.YValues = new double[] { (double)result };
+        //    seriesDetail.Points.Add(point);
+        //}
         seriesDetail.ChartArea = "Result Chart";
         return seriesDetail;
@@ -154,4 +229,16 @@
       ChartModel cm = new ChartModel();
 
+      //// Later, we will get the runs from the session ...
+      //QueryServiceClient client = Query.GetClientFactory("okbtester", "okbtester");
+
+      //long[] runIds = new long[5];
+      //for (int i = 0; i < 5; i++) {
+      //    runIds[i] = i;
+      //}
+      //Run[] runs = client.GetRuns(runIds, false);
+      ////cm.Runs = runs;
+      //cm.UpdateRunCollection(runs);
+      ////cm.UpdateBubbleChart(selectedAxisY, selectedAxisX, selectedBubbleSize);
+
       return PartialView("BubbleChart", cm); // name of usercontrol
     }
Index: branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Models/ChartModel.cs
===================================================================
--- branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Models/ChartModel.cs	(revision 6226)
+++ branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Models/ChartModel.cs	(revision 6242)
@@ -14,7 +14,21 @@
 
     private Color DataPointColor = System.Drawing.Color.Black;
-    private String xAxisValue;
-    private String yAxisValue;
-    private String sizeAxisValue;
+    //private String xAxisValue;
+    //private String yAxisValue;
+    //private String sizeAxisValue;
+
+    public String xAxisValue {
+        get { return (HttpContext.Current.Session["xAxisValue"] == null) ? null : (String)HttpContext.Current.Session["xAxisValue"]; }
+        set { HttpContext.Current.Session["xAxisValue"] = value; }
+    }
+    public String yAxisValue {
+        get { return (HttpContext.Current.Session["yAxisValue"] == null) ? null : (String)HttpContext.Current.Session["yAxisValue"]; }
+        set { HttpContext.Current.Session["yAxisValue"] = value; }
+    }
+    public String sizeAxisValue {
+        get { return (HttpContext.Current.Session["sizeAxisValue"] == null) ? null : (String)HttpContext.Current.Session["sizeAxisValue"]; }
+        set { HttpContext.Current.Session["sizeAxisValue"] = value; }
+    }
+
 
     private Dictionary<string, Dictionary<object, double>> CategoricalMap {
@@ -23,11 +37,16 @@
     }
 
+    //public Run[] Runs {
+    //  set;
+    //  get;
+    //  // {
+    //  //UpdateComboBoxValues(value);
+
+    //  //}
+    //}
+
     public Run[] Runs {
-      set;
-      get;
-      // {
-      //UpdateComboBoxValues(value);
-
-      //}
+        get { return (HttpContext.Current.Session["runs"] == null) ? null : (Run[])HttpContext.Current.Session["runs"]; }
+        set { HttpContext.Current.Session["runs"] = value; }
     }
 
