I’ve done a little more work on the emoncms graph module, also known as the data viewer accessible from the feeds list page. The main additions are:
- Ability to save graphs and embed these in dashboards
- Settable plot colour and fill
- Watt hours in window for power feeds
- Settable yaxis min and max
- Improved responsive design
I’ve put together a short demo video here of these new additions:
With a bit more work it should be possible to replace the rawdata, bargraph, realtime and multigraph visualisations with graphs created using the graph module and I would like to add in the datapoint editor features into the same interface as well, providing one versatile interface for exploring, editing and exporting emoncms data.
Using the averaging API to get around the feed interval vs post interval issue affecting some feeds
Part of the instigation for the above update however was to provide a way of creating embeddable graphs that used the averaging API selectable using the data viewer. Im aware from several emoncms.org users of the issue where many of the visualisations are showing incomplete data for feeds that used to be recorded as PHPFiwa feeds on emoncms.org, now stored as PHPFina feeds. With the averaging mode enabled it averages across null values in the feed showing a better representation of the underlying data, much in the same way as PHPFiwa did before.
The problem where data appears missing in this way is due to the feed interval being at a more regular interval than the actual data posting interval. The data then saves to disk as a valid value followed by several null values followed by the next valid value. This presents a problem for the standard phpfina data request method that just pulls out a datapoint at regular intervals as the request may miss the valid datapoint and pull out a neighbouring null value instead. The averaging api averages across several datapoints and ignores null values and so if there is at least one valid value in each segment a non null value will be returned.