PART_AxisLabels - I wish to restrict the displayed length

4 posts, 0 answers
  1. Daren May
    Daren May avatar
    4 posts
    Member since:
    Apr 2010

    Posted 21 Apr 2010 Link to this post

    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.
  2. Velin
    Admin
    Velin avatar
    391 posts

    Posted 26 Apr 2010 Link to this post

    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.
  3. Philip Ashworth
    Philip Ashworth avatar
    41 posts
    Member since:
    Dec 2009

    Posted 11 Jun 2010 Link to this post

    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.
  4. Velin
    Admin
    Velin avatar
    391 posts

    Posted 16 Jun 2010 Link to this post

    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.
Back to Top