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