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

X Axis - Text Wrap?

3 Answers 57 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Randy Minder
Top achievements
Rank 1
Randy Minder asked on 06 Jan 2012, 03:08 PM
I have a Bar series and the X axis contains the description of each bar. Some of the text is a bit long and runs into the text of the bar next to it. Does RadChart (2011 Q3) support text wrapping on the X axis? I don't see a property for it.

Thanks very much.

3 Answers, 1 is accepted

Sort by
0
Sia
Telerik team
answered on 06 Jan 2012, 05:17 PM
Hello Randy,

Currently this can be achieved by setting custom ItemLabelStyle as follows:

<telerikCharting:ChartArea.AxisX>
    <telerikCharting:AxisX MajorGridLinesVisibility="Visible" StripLinesVisibility="Visible">
        <telerikCharting:AxisX.AxisStyles>
            <telerikCharting:AxisStyles ItemLabelStyle="{StaticResource CustomLabel}" />
        </telerikCharting:AxisX.AxisStyles>
    </telerikCharting:AxisX>
</telerikCharting:ChartArea.AxisX>

where:
<Style x:Key="CustomLabel" TargetType="TextBlock">
    <Setter Property="Width" Value="50" />
    <Setter Property="TextWrapping" Value="Wrap" />
</Style>

Kind regards,
Sia
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Randy Minder
Top achievements
Rank 1
answered on 06 Jan 2012, 06:00 PM
Sia,

Thank you very much. Another question - where can I go and learn about all these properties? For example, how would I know that AxisStyles is even a property  that allows me to set the ItemLabelStyle?

Thanks again.
0
Sia
Telerik team
answered on 10 Jan 2012, 09:36 AM
Hello Randy,

All discussed properties are explained in our help. For example the mentioned AxisStyles property of the Axis can be found here. Nevertheless if you have difficulties in finding something specific please do not hesitate to contact us again.

All the best,
Sia
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
Chart
Asked by
Randy Minder
Top achievements
Rank 1
Answers by
Sia
Telerik team
Randy Minder
Top achievements
Rank 1
Share this question
or