Remove space for ticklabels


#1

Hi,

i have a chart which is only 70x320px in size. Since the user now, which values are shown here and the shown range is known, there is now need for tickmarks, labels, axis-labels etc.

I want that the axis are attached to the outer frame, so that there is no space wasted. How can i achieve this? I already looked into the Theme and into the AxisStyle, but i couldn’t fine anything to remove the space.

Regards,

Daniel


#2

Hi Daniel,

You we’re looking in the correct place, but the width is controleld by the axis object itself. Whilst the axis width can’t be less than it’s line width - the following code should hide the axis elements:

chart.xAxis.style.majorTickStyle.showLabels = NO;
chart.xAxis.style.majorTickStyle.showTicks = NO;
chart.xAxis.style.lineWidth = @0.5f;
chart.xAxis.width = @1.f;

Setting the line color to clear will also give the effect of completely removing the axis from view:

chart.xAxis.style.lineColor = [UIColor clearColor];

#3

Perfect. Works like a charm.