Axis Title Style.

2 posts, 0 answers
  1. Lee
    Lee avatar
    30 posts
    Member since:
    Apr 2014

    Posted 16 May 2014 Link to this post


    My ' MultiVerticalAxis' is setted <Setter Property="Stroke" Value="{Binding Converter={StaticResource seriesColorConverter}}"/>.

    In converter, 

    axis.Title = obj.Unit;
    axis.Maximum += 0.5;
    axis.Minimum += -0.5;
    axis.LineStroke = new SolidColorBrush(Colors.White);
    axis.Foreground = new SolidColorBrush(Colors.White);
    axis.FontSize = 11;

    In this picture, I want to rotate 'Title Font'

    What should I do??

  2. Martin
    Martin avatar
    1042 posts

    Posted 19 May 2014 Link to this post

    Hi Lee,

    In order to rotate the Title of your axis you can define a DataTemplate with a native TextBlock element and set it as a value of the TitleTemplate property of the axis.  Then apply RotateTransform on the TextBlock. Here is an example in code:
    <telerik:LinearAxis Title="Axis" >
                <TextBlock Text="{Binding}" TextOptions.TextFormattingMode="Display">
                        <RotateTransform Angle="90" />
    To set the template in code behind you can define it in your application resources and get it in code behind by its x:Key property.
    axis.TitleTemplate = this.Resources["myTitleTemplate"] as DataTemplate;

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