title: How to display Graph/Chart in MVC 4 using database?
body: <p>I am new in ASP.Net MVC and i am doing a project in which i have to display a chart using database. Let say there is a field in database "Average". If we find 4 records against some specific user id, then the graph should be like 4 bars and each bars on x-axis represents the number like 1 2 3 4 and on y-axis, there should be the average. I have tried many things like high-charts but its not working, it gives error "DotNet could not be found(are you missing assemble references)". I have searched it and got that there is a problem of .net framework. but honestly i am failed to build a graph. I tried web helper, through this i just created an image of graph but don't know hot connect with database.</p>
  
  <hr>
  
  <p>I tried but still not working with highcharts
  This is my action method</p>
  
  <pre><code> public ActionResult Index()
          {
              Highcharts chart = new DotNet.Highcharts.Highcharts("chart")
             .SetXAxis(new XAxis
                         {
                             Categories = new[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }
                         })
             .SetSeries(new Series
                         {
                             Data = new Data(new object[] { 29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4 })
                         });
  
              return View(chart);
  
          }
  </code></pre>
  
  <p>and this is my view.cshtml</p>
  
  <pre><code>@model DotNet.Highcharts.Highcharts
  @{
      ViewBag.Title = "Index";
  }
  &lt;header&gt;
      &lt;script src="~/Scripts/jquery-1.5.1.min.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="~/Scripts/highcharts.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;/header&gt;
  
  
  
  @(Model)
  </code></pre>
  
  <p>So please someone give example with code. I will appreciated.</p>