PlotAreaAxisYStyle example

3 posts, 0 answers
  1. rachel
    rachel avatar
    2 posts
    Member since:
    May 2013

    Posted 13 Sep 2014 Link to this post

    Hi, I have a Silverlight RadChart displaying multiple horizontal stacked series.  The labels on the y axis are centred and I need them to be right-aligned.  I believe I need to set the DefaultView.ChartArea.PlotAreaAxisYStyle style, but I can't get this to work either in code or XAML.

    There seem to be no examples available anywhere that demonstrate the use of this style - could someone possibly supply one?


    Ben Jackson
  2. Sia
    Sia avatar
    667 posts

    Posted 17 Sep 2014 Link to this post

    Hello Ben,

    You can use the exposed ItemLabelStyle property as shown below:
                <telerik:ChartArea LegendName="Legend1">
                        <telerik:AxisX Title="Axis title">
                                <telerik:AxisStyles ItemLabelStyle="{StaticResource CustomLabelStyle}" />
                        <telerik:AxisY Title="Axis title"/>
                <telerik:ChartLegend x:Name="Legend1" />
                <telerik:ChartTitle Content="RadChart" />

    where the style should have TextBlock as target type:
    <Style x:Key="CustomLabelStyle" TargetType="TextBlock">
        <Setter Property="Foreground" Value="Orange" />
        <Setter Property="TextAlignment" Value="Right" />

    More information can be found in our help topic describing how to style the axis item label.

    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
  3. DevCraft R3 2016 release webinar banner
  4. rachel
    rachel avatar
    2 posts
    Member since:
    May 2013

    Posted 20 Jan 2015 in reply to Sia Link to this post

    Many thanks!
Back to Top