I have an xml file with following format,
When I create an xml datasource and assign it to chart datasource, it is not populating the chart based on the values in xml file. I was looking at Columns chart, where X coordinate is Year and Y-Coordinate is Interval.
Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4
<ReportPeriod>
<Period Duration="1 Year">
<Dur>
<Year> 2 </Year>
<Interval>60</Interval>
</Dur>
<Year> 3 </Year>
<Interval>30</Interval>
<Year> 4 </Year>
<Interval>20</Interval>
<Year> 5</Year>
<Interval>90</Interval>
</Period>
</ReportPeriod>
Any help would be appreciated.
Thanks
Nat
Thank you
the chart won't infer the schema from that xml file, so it doesn't know that the Interval column is numeric. this will work, though:
DataSet ds = new DataSet(); ds.Tables.Add("Dur"); ds.Tables["Dur"].Columns.Add("Year", typeof(string)); ds.Tables["Dur"].Columns.Add("Interval", typeof(double)); ds.ReadXml("..\\..\\xmlfile1.xml", XmlReadMode.IgnoreSchema); this.ultraChart1.Data.DataSource = ds.Tables["Dur"]; this.ultraChart1.Data.DataBind();