Creating a line chart

Line charts are the most basic type of charts. They display a series of data points connected together by lines. Line charts are often used to visualize time series data.

There are various libraries that implement this charting functionality, both paid and free. We're going to use the Flot chart library. It's free, simple, and easy to use and it has been in active development for the past 4 years. It also aims to produce aesthetically pleasing charts.

In this recipe, we're going to make a time series chart that displays the outside temperature history for the past 24 hours.

Getting ready

We'll need to download Flot from the official website at http://www.flotcharts.org/, and extract the contents to a separate folder named flot ...

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.