This is a migrated thread and some comments may be shown as answers.
(Android) Horizontal axis label doesn't support new line
3 Answers 11 Views
This is a migrated thread and some comments may be shown as answers.
cameron
Top achievements
Rank 1
cameron asked on 21 May 2018, 06:48 AM

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?

3 Answers, 1 is accepted

Sort by
0
Didi
Telerik team
answered on 23 May 2018, 12:49 PM

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
0
cameron
Top achievements
Rank 1
answered on 24 May 2018, 12:49 AM

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

0
Didi
Telerik team
answered on 25 May 2018, 11:58 AM

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
Tags
Chart
Asked by
cameron
Top achievements
Rank 1
Answers by
Didi
Telerik team
cameron
Top achievements
Rank 1
Share this question
or