Back to Devexpress

How to: Bind a Chart to an XML Data Source

windowsforms-6072-controls-and-libraries-chart-control-examples-creating-charts-providing-data-how-to-bind-a-chart-to-an-xml-data-source.md

latest868 B
Original Source

How to: Bind a Chart to an XML Data Source

  • Oct 02, 2023
  • 2 minutes to read

This tutorial demonstrates how a chart can be bound to an XML data source. In this example, we’ll bind a chart to the Departments.xml file, shipped with the XtraCharts suite and located in the directory, where you installed DevExpress demos.

To bind a chart to an XML data source, do the following.

  1. Start Microsoft Visual Studio, and create a new Windows Forms Application , or open an existing one.
  2. Add a chart to the form.
  3. Add Bar series to the chart.
  4. Handle the Form1_Load event using the following code.

The result is shown in the following image.