O'Reilly logo

Qt 5 Projects by Marco Piccolino

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

Adding an HTML5 time series

We should now decide upon a charting library based on HTML5 and JavaScript to use. Although there are many options available, Chart.js (http://www.chartjs.org/) is ideal because of its permissive MIT license and relatively simple APIs. Starting from the QML graph example of Chapter 8Building a Mobile Dashboard to Display Real-Time Sensor Data, we will re-implement it with Chart.js. I won't go into the details of the re-implementation since this is out of scope for this title — you can check out the Chart.js documentation and samples to get the specifics. Besides Chart.js, we'll be using Moment.js, which fully integrates with the charting library for the easy handling of dates and times. The following is the code ...

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