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
665
XamDoughnutChart not redrawing after data has changed
posted

Hello,

I've been having some difficulties with the doughnut chart recently (might be due to the recent 14.1 upgrade) but I have my a doughnut chart which I am binding to and my datasource is an oberservable collection within an observable collection. 

Like so:

public class DoughnutChartSource : NotificationObject
    {
        public string Name { getset; }
        public decimal Value { getset; }
        public string Label { getset; }
 
        private ObservableCollection<PieChartSource> _children;
 
        public ObservableCollection<PieChartSource> Children
        {
            get
            {
                return _children;
            }
            set
            {
                if (_children == value)
                    return;
 
                _children = value;
                base.OnPropertyChanged("Children");
            }
        }
 
        public DoughnutChartSource()
        {
            Children = new ObservableCollection<PieChartSource>();
        }
    }

In the constructor of my viewmodel it loads the initial data which works fine, drawing both the parent and the child rings.

But when I change the data only the parent is drawn and not the children.

I have created a treeview and bound the same data to it which works fine and draws the data as expected so its something wrong with the chart and not the data. 

Thanks, Grant
Parents Reply Children
No Data