Closed GoogleCodeExporter closed 8 years ago
Do you have a plot space delegate? After this change,
-plotSpace:willChangePlotRangeTo:forCoordinate: will be called every time the
xRange or yRange is updated.
Original comment by eskr...@mac.com
on 15 Sep 2013 at 3:47
Yes, I am using
-(CPTPlotRange *)plotSpace:(CPTPlotSpace *)space
willChangePlotRangeTo:(CPTPlotRange *)newRange
forCoordinate:(CPTCoordinate)coordinate
{
if (coordinate == CPTCoordinateY)
{
newRange = ((CPTXYPlotSpace*)space).yRange;
}
return newRange;
}
to prevent the user from zooming in the Y direction. If I remove that, my plot
looks fine again, but the zoom restriction also has gone.
Original comment by koenvand...@gmail.com
on 15 Sep 2013 at 11:52
-plotSpace:willChangePlotRangeTo:forCoordinate: will be called every time the
xRange or yRange is updated. Either set the delegate after setting up the
initial ranges or modify the delegate to always return the desired range.
Perhaps store it in an instance variable.
Original comment by eskr...@mac.com
on 15 Sep 2013 at 1:42
I've changed my code in -plotSpace:willChangePlotRangeTo:forCoordinate: and all
works well now. So did this happen because of the recent changes in the
plotSpace delegate code?
Original comment by koenvand...@gmail.com
on 15 Sep 2013 at 1:46
Yes. The delegate is now called from the xRange and yRange setters instead of
only when dragging in response to user action. This lets the delegate get a
chance to evaluate every change, as implied by the "willChange" method name.
Original comment by eskr...@mac.com
on 15 Sep 2013 at 4:05
Original issue reported on code.google.com by
koenvand...@gmail.com
on 14 Sep 2013 at 8:10