O'Reilly logo

ActionScript Graphing Cookbook by Peter Backx, Dominic Gélineau

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Zooming and panning around a graph

Complicated graphs can sometimes offer too much data to fit on one screen. One option to make this manageable is to offer a zoom function, so users can zoom in on the data they would like to investigate closely.

When zoomed in, you also want to enable the user to move the graph so he can investigate different areas of the graph. This is called panning.

Getting ready

We will once again build on the code used in the previous chapters. If you skipped any of the recipes, you can download the code files and start from there.

To start from scratch, create a new workspace and copy the Graph and PointGraph classes from the previous chapters into your source folder (you can find them in the provided code files).

We'll start ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required