Repositioned AdditionalYAxes have Incorrect Title Rotation

2 posts, 0 answers
  1. Katherine
    Katherine avatar
    5 posts
    Member since:
    Aug 2012

    Posted 04 May 2011 Link to this post

    Hello,

    I've run into a strange issue that doesn't seem to be solvable with the currently exposed style settings on RadChart. I'm using the template for the ChartArea presented on http://www.telerik.com/community/forums/silverlight/chart/mutliple-y-axis-on-left-side-of-the-chart.aspx (as well as a couple other threads around this forum).

    By default, using that template, the YAxes defined in AdditionalYAxes do not have their ticks displayed on the right hand side (as the primary y axis does). The only way I have found to get the axis ticks to display on the right hand side of the additional axes is by setting FlowDirection="RightToLeft" on the AdditionalYAxesContainer control.

    This works great, but leads to an issue where the axis titles for the additional axes are inverted with respect to the axis title for the primary y axis. I'm wondering if there is any way around this.

    Thanks for your time,
    Loren Van Spronsen
  2. Evgenia
    Admin
    Evgenia avatar
    1437 posts

    Posted 09 May 2011 Link to this post

    Hi Loren,

    You can rotate the Titles for the Additional YAxes by retemplating the AxisTitle Style like this:
    <Style x:Key="CustomTitle" TargetType="telerikCharting:AxisTitle">
                <Setter Property="BorderStyle">
                    <Setter.Value
                        <Style TargetType="Border">
                            <Setter Property="Margin" Value="0,5,0,0" />
                            <Setter Property="CornerRadius" Value="2" />
                            <Setter Property="RenderTransformOrigin" Value="0.5,0.5" />
                            <Setter Property="RenderTransform">
                                <Setter.Value>
                                    <RotateTransform Angle="180" />
                                </Setter.Value>
                            </Setter>
                        </Style>
                    </Setter.Value>
                </Setter
            </Style>

    Set the Style in code-behind like this:

    foreach (var item in RadChart1.DefaultView.ChartArea.AdditionalYAxes)
              {
                  item.AxisStyles.TitleStyle = this.Resources["CustomTitle"] as Style;
              }

    Regards,
    Evgenia
    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