I have a similar question to one which was posted on the WPF forum. When using Step to de-clutter the Category Axis is there a way to always display the last label in jQuery?
1 Answer, 1 is accepted
0
Nikolay
Telerik team
answered on 02 Dec 2024, 11:00 AM
Hello JAMES,
You can use a template function for the categoryAxis labels instead of setting a step. This will allow you to render the last label for all classes. For example:
Hi Thanks for this solution, it worked and I can now ensure the last label always gets added.
The follow on issue with this is that when the last label is immediately next to the preceding stepped value they now overlap.
Is there a way to shift or add margin to only the last label?
Nikolay
Telerik team
commented on 14 Jan 2025, 09:01 AM
Hi James,
It's not possible to apply a margin on a specific label only. You will need, again, in the categoryAxis labels template, to come up with a logic for sipping the label before the ones one.
When I skip the last label using the suggested method, the previous label gets cut off if it extends beyond the chart, how can I prevent this? If there is a last label that extends beyond the chart without issue, see previous examples.
Nikolay
Telerik team
commented on 20 Jan 2025, 03:24 PM
Hi James,
I am not sure how you get the last category axis label cut off. Could you please modify the below Dojo to demonstrate it?