Thank you for the clarification, bu unfortunately RadHtmlChart cannot work with Eval expressions
. In order to bind the control to a database you have to use a data source control (e.g., SqlDataSource, ObjectDataSource, LinqSqlDataSource, EntityDataSource) in the way shown in this live demo
. You can control the data source and the columns of it which will be used for the HtmlChart with the following properties:
- DataSourceID in the main tag sets the declarative data source for the entire chart. The DataSource property can be used for a programmatic data source if you create the connection in the code-behind
- DataFieldY for the series to point it to the desired column of the data table
- DataLabelsField for the x-axis labels to populate the items for the axis
If you are using the chart into a template of a databinding control, you can access the HtmlChart in its parent OnItemBound event and configure its values in it.
I hope this information will be helpful for you.
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed