title: highcharts example for using data from database with mvc
body: <p>Does anyone have a simple example of populating a Highchart with data from a MS SQL DB using DotNet.Highcarts?</p>
  
  <p>I have the demo working with static data</p>
  
  <pre><code>Highcharts chart = new Highcharts("chart")
          .SetCredits(new Credits { Enabled = false })
          .InitChart(new Chart { DefaultSeriesType = ChartTypes.Column })
          .SetTitle(new Title { Text = "Membership Overview" })
          .SetXAxis(new XAxis { Categories = new[] { "Paid Members", "Active Members", "Retained Members", "New Members", "Lapsed Members" } })
          .SetYAxis(new YAxis
          {
              Min = 0,
              Title = new YAxisTitle { Text = "Total Members" }
          })
          .SetTooltip(new Tooltip { Formatter = "function() { return ''+ this.series.name +': '+ this.y +''; }" })
          .SetPlotOptions(new PlotOptions { Bar = new PlotOptionsBar { Stacking = Stackings.Normal } })
          .SetSeries(new[]
                     {
                         new Series { Name = "Total", Data = new Data(new object[] { 441, 441, 22, 30, 610 }) }
                      });
  </code></pre>
  
  <p>How can I change the Series to accept data from my DB?</p>
  
  <p>Assuming I need to connect to DB like so:</p>
  
  <pre><code>var newcustomer = db.Customer;
  </code></pre>
  
  <p>Then do something like this:</p>
  
  <pre><code>new Series
  {
      Name = "Total",
      Data = new Data(newcustomer.Select(x =&gt; ............
  </code></pre>
  
  <p>Any help would be appreciated!</p>