Search code examples
iosobjective-cxcodecore-plot

How to make 2 CPTXYPlotSpace both respond to the same gesture on just one of the CPTXYPlotSpace?


I have 2 CPTXYPlotSpace which are the defaultPlotSpace of 2 CPTGraph, both set allowsUserInteraction to YES, and each of them can work well respectively. However, what I want to do is when the user scrolls/zooms in/zooms out one of the CPTXYPlotSpaces, the other can respond to that gesture as well,and the two CPTXYPlotSpace can scroll/zoom in/zoom out at the same time, even when I only touch one of the CPTXYPlotSpace. How can I do that? thanks in advance for any help!


Solution

  • Use a plot space delegate. Use the delegate methods to monitor changes to the plot space and make the corresponding changes to the other one.