huggie
huggie

Reputation: 18237

Core plot floating y axis

On iOS core plot, my data comes in real time and I want it to scroll to the left while the data is ticking in. I also would want user to be able to pan horizontally while always seeing the y-axis visible on the left. From some googling it seems like there used to be isFloatingAxis property on CPTAxis but that's no longer there. What should I do? I don't think setting constraint is what I need because I do want free horizontal scrolling to see some data to the right and left.

Upvotes: 4

Views: 1113

Answers (1)

huggie
huggie

Reputation: 18237

OK I do see that constraint is just what I need. In CorePlotGallery under example directory there is a CurvedScatterPlot example which shows how to do it. I can get CPTXYAxis off the axisSet and set axisConstraints:

CPTXYAxis *y = axisSet.yAxis;
y.axisConstraints = [CPTConstraints constraintWithLowerOffset:0.0];

And it will work.

Upvotes: 12

Related Questions