Friday 15 August 2014

asp.net mvc - example of highchart for mvc4 -


Friends I'm new to HighTech , you helped to create charts in MVC 4, , I write the code on the home controller ...

  public class home controller: controller {public performance index} (high chart chart = new highchart ("chart "). Set credits (new credit {enabled = false}). Interest (new chart {DefaultSeriesType = ChartTypes.Column}) .SetTitle (new title {text =" subscriptions "New members", "missing member"}}) .SetxAxis (new) YAxis {Minimum = 0, Title = New YAxisTitle {text = "Total Members"}}) .SetTooltip (New Tooltip {Formatter = "function () {return '' + this.series.name + ':' + this.y + ''}} "}) .set plot option (new plot option {time = new plotoptsbar {stacking = Stackings.Normal}}) .settings (new [] {new series {name =" total ", data = new data (New object [] {441, 441, 22, 30, 610})}}); See Return (chart); }}   

Now I do not understand how to render it on the index.cshtml page.

Your index.cshtml page should look something like this to display your chart.

  @model dotnet.highcharts.Highcharts @ {var chart = model; } If (model! = Null) {@ (chart)}    

No comments:

Post a Comment