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

Using Bound data for X Axis tickpoint labels

1 Answer 73 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Chet
Top achievements
Rank 1
Chet asked on 24 Feb 2012, 07:07 PM
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

1 Answer, 1 is accepted

Sort by
0
Bartholomeo Rocca
Top achievements
Rank 1
answered on 27 Feb 2012, 02:49 PM
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.
Tags
ChartView
Asked by
Chet
Top achievements
Rank 1
Answers by
Bartholomeo Rocca
Top achievements
Rank 1
Share this question
or