This is a migrated thread and some comments may be shown as answers.

Dynamically get the data and show the ranks according to the data

5 Answers 52 Views
Chart (HTML5)
This is a migrated thread and some comments may be shown as answers.
Mani
Top achievements
Rank 1
Mani asked on 03 Dec 2013, 10:53 AM
Hello,


How i got the data from database and now how do i show the data in the html chart 
http://demos.telerik.com/aspnet-ajax/htmlchart/examples/databinding/loadingdata/defaultcs.aspx ), not by using xml data source.. 
i am actually showing the rank of the person  <%= Locality %> now i need to embed all the data in the chart..
How do i do that?

attachment is my previous code.. 

Thanks.

5 Answers, 1 is accepted

Sort by
0
Mani
Top achievements
Rank 1
answered on 03 Dec 2013, 11:09 AM
Hello,


I got the data from database and now how do i show the data in the html chart 
http://demos.telerik.com/aspnet-ajax/htmlchart/examples/databinding/loadingdata/defaultcs.aspx ), not by using xml data source.. 
i am actually showing the rank of the person  <%= Locality %> now i need to call the value to the chart..
How do i do that?

attachment is my previous code.. 

Thanks.

0
Vessy
Telerik team
answered on 09 Dec 2013, 12:47 PM
Hi Mani,

I am not quite sure whether I understand the scenario correctly. Could you, please, provide ?
  • If you want to bind the HTMLChart to a database assigning to it specific values from the data tables, you can see how this could be done here: SqlDataSource
  • If you want to create the HTMLChart dynamically, accessing values from the code behind, you can refer the following live demo: Programmatic Chart Creation

If non of the above is the case, could you, please, provide more detailed information on what exactly do you want to achieve?

Regards,
Veselina Raykova
Telerik
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 now.
0
Mani
Top achievements
Rank 1
answered on 11 Dec 2013, 06:29 AM
yes, 
 I got the values from the database in a dataset..  i am showing the that retrieved values in a table using <%= value %>, now i need to show the values in the html chart so that i can get the graph of it. 
Let me know if i need to be more clear.
Thanks.
0
Vessy
Telerik team
answered on 13 Dec 2013, 03:43 PM
Hi Mani,

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.

Regards,
Veselina Raykova
Telerik
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 now.
0
Mani
Top achievements
Rank 1
answered on 16 Dec 2013, 04:38 AM
Thanks :) this will help me out. 
Tags
Chart (HTML5)
Asked by
Mani
Top achievements
Rank 1
Answers by
Mani
Top achievements
Rank 1
Vessy
Telerik team
Share this question
or