SChartAxis method axisFrame returns the frame for the entire graph


SChartAxis method axisFrame returns the frame for the entire graph and not just the axis. Steps to reproduce.

  1. fun the AppendData example from the 2.6 release of shinobi charts for ios

  2. set a breakpoint in the view controller line 55

  3. in lldb type po [self.chart.yAxis axisFrame]

4. hit run a few times, you’ll see the same result.  origin=(x=0, y=0) size=(width=728, height=954)

the y axis does not have a width of 728, it’s clearly much smaller.


Hi foobar,

Thanks for this! We hadn’t seen this before, but we’ve filed a bug about it, and will update this thread when its fixed.


It may just be a case that the API documentation here needs updating; the axis draws things like the grid lines and grid stripes across the entire chart, which would be within the bounds of axisFrame. The documentation just needs to mention these.


Thanks tkelly. Can you recommend a way to know when a user has touched the axis (not the entire grid and gridlines, but the visible axis) ? For my product, they’d like to be able to touch the axis on the left to select one series or the axis on the right to select the second series.


Hello TKelly,

just following up to see if there is a way to select an axis by touching it.


Hi foobar,

You will need to implement your own UITapGestureRecognizer, and attach it to the chart, then decide if the tap was on the left or right side.

The space given on either side of the chart is:

( + axis.titleLabel.width + + + largest label width)

If you have some features turned off (such as axis titles, or tickmarks), then you won’t need to add these values.

Hope that helps!