Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
40
XamWeb Pie Chart : Urgent
posted

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....

Parents
  • 780
    Suggested Answer
    posted

    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.

Reply Children