Hello
I am trying to bind data dynamicaly to pie cart but it is throwing error, I am binding it through WCF service.
I am doing like this...
public Page() { InitializeComponent();
svc.GetPieChartCompleted += new EventHandler<InfragisticChart.Dash.GetPieChartCompletedEventArgs>(svc_GetPieChartCompleted); svc.GetPieChartAsync(); }
void svc_GetPieChartCompleted(object sender, InfragisticChart.Dash.GetPieChartCompletedEventArgs e) { // System.Collections.ObjectModel.ObservableCollection<Dash.PieChart> List = e.Result;
/* This line is creating problem */
PieChart.Series[0].DataSource = e.Result;
PieChart.Series[0].DataMapping = "Value=Value;Label=Name";
PieChart.Series[0].DataBind(); }
please help me out....
Hi, can you provide a little more information? What is the error you are receiving? What are the properties on the objects in the collection that you are binding too? Do they have both a "Value" and and "Name" property? Have you added a series to the PieChart in the XAML? If you're getting a NullReference exception, my guess is there are no Series in the chart yet, you'd need to add one first, either in the XAML or in C# before you set the datasource on it.
thanx for your help...
series was not propely added previously...
now I am adding it in codebehind..
but now in pie chart that labels on chart not visible what is the property to visible them....
thanx in advance.....