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

Axis Title Style.

1 Answer 249 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Lee
Top achievements
Rank 1
Lee asked on 16 May 2014, 12:21 PM
Hi.

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??


1 Answer, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 19 May 2014, 11:52 AM
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" >
    <telerik:LinearAxis.TitleTemplate>
        <DataTemplate>
            <TextBlock Text="{Binding}" TextOptions.TextFormattingMode="Display">
                <TextBlock.LayoutTransform>
                    <RotateTransform Angle="90" />
                </TextBlock.LayoutTransform>
            </TextBlock>
        </DataTemplate>
    </telerik:LinearAxis.TitleTemplate>
</telerik:LinearAxis>
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;

Regards,
Martin
Telerik
 
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.
 
Tags
Chart
Asked by
Lee
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Share this question
or