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

Setting axis label block width

1 Answer 127 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Keith
Top achievements
Rank 1
Keith asked on 29 Apr 2011, 10:40 PM
Is it possible to set the width of the y axis label block in code (C#)? I have 4 charts stacked and I want all of the x values to line up, but the labels on the y axis are different, so the plot areas of the charts are different sizes.

THanks,
-Keith

1 Answer, 1 is accepted

Sort by
0
Accepted
Tsvetie
Telerik team
answered on 04 May 2011, 01:16 PM
Hi Keith,
You can use the following approach to specify the width of the Y-Axis labels:
<Window.Resources>
    <Style x:Key="CustomLabel" TargetType="TextBlock">
        <Setter Property="Width" Value="200" />
        <Setter Property="TextAlignment" Value="Right" />
    </Style>
</Window.Resources>
<Grid>
    <telerik:RadChart x:Name="RadChart1"></telerik:RadChart>
</Grid>

RadChart1.DefaultView.ChartArea.AxisY.AxisStyles.ItemLabelStyle = this.Resources["CustomLabel"] as Style;

Best wishes,
Tsvetie
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
Keith
Top achievements
Rank 1
Answers by
Tsvetie
Telerik team
Share this question
or