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

PART_AxisLabels - I wish to restrict the displayed length

3 Answers 52 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Daren May
Top achievements
Rank 1
Daren May asked on 21 Apr 2010, 06:51 PM
What is the best approach to take to limit the length of the PART_AxisLabels? Ideally, I would like to attach a behavior to the TextBlock used to render the labels as I wish to add "..." to the end of the truncated strings and display a ToolTip on mouse over.

Thanks.

3 Answers, 1 is accepted

Sort by
0
Velin
Telerik team
answered on 26 Apr 2010, 12:42 PM
Hello Daren May,

You can use the AxisStyles.ItemLabelStyle property exposed by the axis object to set your custom style to the axis labels. Here is an example:
            <Style  x:Name="labelstyle" TargetType="TextBlock">
                <Setter Property="TextAlignment" Value="Center" />
                <Setter Property="Width" Value="10"/>
            </Style>
 
RadChart1.DefaultView.ChartArea.AxisY.AxisStyles.ItemLabelStyle = this.labelstyle;

Hope this will help.

Greetings,
Velin
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.
0
Philip Ashworth
Top achievements
Rank 1
answered on 11 Jun 2010, 09:50 AM
Hi,

I wanted to do the same thing for long axis labels and your solution worked perfectly. (Thanks)

But now I want to display the full label text in the tooltip of the axis label, how can this be done?

Thanks again Phil.
0
Velin
Telerik team
answered on 16 Jun 2010, 12:07 PM
Hi Philip Ashworth,

Unfortunately, this can not be achieved at present. The development team will consider the possible ways to implement this functionality with a future version of the control.

Regards,
Velin
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
Daren May
Top achievements
Rank 1
Answers by
Velin
Telerik team
Philip Ashworth
Top achievements
Rank 1
Share this question
or