ASP.NET Web Pages The Chart Helper

WebGrid - One of many useful ASP.NET Web Helpers.

The Chart Helper

In the previous chapters, you learned how to use an ASP.NET "Helper".

You learned how to display data in a grid using the "WebGrid Helper".

This chapter explains how to display data in graphical form, using the "Chart Helper".

The "Chart Helper" can create chart images of different types with many formatting options and labels. It can create standard charts like area charts, bar charts, column charts, line charts, and pie charts, along with more specialized charts like stock charts.

chart chart

The data you display in a chart can be from an array, from a database, or from data in a file.

Chart From an Array

The example below shows the code needed to display a chart from an array of values:


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

Welookups is optimized for learning.Copy right 2018 - kumar aditya singh .
All Right Reserved and you agree to have read and accepted our term and condition.
All Rights Reserved.