Binding a series(s) to RadChart

2 posts, 0 answers
  1. Michael
    Michael avatar
    23 posts
    Member since:
    Mar 2014

    Posted 02 Apr 2014 Link to this post


    I have successfully bound a list of items to a RadListBox ItemSource, and bound to one column as a RadPropertyGrid. The other column, we want to appear as RadChart, somehow binding to a data series. The underlying model is in the form of List Pair of TimeSpan and Double. Possibly we directly bind to this, or at least Path-ing our way into the domain model, i.e. TotalSeconds, TotalMilliseconds, etc.


    Possibly I could start with programmatically doing it, but I'd like to go the XAML route and data bind if I could. Have worked with more than one chart in this manner before.

    Thank ye...

    Best regards,
  2. Petar Marchev
    Petar Marchev avatar
    996 posts

    Posted 07 Apr 2014 Link to this post

    Hello Michael,

    As long as the Pair is a class and not a struct it should be possible to use only XAML. However, I am unsure how you need to chart the data. I am unsure about the TimeSpan part. You can use two linear axes and a scatter series (ScatterLineSeries or else). You can then set the XValueBinding of the series to the TotalHours of the time span and the YValueBinding to the double property. But the chart will display the total hours in the X-axis labels and I am not sure what this will mean to your users. However, you can give it a try. If you need further assistance I will ask that you provide us with a snapshot (drawing of some sort) that depicts the output you are after.

    Petar Marchev

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top