Ganesh Kumar Palani Ganesh Kumar Palani - 5 months ago 26
iOS Question

How do i show Grid lines vertically in Core plot graph?

I have used Core Plot and i need to get the grid lines vertically,


  • List item

    I have tried custom labels in x axis

    x.labelingPolicy = CPTAxisLabelingPolicyNone;



But I didn't get the grid lines vertically.Can anyone help me with this?

enter image description here

Answer
//Add plot space

    CPTXYPlotSpace *plotSpace       = (CPTXYPlotSpace *)graph.defaultPlotSpace;

    plotSpace.delegate              = self;

    plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromInt(0.0) length:CPTDecimalFromInt(25)];

then change x axis label policy like this

x.labelingPolicy = CPTAxisLabelingPolicyFixedInterval;