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

Repositioned AdditionalYAxes have Incorrect Title Rotation

1 Answer 21 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Katherine
Top achievements
Rank 1
Katherine asked on 04 May 2011, 12:02 PM
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

1 Answer, 1 is accepted

Sort by
0
Evgenia
Telerik team
answered on 09 May 2011, 03:49 PM
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
Tags
Chart
Asked by
Katherine
Top achievements
Rank 1
Answers by
Evgenia
Telerik team
Share this question
or