constricting scrolling in core-plot
Asked Answered
P

1

8

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!

Prawn answered 16/8, 2010 at 12:37 Comment(0)
C
11

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.

Consuetudinary answered 16/8, 2010 at 22:22 Comment(1)
eric, this sounds like exactly what I want. I will verify and let you know as I am away right now. Thanks in advance!Prawn

© 2022 - 2024 — McMap. All rights reserved.