Set fixed width for labels on y-axis


#1

Hi there,

How can I set a fixed width for labels on a y-axis so that I can position a view accurately over it? The issue I’m facing is that depending on the number of digits in the numbers, the end of the graph / y-axis is dynamically positioned. I need to keep this UIView positioned so that it’s left edge corresponds to the pixel value where the axis is.


#2

Hi Carlin,
You can set the lenght of labels on axis using this Delegate method of Chart :
-(NSString *)sChart:(ShinobiChart *)chart longestLabelStringOnAxis:(SChartAxis *)axis
{
return@“put a string here, of length which are want to set for label”;
}

Hope, it will help you.


#3

Did this trick for you ?


#4

Yep! Works like a charm to stop this jumpy y-axis, thanks!