Binding Single Objects to a RadCartesianChart's BarSeries

2 posts, 0 answers
  1. Bryan
    Bryan avatar
    28 posts
    Member since:
    Jul 2008

    Posted 18 Jan 2013 Link to this post

    Hey there, I'm creating a project where I want to display attributes of specific objects in a chart. For example, I have 2 different loan objects (Current Loan and Proposed Loan) and I want to display each one of those object's "Tax Savings" in a bar chart. I am trying to do something EXACTLY like this: 

    But I want the properties themselves to be properties on my objects. I've tried basic bindings and I can't seem to get it to work. The objects bind find throughout my app it's just not functioning here. The code I've got is:

                                <telerikChart:RadCartesianChart Width="500" >


                                            <telerik:CategoricalDataPoint  Value="{Binding Path=CurrentLoan.TaxSavings}"
                                                      Category="Proposed Loan"/>
                                            <telerik:CategoricalDataPoint  Value="{Binding Path=ProposedLoan.TaxSavings}"
                                                      Category="Current Loan"/>


    When It loads, it actually blanks out my entire "View" that the charts are supposed to be in. Any suggestions? Thank you
  2. Ves
    Ves avatar
    2927 posts

    Posted 23 Jan 2013 Link to this post

    Hi Bryan,

    CategoricalDataPoint.Value is not a dependency property, so this scenario is not expected to work. You can either populate the values in code or provide an enumerable as ItemsSource for the BarSeries as shown in this example, and let the chart create the bars for you.

    Kind regards,
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top