Data Binding RadChart to a Generic List of Objects
You can bind to a generic lists of objects that have multiple properties. The example below binds to a list of "Product" objects that contain two properties, one property for "Name" and a second for "QuantityInStock". The Y axis binds to the QuantityInStock and the X axis label binds to the "Name" property.
The Product object is defined with a constructor that passes both Name and QuantityInStock:
After the Product object is defined the following steps configure and bind to the generic List:
A generic List of Product objects is created and assigned to the RadChart DataSource property.
The DataYColumn property of the series is assigned the numeric "QuantityInStock" property of the Product object.
The XAxisDataLabelsColumn is assigned the "Name" property of the the Product object.
The RadChart DataBind() method is called.