O'Reilly logo

HTML5 Data and Services Cookbook by Mite Mitreski, Gorgi Kosev

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 a chart

The charts we discussed in the preceding chapter of this book were static. As such, they're great for visualizing limited quantities of data. However, when the dataset grows too large, users might be needed to interactively choose the range of data shown in the chart.

To enable this, we're going to make a chart that is capable of interactive controls, such as zooming and panning. The Flot chart library easily supports this with its navigation plugin.

In this recipe, we're going to show a one week temperature history at 30 minute increments. We're going to allow the user to zoom and pan the history.

Getting ready

We'll need to download Flot from the official website http://www.flotcharts.org/ and extract the contents to ...

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