Commit 4d3f61d7 authored by Florian Eckert's avatar Florian Eckert Committed by Hannu Nyman
Browse files

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: default avatarFlorian Eckert <fe@dev.tdt.de>
parent 8b1294fc
...@@ -516,7 +516,8 @@ return baseclass.extend({ ...@@ -516,7 +516,8 @@ return baseclass.extend({
_args.push('GPRINT:%s_min:MIN:\tMin\\: %s'.format(source.sname, numfmt)); _args.push('GPRINT:%s_min:MIN:\tMin\\: %s'.format(source.sname, numfmt));
/* always include AVERAGE */ /* 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 */ /* don't include MAX if rrasingle is enabled */
if (!gopts.rrasingle) if (!gopts.rrasingle)
...@@ -605,6 +606,7 @@ return baseclass.extend({ ...@@ -605,6 +606,7 @@ return baseclass.extend({
overlay: dopts.overlay || false, overlay: dopts.overlay || false,
transform_rpn: dopts.transform_rpn || '0,+', transform_rpn: dopts.transform_rpn || '0,+',
noarea: dopts.noarea || false, noarea: dopts.noarea || false,
noavg: dopts.noavg || false,
title: dopts.title || null, title: dopts.title || null,
weight: dopts.weight || (dopts.negweight ? -+data_instances[j] : null) || (dopts.posweight ? +data_instances[j] : null) || null, weight: dopts.weight || (dopts.negweight ? -+data_instances[j] : null) || (dopts.posweight ? +data_instances[j] : null) || null,
ds: data_sources[k], ds: data_sources[k],
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment