luci-app-statistics: add options for graph series sorting and color
authorHannu Nyman <hannu.nyman@iki.fi>
Thu, 1 Aug 2019 15:15:16 +0000 (18:15 +0300)
committerHannu Nyman <hannu.nyman@iki.fi>
Thu, 1 Aug 2019 15:15:16 +0000 (18:15 +0300)
commit73212d42a5277f0a82ac4ac020c457c836d942f0
tree6d930c799181440aaaa6dddcc4e14987e54efa9b
parente3096f547bdab02e70ffbeb5d1546702225f21b9
luci-app-statistics: add options for graph series sorting and color

Add two data series-level options "negweight" and "posweight" that
will use the numerical value of the data instance name
as the sorting factor. This enables e.g. sorting by CPU frequency
in the cpufreq module.

Add new graph-level option "ordercolor" to use colorsfrom a
pre-defined color table for the data series. This enables keeping
similar colors for similar data series in different plugin instances.
E.g. CPU frequencies in several cores that are handled and displayed
separately.
 (note: the table has 8 items and if there are more series, it uses
  the same colors again. The table can be easily extended/modified)

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
(cherry picked from commit 4ca5727785ddeec33e26c6f8e5f5390ac2c75ed7)
applications/luci-app-statistics/luasrc/statistics/rrdtool.lua
applications/luci-app-statistics/luasrc/statistics/rrdtool/colors.lua