Private Sub Binding_to_an_XML_File_Load(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles MyBase.Load Me.UltraChart1.DataSource = "CandleData.xml" End Sub
One of the data sources that you can bind the Chart control is an XML file. To bind the Chart control to XML data, the XML must follow the schema requirements of an ADO.NET data set, and the XML must have the ability to be read using the DataSet.ReadXml method.
Copy the XML (see the XML data at the end of this topic) and paste it into an XML file.
Bind the Chart control to the XML file using the example code below.
In Visual Basic:
Private Sub Binding_to_an_XML_File_Load(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles MyBase.Load Me.UltraChart1.DataSource = "CandleData.xml" End Sub
In C#:
private void Binding_to_an_XML_File_Load(object sender, System.EventArgs e) { this.ultraChart1.DataSource = "CandleData.xml"; }
The xml file used in the code snippet above is available here.