Hi,
I'd like to know how to prevent X-axis labels from randomly displaying as "..."
http://www.gfycat.com/SlowOldfashionedDogfish
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:
https://dr.tt/view?d=rinzk5y4p0odt94%2F2016-05-06%20at%208.37%20AM.png
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.
That looks like the problem. Thanks! :)
I'm no longer able to reproduce the issue after I made a fix earlier. Can you try out this sample and let me know if labels get clipped after the insert?
I finally found the problem... IGCategoryDateTimeXAxis.
I've tried changing to a regular category X axis but then I get different behavior where labels disappear unless I zoom in.
My final implementation that works, looks something like this:
CGFloat zoomScale = fmaxf(0, self.chartView.zoomScale);
CGFloat interval = fmaxf(1, (count / numberOfLabels) / zoomScale);
We are still fighting this issue. Was there a new build we should be using for the fixes you mentioned?
I can try turning off the smart axis panel, but a similar issue happens when the chart fills up with points. Except, I see the "..." - even when zoomed in.
http://bit.ly/25f5GqF
Gif: http://giphy.com/gifs/l3E6DWKGxooe9vfRm
Classes involved,
IGChartView
IGLineSeries
IGCategoryXAxis
IGNumericYAxis
IGCategoryDatePoint, we use these to preserve the NSDate, which is used later for CSV output. We set the label property via NSDateFormatter.
xAxis looks like...
self.xAxis.useSmartAxisPanel = YES;
self.xAxis.smartAxisAngle = 45;
self.xAxis.smartAxisFontSize = 12;
Do you have a build I can test with?