Book Image

Intel Galileo Networking Cookbook

By : Marco Schwartz
Book Image

Intel Galileo Networking Cookbook

By: Marco Schwartz

Overview of this book

Table of Contents (15 chapters)
Intel Galileo Networking Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Displaying measurements stored in a database


In the previous recipes, we saw how to measure data from the Galileo board remotely and how to store this data in a database. Now, we are going to see how to graphically display this data on your computer.

Getting ready

To display the data graphically, we are going to use a JavaScript library called highcharts, which will make the process much easier. You don't have to install anything, but you can have a look at the library at the following location:

http://www.highcharts.com/

How to do it...

We are now going to write the Node.js application that will display the content of the database graphically on a web page. The code will be composed of three parts—a file called app.js containing the Node.js code, a file called index.html that will contain the interface, and finally another JavaScript file that will query the database's measurements and display them graphically.

Here is the code for the app.js file:

// Libraries
var express = require('express...