I an trying to draw a customized graph using asp.Net.
But i stuck at the end.
Here i am trying to assign a list of expando object as the data source for the chart.
It throws an exception of "System.ArgumentException: Series data points do not support values of type System.Dynamic.ExpandoObject only values of these types can be used: Double, Decimal, Single, int, long, uint, ulong, String, DateTime, short, ushort."
at the time of chart binding.
when i am using the predefined class it works well there.
but i need to use Expando Object for customization
Here i am trying to assign a list of expando object as the data source for the chart.
AFAIK, you will not be able to use list of ExpandoObjects to bind the chart. XAxis and YAxis values can only take primitive data types (such as String, Boolean, Int32, and so on). You need to bind the chart with valid datasource and save list of dynamic
objects in ViewState. Use Chart Databound event to access the list from viewstate again and apply customizations. You can use LINQ to query the dynamic list based on a key/value from ChartSeries.
None
0 Points
1 Post
ExpandoObject as DataSource for the ASP.Net Chart
Mar 22, 2014 01:13 AM|svas435|LINK
Hi guys ...
I an trying to draw a customized graph using asp.Net.
But i stuck at the end.
Here i am trying to assign a list of expando object as the data source for the chart.
It throws an exception of "System.ArgumentException: Series data points do not support values of type System.Dynamic.ExpandoObject only values of these types can be used: Double, Decimal, Single, int, long, uint, ulong, String, DateTime, short, ushort." at the time of chart binding.
when i am using the predefined class it works well there.
but i need to use Expando Object for customization
Do the need full to get out from there :)
c-sharp asp.net asp.netchart ExpandoObject
Contributor
5590 Points
1297 Posts
Re: ExpandoObject as DataSource for the ASP.Net Chart
Mar 22, 2014 03:31 AM|dotnetzoom|LINK
AFAIK, you will not be able to use list of ExpandoObjects to bind the chart. XAxis and YAxis values can only take primitive data types (such as String, Boolean, Int32, and so on). You need to bind the chart with valid datasource and save list of dynamic objects in ViewState. Use Chart Databound event to access the list from viewstate again and apply customizations. You can use LINQ to query the dynamic list based on a key/value from ChartSeries.
c-sharp asp.net asp.netchart ExpandoObject