HyperlinkButton for xAxis Labels

2 posts, 0 answers
  1. Tyler
    Tyler avatar
    32 posts
    Member since:
    Jun 2011

    Posted 27 Sep 2011 Link to this post

    How can I change my xAxis labels to HyperLinkButtons ?
  2. Sia
    Sia avatar
    756 posts

    Posted 30 Sep 2011 Link to this post

    Hi Tyler,

    You need to set custom AxisLabel2D style which can be applied implicitly to all labels on your axes. There add the HyperlinkButton:
    <telerik:LabelFormatConverter x:Key="labelFormatConverter" />
    <Style TargetType="telerik:AxisLabel2D">
        <Setter  Property="Foreground" Value="Red" />
        <Setter Property="HorizontalAlignment" Value="Stretch" />
        <Setter Property="VerticalAlignment" Value="Top" />
        <Setter Property="ItemLabelStyle">
                <Style TargetType="TextBlock">
                    <Setter Property="TextAlignment" Value="Center" />
                    <Setter Property="Padding" Value="1" />
        <Setter Property="Template">
                <ControlTemplate TargetType="telerik:AxisLabel2D">
                    <telerik:LayoutTransformControl x:Name="PART_LayoutTransformControl"
                                                    VerticalAlignment="{TemplateBinding VerticalAlignment}"
                                                    HorizontalAlignment="{TemplateBinding HorizontalAlignment}">
                                <TextBlock Style="{TemplateBinding ItemLabelStyle}"
                                        Text="{Binding Converter={StaticResource labelFormatConverter}}" />
                            <RotateTransform x:Name="PART_RotateTransform" />

    Best wishes,
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top