CHAPTER 8 ■ IOT PATTERNS: WEB APPS
Listing 8-4 provides the structure of the index.php file. The structure is standard
HTML, so in the
dependencies and initialize the chart. The tag will simply display the chart.
Listing 8-4. Code Structure for Analytics Dashboard in index.php
<?php
?>
// chart display
Listing 8-5 provides the complete code for index.php , so copy or write the code
in index.php. For developing the bar chart, you will be using Dojo, which is a very
popular JavaScript toolkit. You do not need to download or install any code. The toolkit is
accessible over the Internet so your script tag just needs to point to //ajax.googleapis.
com/ajax/libs/dojo/1.10.4/dojo/dojo.js as its source.
To populate the chart, you first need to load data from the database in an array
variable called chartData. In the