c# - use Line chart from highchart -
i going use line chart highchart library in .netcore c# project. new matter. following highcharts.net instruction looks easy. have copied
<highchart:linechart id="hcvendas" runat="server" width="500" height="350" />
in about.cshtml , left below code in controller:
public iactionresult about() { //defining axis hcvendas.yaxis.add(new yaxisitem { title = new title("faturamento") }); hcvendas.xaxis.add(new xaxisitem { categories = new[] { "1994", "1995", "1996", "1997", "1998", "1999", "2000", "2001", "2002" } }); //new data collection var series = new collection<serie>(); series.add(new serie { data = new object[] { 400, 435, 446, 479, 554, 634, 687, 750, 831 } }); //bind hcvendas.datasource = series; hcvendas.databind(); if (user.isinrole("adminstrators")) viewdata["message"] = "your application description page."; return view(); }
but receive error "error cs0103 name 'hcvendas' not exist in current context" idea highly appreciated.
wiki
Comments
Post a Comment