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

DataPoint Label

1 Answer 68 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Ed
Top achievements
Rank 1
Ed asked on 15 Jun 2010, 01:52 AM
Hello-

Is it possible to set the axis labels to use some custom string instead of the default XValue and YValue properties of the DataPoint? 

I am constructing a list of DataPoint and binding that to the chart's ItemSource. I tried iterating through the TickPoint collection and setting the TickPoint.Label property, but the axis still shows the xvalues and yvalues. 

thanks, 
Edmund

1 Answer, 1 is accepted

Sort by
0
Ves
Telerik team
answered on 17 Jun 2010, 01:56 PM
Hello Ed,

For AxisX this is available out of the box. It is called "Categorical Chart", you can find more details in this help topic. This is also shown in this online example. Although it is focused on sorting and filtering, in this case you only need to pay attention on the XCategory mapping:

gdpSeriesMapping.ItemMappings.Add(new ItemMapping("Country", DataPointMember.XCategory));

For AxisY this is not available out of the box as the AxisY measures the data (the bar height, how high a line can go etc.) However you can wire the DataBound event of the chart and set AxisY.AutoRange to false. Then call AddRange(min, max, step) method to populate the axis as per your requirements and loop through the TickPoints collection and modify their labels. Note, that RadChart will put the default label if the value is empty string, so in order to show an empty tick label, set it to " " (with a single space).


Best regards,
Ves
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Chart
Asked by
Ed
Top achievements
Rank 1
Answers by
Ves
Telerik team
Share this question
or