The Microsoft Chart Controls for .NET Framework allows you create simple, feature rich and attractive 2D and 3D charts for web (ASP.NET) and windows applications (WinForms). In this article, we will explore ASP.NET Chart Controls. The ASP.NET chart controls enables you to create visually compelling charts for web applications and supports almost all major 2D/3D chart series types. You can download the samples here to check them out.

The ASP.NET Chart control is a part of the .NET Framework 4.0 release. If you are using ASP.NET 4.0, the Chart control is included in the ToolBox and you can drag and drop the chart control from the Data Tab to use it.

If you are using .NET 3.5 SP1, the chart control has to be separately downloaded over here.

Let us get started:

Step 1: Create an ASP.NET 4.0 website and drag and drop a chart control and a Button control from the toolbox to the Default.aspx webpage. Set up the chart control to use Area3DStyle to implement 3D for all series in chart area, as shown below:

In the code shown above, we are using the DataSet.ReadXML to read the XML data into a DataSet. We then create a DataView using the DataTable (obtained from the DataSet) and then use ‘DataBindXY’ to bind the X and Y values of the collection to the specified column of the DataView, in our case ‘title’ on the X-Axis and ‘price’ on the Y-Axis.

Suprotim Agarwal, ASP.NET Architecture MVP, MCSD, MCAD, MCDBA, MCSE, is the CEO of A2Z Knowledge Visuals Pvt. He primarily works as an Architect Consultant and provides consultancy on how to design and develop .NET centric database solutions.