ios - Core Plot graph bottom axis not visible -
i've got core-plot line graph displaying follows (background view coloured red clarity):
i have 0 padding @ bottom, , have x-axis configured, labels. graph squeezed right down against bottom of view though. if increase bottom padding grey bar @ bottom same result.
what need change in order move graph bottom of view , display axis?
the code quite lengthy, here's excerpts:
self->graph = [[cptxygraph alloc] initwithframe:hostview.bounds]; hostview.hostedgraph = graph; self->graph.paddingleft = 0.0f; self->graph.paddingtop = 10.0f; self->graph.paddingright = 0.0f; self->graph.paddingbottom = 0.0f; ... [plotspace scaletofitplots:[nsarray arraywithobjects:p1, p2, p3, nil]]; cptmutableplotrange *xrange = [plotspace.xrange mutablecopy]; [xrange expandrangebyfactor:cptdecimalfromcgfloat(1.1f)]; plotspace.xrange = xrange; cptmutableplotrange *yrange = [cptplotrange plotrangewithlocation:cptdecimalfromfloat(0.0f) length:cptdecimalfromfloat(500.0f)]; plotspace.yrange = yrange; ... cptxyaxisset *axisset = (cptxyaxisset *) self->graph.axisset; cptaxis *x = axisset.xaxis; x.axislinestyle = axislinestyle; x.labelingpolicy = cptaxislabelingpolicynone; x.majorticklinestyle = axislinestyle; x.majorticklength = 4.0f; x.tickdirection = cptsignnegative; ... x.axislabels = xlabels; x.majorticklocations = xlocations;
try adding bottom padding graph.plotareaframe
.
Comments
Post a Comment