Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
Node is saved as draft in My Content >> Draft
  • Charts in ASP.NET

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 299
    Comment on it

    For displaying data inside grid is very common but sometimes you need to display data in the chart for decision making and for management purpose.

    In that case what you need to do is to integrate the chart with your .NET application.

    Chart From an Array

    @{ 
    var myChart = new Chart(width: 600, height: 400) 
       .AddTitle("Employees") 
       .AddSeries(chartType: "column",
          xValue: new[] {  "Peter", "Andrew", "Julie", "Mary", "Dave" }, 
          yValues: new[] { "2", "6", "4", "5", "3" }) 
       .Write();
    }

     

    Chart From Database Data
     

    @{ 
    var db = Database.Open("SmallBakery"); 
    var dbdata = db.Query("SELECT Name, Price FROM Product"); 
    var myChart = new Chart(width: 600, height: 400) 
       .AddTitle("Product Sales") 
       .DataBindTable(dataSource: dbdata, xField: "Name")
       .Write();
    }

     

    .net

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: