O'Reilly logo

Mastering Internet of Things by Peter Waher

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

Generalizing the page

When we understand how the first plot works, it's easy to generalize the page and create similar plots for the other time bases we have: hours and days. First, we need to create analogous static methods in our code to read hourly and daily historical values from our persistence layer. We call these methods GetLastHours() and GetLastDays(). We then simply add the following sections to our Markdown page.

The DrawGraph script function defined earlier will draw the corresponding graphs:

Hours 
------------- 
 
{DrawGraph(SensorHttp.App.GetLastHours());} 
 
 
Days 
------------- 
 
{DrawGraph(SensorHttp.App.GetLastDays());} 

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