diff options
author | Florian Eckert <fe@dev.tdt.de> | 2020-08-18 12:50:46 +0200 |
---|---|---|
committer | Hannu Nyman <hannu.nyman@iki.fi> | 2020-09-08 07:57:35 +0300 |
commit | 4d3f61d7c7ad9af61749eeab5183562a21494dfc (patch) | |
tree | ffaf338d9791f6e721866f8c43a173ae8c150d29 /applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool.js | |
parent | 8b1294fc8d428b92d52b662f80f0339f2698bf4b (diff) |
luci-app-statistics: add noavg option
It is sometimes useful not to display avg values int the graph.
This option is used to prevent this from appearing in the graph.
In a graph definition this option must be set to *true*,
if the avg values should not be displayed.
```
options = {
gauge = {
title = "Status",
color = "0000ff",
noarea = true,
noavg = true
}
```
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
Diffstat (limited to 'applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool.js')
-rw-r--r-- | applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool.js b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool.js index 092dd45522..775db9bc3b 100644 --- a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool.js +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool.js @@ -516,7 +516,8 @@ return baseclass.extend({ _args.push('GPRINT:%s_min:MIN:\tMin\\: %s'.format(source.sname, numfmt)); /* always include AVERAGE */ - _args.push('GPRINT:%s_avg:AVERAGE:\tAvg\\: %s'.format(source.sname, numfmt)); + if (!source.noavg) + _args.push('GPRINT:%s_avg:AVERAGE:\tAvg\\: %s'.format(source.sname, numfmt)); /* don't include MAX if rrasingle is enabled */ if (!gopts.rrasingle) @@ -605,6 +606,7 @@ return baseclass.extend({ overlay: dopts.overlay || false, transform_rpn: dopts.transform_rpn || '0,+', noarea: dopts.noarea || false, + noavg: dopts.noavg || false, title: dopts.title || null, weight: dopts.weight || (dopts.negweight ? -+data_instances[j] : null) || (dopts.posweight ? +data_instances[j] : null) || null, ds: data_sources[k], |