$99 VS $1000+. UI Control for ASP.NET AJAX(contains chart and gridview).
Data Binding Chart to an XML in ASP.NET
Home > How to > Chart Binding XML Data
Do you have the need to display data from XML in a chart in ASP.NET web application? Are you looking for the sample examples on how a chart can be bound to an XML file or an XML data source? If you have one yes for either of above two questions, you may have strong interest in following tutorial which puts its focus on how to bind chart to XML programmatically in ASP.NET web platform. Before following guide, you can view the free online demo of chart data binding with xml.

Binding from XML Data Source

In this part, we offer a step to step tutorial with guide pictures to help you bind chart to XML data source at design time in ASP.NET web application. Before starting the chart data binding application, please make sure that your ASP.NET web application has installed NET Framework 3.5 or above versions and that you have installed all the necessary dlls from our ASP.NET AJAX SDK into your ASP.NET web application.
  1. Click the KaxChart Smart Tag "Choose Data Source" | "<New Data Source>>".
    bind xml data source data to chart step1 in asp.net ajax
  2. From the "Choose a data source type" page of the wizard select "XML File" and click "OK".
    bind xml data source data to chart step2 in asp.net ajax
  3. Using the Browse button locate and select the XML file. Click OK.
    bind xml data source data to chart step3 in asp.net ajax
  4. Bind chart to that XML data source using DataBind() method. After call this api, the data items from xml source will insert dynamically to the web chart control.
    C# sample code:

this.KaxChart1.DataSourceID = "XmlDataSource1";
this.KaxChart1.DataBind();
Here we attach an image to demonstrate the result of above ASP.NET application of binding from XML data source.
set xml data source data bind to chart in asp.net ajax using c#

Binding from an XML File

The KaxChart control can not only allow users to bind chart to XML data source but also own the ability to bind chart to XML file directly at runtime. And you can finish the chart data binding with XML file within simple steps.
To help you have a better understanding of the result of chart data bind with XML file, here we specifically show some content from target XML file.
ChartData2.XML
<?xml version="1.0" encoding="utf-8" ?>
<books>
<book Season="Spring" Java="2000" CSharp="1800" VB="1500"/>
<book Season="Summer" Java="2500" CSharp="2200" VB="1800"/>
<book Season="Autumn" Java="3000" CSharp="3200" VB="2000"/>
<book Season="Winter" Java="4000" CSharp="3800" VB="2800"/>
</books>
After adding following C# code, you can successfully bind chart to target XML file. In the process of chart data binding with XML file, two important lines of code are the assignment of the data source and the calling of DataBind() method.
C# example code:

KaxChart1.DataSource = Server.MapPath("ChartData2.xml");
KaxChart1.DataBind();
Similarly, we here attach a screen shot image to help you have a better understanding of the result of above ASP.NET chart data binding with XML file application. In the chart graphs, there are three grouped bars correspond to the data series in the xml file. Our asp.net chart control can add and show multiple data group source, and each bar in each group stands for a data item in the data series.
set xml file data bind to chart in asp.net ajax using c#

Besides the bar chart shown in this tutorial for example, Kettic web chart component provide some other commonly used chart types: line chart, point chart, gantt chart, bubble chart and pie chart.

Other Recommended Data Binding Applications

ASP.NET AJAX UI Controls