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 a separate folder flot
.
How to do it...
To create this recipe, we will add Flot, jQuery, and create an HTML file.
First, we create a basic HTML page with a placeholder for our chart. We're also going to include jQuery (needed by Flot), Flot itself, and...