(Android) Horizontal axis label doesn't support new line

4 posts, 0 answers
  1. cameron
    cameron avatar
    5 posts
    Member since:
    Apr 2018

    Posted 21 May 2018 Link to this post

    We have a cartesian chart with a horizontal categorical axis and want to display the label along this axis over multiple lines.

    It works fine for ios but doesn't work at all for android, it just displays it all on one line.

    How can we get this to work for android also?

  2. Didi
    Admin
    Didi avatar
    382 posts

    Posted 23 May 2018 Link to this post

    Hi Cameron,

    You can customize the labels orientation with the LabelFitMode property. LabelFitMode specifies how labels that exceed axis bounding rectangle should be positioned. These are the available fit options:

    MultiLine: Arranges axis labels on multiple lines with each label on a different line than its neighbor labels.
    Rotate: Arranges the axis labels so that they are rotated some degrees around their top left corner.

    Please take a look on the provided screenshot of the XAML file.
    I have also attached a screenshot from the application, which works fine with the LabelFitMode property. If the behavior is different at your end, please, provide me with more information about your setup. 

    Regards,
    Didi
    Progress Telerik
    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 Feedback Portal and vote to affect the priority of the items
  3. cameron
    cameron avatar
    5 posts
    Member since:
    Apr 2018

    Posted 23 May 2018 in reply to Didi Link to this post

    Hi, this does not give us the results we are after. We can't use MultiLine or Rotated label mode because it doesn't look good with our label data.

    Please see attached screenshots, this is with LabelFitMode set to None. As you can see ios works perfectly fine when using a label which contains newline character, but then compare it to android where the new line character is ignored.
    In fact you can see that the /n character is replaced with spaces in android.

    Why does ios support new line character but android doesn't? How can we make this work for android also?

    You can test this yourself easily by adding a label text to any string with /n character in it (eg: "27th\nFeb\n2018")

  4. Didi
    Admin
    Didi avatar
    382 posts

    Posted 25 May 2018 Link to this post

    Hi Cameron,

    Thank you for the provided screenshots.

    I have tested the described scenario and I could reproduce the problem with the new line axis label. It works on iOS platform but on Android a new line is not applied.
    I have logged this in our Feedback Portal, you could follow the item in the link below:
    https://feedback.telerik.com/Project/168/Feedback/Details/250381-chart-android-when-labelfitmode-is-set-to-none-new-line-is-not-applied

    You can also find your Telerik points updated for reporting this issue.

    At the moment there is no suitable workaround I could suggest, except choosing one of the other available LabelFitModes.

    Let me know if you have any other questions or concerns.

    Regards,
    Didi
    Progress Telerik
    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 Feedback Portal and vote to affect the priority of the items
Back to Top