Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Core plot floating y axis

Tags:

ios

core-plot

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.

like image 491
huggie Avatar asked Dec 15 '22 17:12

huggie


1 Answers

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.

like image 103
huggie Avatar answered Jan 01 '23 06:01

huggie