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 ...

Get HTML5 Data and Services Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.