I'd like to know how to prevent X-axis labels from randomly displaying as "..."
The ellipsis can be quite annoying in certain cases. The chart trims the labels and appends ellipsis to prevent label overlap.
We wrote a smart axis label panel feature a while back. It'll scale the font or rotate/stagger labels to prevent overlap instead of trimming.Have you tried using that? (xAxis.useSmartAxisLabelPanel = YES) Without the smart axis panel, I think your other option would be to change the date formatting for a shorter string or increase the axis interval for more space between the full, untrimmed labels.
Are you using a CategoryXAxis or a CategoryDateTimeXAxis in your project? I can write up a sample if that will help.
When I turn on smart axis label panel I get this whenever the chart fully loads without items and then adds the first item:
When the smart axis panel is turned on, after the chart first displays the axis panel, the height of the panel gets locked. The idea here is to prevent the axis panel's height from jumping around, which can happen while zooming/panning or if a longer label appears/disappears for whatever reason. If you're loading a chart with no data I can see this being a problem. You'll just get a very short label panel. For a case like this, try using unlockSmartAxisLabelPanel method off your X axis when you get some points in the chart. It will resize the panel based on the labels that are currently in it.
I don't see unlockSmartAxisLabelPanel in the header.
Should be in Axis.h
In IGAxisRight under convertToScreen and convertFromScreen methods
Ah, swift/obj-c snafu on my part. Obj-c methods don't autocomplete when using the dot operator.
This solution mostly works, but it still manages to be wrong for the first insert... I've littered my codebase with unlocks and I can't seem to get that first insert to size the labels correctly.
This is a frustrating side-affect, because from our clients POV, we certainly should have labels figured out after 2+ years of development.
How many labels are added in your first insert? I can try to replicate that
Likely just one at a time.
I think i found the issue where the label gets clipped when you only have one visible label. Before I start making any changes, though, I'd like to make sure that's the issue you're seeing with your project.
Take a look at the attached project. Once a point is added, the label is clipped. Once there are two labels, they get scaled down to fit the available axis label space.Let me know whether that's the problem you were reporting.