Hi,
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";
Chart.Series.Add(series1);
Is there a way to make the chart populate with data when using ExpandoObject?