X Axis - Text Wrap?

4 posts, 0 answers
  1. Randy Minder
    Randy Minder avatar
    20 posts
    Member since:
    Aug 2009

    Posted 06 Jan 2012 Link to this post

    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.
  2. Sia
    Admin
    Sia avatar
    667 posts

    Posted 06 Jan 2012 Link to this post

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

  3. UI for WPF is Visual Studio 2017 Ready
  4. Randy Minder
    Randy Minder avatar
    20 posts
    Member since:
    Aug 2009

    Posted 06 Jan 2012 Link to this post

    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.
  5. Sia
    Admin
    Sia avatar
    667 posts

    Posted 10 Jan 2012 Link to this post

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

Back to Top