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

Bind xx axis labels to array data

1 Answer 32 Views
Chart
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jose
Top achievements
Rank 1
Jose asked on 06 Jun 2013, 05:08 PM
I have the following array that holds temperatures and their respective reading dates/times:

data[] values;

To access the temperature value at i position:

values[i].value;

To access the reading date/time at i position:

values[i].date;

I want to build a simple chart that displays this two values, the temperature and the date/time.
The temperature values will be displayed in the chart as a line, and the date/time values will be displayed in the bottom of the chart on the xx axis. So far I managed to populate the chart with the temperature values but I can't find a way to dinamically bind the xx labels to my date/time values.

Thank you for your attention.



1 Answer, 1 is accepted

Sort by
0
Victor
Telerik team
answered on 07 Jun 2013, 07:47 AM
Hello Jose,

All you have to do is to set your series.ItemsSource property to your array. Then you have to specify the ValueBinding and CategoryBinding properties of the series. ValueBinding should be "Value" and CategoryBinding should be "Date". Value and Date are with capital letters because they have to be properties. Data binding will not work with fields. Please have a look at this help article for more info.

Regards,
Victor
Telerik
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
Tags
Chart
Asked by
Jose
Top achievements
Rank 1
Answers by
Victor
Telerik team
Share this question
or