Plotting graphs
No sensor application is complete without plotting graphs. We can do this directly from the web interface hosted on the sensor itself. We have already defined a web page for it: /History.md
. We first need to add the Waher.Script.Graphs
NuGet package to the project. It adds graph plotting functions to our scripting engine. It uses the cross-platform SkiaSharp
two-dimensional drawing package to do the actual drawing. We must just make sure to add the corresponding assemblies of Waher.Script
and Waher.Script.Graphs
to the types inventory when we initialize the application.
Note
For a list of script syntax supported, including some extension libraries, see http://waher.se/Script.md.
Reading historical values from the database
To plot historical values, we first need to read them from the database. We can use the Find<T>()
method on the static Database
class to find, filter, and sort objects in the database. It returns an enumerable set of objects of type T
(IEnumerable<T...