Index: branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Controllers/ChartController.cs
===================================================================
--- branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Controllers/ChartController.cs	(revision 6170)
+++ branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Controllers/ChartController.cs	(revision 6171)
@@ -7,4 +7,7 @@
 using HLWebOKBQueryPlugin.Helpers;
 using HLWebOKBQueryPlugin.OKBQueryService;
+using System.Web.UI.DataVisualization.Charting;
+using System.Drawing;
+using System.IO;
 
 namespace HLWebOKBQueryPlugin.Controllers {
@@ -43,4 +46,90 @@
 
 
+
+    public FileResult CreateBubbleChart(ChartModel model)
+    {
+        IList<int> items = new List<int>();
+
+        items.Add(1);
+        items.Add(2);
+        items.Add(5);
+        items.Add(10);
+
+        Chart chart = new Chart();
+        chart.Width = 700;
+        chart.Height = 300;
+        chart.BackColor = Color.FromArgb(211, 223, 240);
+        chart.BorderlineDashStyle = ChartDashStyle.Solid;
+        chart.BackSecondaryColor = Color.White;
+        chart.BackGradientStyle = GradientStyle.TopBottom;
+        chart.BorderlineWidth = 1;
+        chart.Palette = ChartColorPalette.BrightPastel;
+        chart.BorderlineColor = Color.FromArgb(26, 59, 105);
+        chart.RenderType = RenderType.BinaryStreaming;
+        chart.BorderSkin.SkinStyle = BorderSkinStyle.Emboss;
+        chart.AntiAliasing = AntiAliasingStyles.All;
+        chart.TextAntiAliasingQuality = TextAntiAliasingQuality.Normal;
+        chart.Titles.Add("Bubble Chart");
+        //chart.Legends.Add(CreateLegend());
+        chart.Series.Add(CreateSeries(items,SeriesChartType.Bubble));
+        chart.ChartAreas.Add(CreateChartArea());
+
+
+
+        MemoryStream ms = new MemoryStream();
+        chart.SaveImage(ms);
+        return File(ms.GetBuffer(), @"image/png");
+    }
+
+
+
+    public Series CreateSeries(IList<int> results, SeriesChartType chartType)
+    {
+        Series seriesDetail = new Series();
+        seriesDetail.Name = "Result Chart";
+        seriesDetail.IsValueShownAsLabel = false;
+        seriesDetail.Color = Color.FromArgb(198, 99, 99);
+        seriesDetail.ChartType = chartType;
+        seriesDetail.BorderWidth = 2;
+        DataPoint 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;
+    }
+
+
+
+    public ChartArea CreateChartArea()
+    {
+        ChartArea chartArea = new ChartArea();
+        chartArea.Name = "Result Chart";
+        chartArea.BackColor = Color.Transparent;
+        chartArea.AxisX.IsLabelAutoFit = false;
+        chartArea.AxisY.IsLabelAutoFit = false;
+        chartArea.AxisX.LabelStyle.Font =
+           new Font("Verdana,Arial,Helvetica,sans-serif",
+                    8F, FontStyle.Regular);
+        chartArea.AxisY.LabelStyle.Font =
+           new Font("Verdana,Arial,Helvetica,sans-serif",
+                    8F, FontStyle.Regular);
+        chartArea.AxisY.LineColor = Color.FromArgb(64, 64, 64, 64);
+        chartArea.AxisX.LineColor = Color.FromArgb(64, 64, 64, 64);
+        chartArea.AxisY.MajorGrid.LineColor = Color.FromArgb(64, 64, 64, 64);
+        chartArea.AxisX.MajorGrid.LineColor = Color.FromArgb(64, 64, 64, 64);
+        chartArea.AxisX.Interval = 1;
+
+        return chartArea;
+    }
+
+
+
+
     public ActionResult Index() {
       ChartModel cm = new ChartModel();
Index: branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Views/Chart/BubbleChart.ascx
===================================================================
--- branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Views/Chart/BubbleChart.ascx	(revision 6170)
+++ branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Views/Chart/BubbleChart.ascx	(revision 6171)
@@ -21,55 +21,3 @@
 
 
-    <asp:Chart ID="bubbleChart" runat="server" Visible="true"  />
-
-
-<%
-  if (((ChartModel)Model).Series != null) {
-    //bubbleChart = new Chart();
-    bubbleChart.Width = 150;
-    bubbleChart.Height = 300;
-    bubbleChart.Attributes.Add("align", "left");
-    bubbleChart.Titles.Add("bubbe chart");
-    bubbleChart.ChartAreas.Add(new ChartArea());
-    Response.Write(((ChartModel)Model).Series.Points.Count);
-    bubbleChart.Series.Add(((ChartModel)Model).Series);
-    bubbleChart.Legends.Add(new Legend("DBAs"));
-    bubbleChart.Legends[0].TableStyle = LegendTableStyle.Auto;
-    bubbleChart.Legends[0].Docking = Docking.Bottom;
-    bubbleChart.DataBind();
-  }
-
-
-
-  //Chart chart = new Chart();
-  //chart.BackColor = System.Drawing.Color.Transparent;
-  //chart.Width = Unit.Pixel(250);
-  //chart.Height = Unit.Pixel(100);
-
-  //Series series1 = new Series("Series1");
-  //series1.ChartArea = "ca1";
-  //series1.ChartType = SeriesChartType.Pie;
-  //series1.Font = new System.Drawing.Font("Verdana", 8.25f, System.Drawing.FontStyle.Regular);
-  //series1.Points.Add(new DataPoint {
-  //  AxisLabel = "Value1", YValues = new double[] { 1, 2, 3.1 }
-  //});
-  //series1.Points.Add(new DataPoint {
-  //  AxisLabel = "Value2", YValues = new double[] { 1, 2, 3.1 }
-  //});
-  //chart.Series.Add(series1);
-
-  //ChartArea ca1 = new ChartArea("ca1");
-  //ca1.BackColor = System.Drawing.Color.Transparent;
-  //chart.ChartAreas.Add(ca1);
-
-  //using (var ms = new System.IO.MemoryStream()) {
-  //  chart.SaveImage(ms, ChartImageFormat.Png);
-  //  ms.Seek(0, System.IO.SeekOrigin.Begin);
-
-  //  Response.Write(new FileStreamResult(ms, "image/png"));
-  //}
-
-
- %>
-
-
+<img src="/Chart/CreateBubbleChart?<%= Model %>"  alt="" /> 
