Bind xx axis labels to array data

2 posts, 0 answers
  1. Jose
    Jose avatar
    1 posts
    Member since:
    Jun 2013

    Posted 06 Jun 2013 Link to this post

    I have the following array that holds temperatures and their respective reading dates/times:

    data[] values;

    To access the temperature value at i position:


    To access the reading date/time at i position:


    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.

  2. Victor
    Victor avatar
    1349 posts

    Posted 07 Jun 2013 Link to this post

    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.

    Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
  3. DevCraft banner
Back to Top