We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

SfChart support for ItemsSource of collection of ExpandoObject

Thread ID:





118309 Feb 24,2015 01:41 PM UTC Jun 9,2017 03:51 PM UTC Windows Phone 3
Tags: SfChart
Asked On February 24, 2015 01:41 PM UTC


I'm evaluating SfChart support for dynamic models as I don't have model definition at the design time.
For example, when I create ItemSource from ObservableCollection<ExpandoObject>, the chart does not display any data, it is just blank.
Here is the sample code I use:

                    dynamic item1 = new ExpandoObject();
                    item1.Amount = 10;
                    item1.Category = "Electronics";

                    dynamic item2 = new ExpandoObject();
                    item2.Amount = 20;
                    item2.Category = "Jewelry";
                    var chartData = new ObservableCollection<ExpandoObject>{item1, item2};

                    Chart.Header = "Test";
                    Chart.PrimaryAxis = new CategoryAxis() { Header = "Category" };
                    Chart.SecondaryAxis = new NumericalAxis() { Header = "Amount" };

                    ColumnSeries series1 = new ColumnSeries();
                    series1.ItemsSource = chartData;
                    series1.XBindingPath = "Category";
                    series1.YBindingPath = "Amount";


Is there a way to make the chart populate with data when using ExpandoObject?

Rachel A [Syncfusion]
Replied On February 25, 2015 12:13 PM UTC

Hi Aija,

Thank you contacting Syncfusion support.

Presently we are not having the ExpandoObject binding support. We have logged this as feature request and it will be implemented in any of our upcoming volume releases.

Please let us know if you require any further assistance.


Rachel. A

Arman Balin
Replied On June 8, 2017 01:38 PM UTC


Has binding to expandoObject been implemented already?


Durgadevi Selvaraj [Syncfusion]
Replied On June 9, 2017 03:51 PM UTC

 Hi Arman,

We don’t have ExpandoObject binding support in SfChart. You can achieve dynamic object support by using ICustomTypeDescriptor binding as shown in the below code,
public MainWindow() 
            Collection = new ObservableCollection<CustomData>();         
            var rnd = new Random();   
            for(int i =0;i<10;i++) 
                customData = new CustomData(); 
                customData.SetValue("Category", i); 
                customData.SetValue("Amount", rnd.Next(100, 1000)); 
                SplineSeries ss = new SplineSeries(); 
                ss.XBindingPath = "Category"; 
                ss.YBindingPath = "Amount"; 
                ss.Label = "itm"; 
                ss.EnableAnimation = true; 
                ss.ShowTooltip = true; 
                ss.ItemsSource = Collection; 

We have prepared the WPF sample based on this for your reference and please downloaded from the below link,

Sample: DynamicDescriptor_Sample



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon