XAxis labels overlap in Charts 3.0
- Dominant language
- Swift
- Stars
- 28k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
In charts 2.x, the xAxis adjusted it's labelCount based on the width of the widest label. Here is an example from the 2.x demo:

However, in Charts 3, the labelWidth seems to be disregarded (computeAxis does not even consider it) when calculating the number of entries to show on the axis. Anything above 10 (about) characters has a chance to eventually get overlapped. Here's the same example, from Charts 3 demo:

This is a major regression for us from 2x. I've looked at the code and here is what I found:
XAxisRender.computeAxisValues calls super.computeAxisValues first, then calls computeSize. In my opinion, the result of computeSize should be an input to computeAxisValues and would need to be called first.
However modifying the AxisRendererBase.computeAxisValues to consider the labelWidth is beyond my comprehension level at this time.
Contributor guide
Assessment
This issue has not been assessed yet.