Using Bound data for X Axis tickpoint labels

2 posts, 0 answers
  1. Chet
    Chet avatar
    1 posts
    Member since:
    Sep 2011

    Posted 24 Feb 2012 Link to this post

    In all the examples I've seen for this, the labels for the X Axis tickpoints are applied in the the code behind file (usually in a loop statement).  I'd rather use a binding XAML but I'm having trouble getting the XAML syntax correct for my radchart control. 

    For instance, in a collection with two fields, statename, and population, I'd like the XAxis tickpoint labels to be the statenames.  In my mind it would be something like:
    <telerik:RadChart.DefaultView>                 
    <telerik:ChartDefaultView>                     
    <telerik:ChartDefaultView.ChartArea>                         
    <telerik:ChartArea>                             
    <telerik:AxisX>                                 
    <telerik:AxisX.TickPoints>                                     
    <telerik:TickPoint Label="{Binding statename}"></telerik:TickPoint>                                 
    </telerik:AxisX.TickPoints>                             
    </telerik:AxisX>                         
    </telerik:ChartArea>                     
    </telerik:ChartDefaultView.ChartArea>                 
    </telerik:ChartDefaultView>             
    </telerik:RadChart.DefaultView>


    But I always get this error: Set property 'Telerik.Windows.Controls.Charting.BaseFormattableData.Label' threw an exception. [Line: 63 Position: 62]

    Anybody able to see what I'm doing wrong?

    Thanks,
    ,,,,,,,,,,,,,,,,,,,,,,,Chet
  2. Bartholomeo Rocca
    Bartholomeo Rocca avatar
    247 posts
    Member since:
    May 2006

    Posted 27 Feb 2012 Link to this post

    Hello Chet,

    Check this help topic here to get you started with creating categorical charts -- basically you need to bind your business object StateName field to DataPointMember.XCategory when describing the series mapping.


    Greetings,
    Bart.
  3. DevCraft banner
Back to Top