Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

constricting scrolling in core-plot

I would like to have my user scroll inside a CPXYGraph. I have a CPXYGraph as part of a CPHostingLayer, like in the tutorials. I enabled allowsUserInteraction, which is cool and allows scrolling. But I don't want to allow my user to scroll to 'infinity', which it seems like it allows-you can keep dragging further and further away from where the data is on a plot.

How do I constrain this so that the user can only scroll within a certain bounds?

I also enabled masksToBorder, and set the outerBorderPath and innerBorderPath to something arbitarily small, but I saw no changes, so I am not sure how those are supposed to work.

I could not set maskingPath and subLayerMaskingPath because they seem to be read only(no setters), though i feel like these two properties might be what I am looking for.

Anyone has run into this situation? Would be glad if someone could shed some light. Thanks!

like image 659
Ying Avatar asked Aug 16 '10 12:08

Ying


1 Answers

The masking properties only affect the drawing. You need to use the globalXRange and globalYRange properties of your plot space. These define the maximum range that can be scrolled into view. See the example in CPTestApp.

like image 91
Eric Skroch Avatar answered Oct 11 '22 13:10

Eric Skroch