Tuesday, December 6, 2016

Medusa Sparkline Skin


While working on the gauges for our customer I figured out that with the given feature set in Medusa it would also be possible to create a skin that is similar to so called Sparklines.
The idea is to store a given number of values in an internal list and just show them in a little line graph, e.g. the last 10 measured values.
In addition the moving average of the visualized data will be shown and the standard deviation of the data.
It just tooks me a couple of hours last Monday night to get it done and I hope it will be somehow useful.
Here is a little screenshot of the new skin...

It has the following features

  • Title
  • Current Value
  • Unit
  • min value (of shown data)
  • max value (of shown data)
  • moving average (of shown data)
  • standard deviation (of shown data)

The term "shown data" means that for example the minimum value is not the absolut ever measured minimum but only the minimum of the visible data in the line graph.
If you need the absolut measured minimum you can ask the gauge for the getMinMeasuredValue() and/or getMaxMeasuredValue(). 
The number of datapoints that will show up in the line graph can be configured by calling the setAveragingPeriod(Integer) method (the default is 10).
The color of the line can be set by using setBarColor(Color).

This skin is part of the current Medusa release which is already 6.5 and you can find it here

That's it for keep coding :)

1 comment: