How to bind XML data to the bar chart in windows phone application
Hi, I want to bind web service returned XML data to bar chart,
for this I wrote the following code but it shows the empty.
can anybody help me in this.
my code:
C#:
XElement xmlNews = XElement.Parse(e.Result.ToString());
ColumnSeries series = new ColumnSeries();
series.SetBinding(ColumnSeries.ItemsSourceProperty, new Binding());
series.ItemsSource = from item in xmlNews.Descendants("SyllabusDetails")
select new Institute
{
Adress = item.Element("SubjectName").Value,
year = item.Element("ResultedMarks").Value
};
XAML:
<charting:Chart Foreground="Blue" x:Name="seriesChart" Background="Black">
<charting:ColumnSeries Foreground="Pink" IndependentValuePath="year" DependentValuePath="Adress" Background="Black" />
</charting:Chart>