summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--applications/luci-statistics/luasrc/statistics/rrdtool.lua12
-rw-r--r--applications/luci-statistics/luasrc/statistics/rrdtool/definitions/cpu.lua1
-rw-r--r--applications/luci-statistics/luasrc/statistics/rrdtool/definitions/load.lua2
-rw-r--r--applications/luci-statistics/luasrc/statistics/rrdtool/definitions/nut.lua2
4 files changed, 17 insertions, 0 deletions
diff --git a/applications/luci-statistics/luasrc/statistics/rrdtool.lua b/applications/luci-statistics/luasrc/statistics/rrdtool.lua
index e93ac0628a..dbcae9dc6b 100644
--- a/applications/luci-statistics/luasrc/statistics/rrdtool.lua
+++ b/applications/luci-statistics/luasrc/statistics/rrdtool.lua
@@ -457,6 +457,18 @@ function Graph._generic( self, opts, plugin, plugin_instance, dtype, index )
_ti( _args, self.i18n:title( plugin, plugin_instance, _sources[1].type, instance, opts.title ) )
_ti( _args, "-v" )
_ti( _args, self.i18n:label( plugin, plugin_instance, _sources[1].type, instance, opts.vlabel ) )
+ if opts.y_max then
+ _ti ( _args, "-u" )
+ _ti ( _args, opts.y_max )
+ end
+ if opts.y_min then
+ _ti ( _args, "-l" )
+ _ti ( _args, opts.y_min )
+ end
+ if opts.units_exponent then
+ _ti ( _args, "-X" )
+ _ti ( _args, opts.units_exponent )
+ end
-- store additional rrd options
if opts.rrdopts then
diff --git a/applications/luci-statistics/luasrc/statistics/rrdtool/definitions/cpu.lua b/applications/luci-statistics/luasrc/statistics/rrdtool/definitions/cpu.lua
index adc3f284b2..c0e86245c0 100644
--- a/applications/luci-statistics/luasrc/statistics/rrdtool/definitions/cpu.lua
+++ b/applications/luci-statistics/luasrc/statistics/rrdtool/definitions/cpu.lua
@@ -19,6 +19,7 @@ function rrdargs( graph, plugin, plugin_instance, dtype )
return {
title = "%H: Processor usage on core #%pi",
+ y_min = "0",
vlabel = "Percent",
number_format = "%5.1lf%%",
data = {
diff --git a/applications/luci-statistics/luasrc/statistics/rrdtool/definitions/load.lua b/applications/luci-statistics/luasrc/statistics/rrdtool/definitions/load.lua
index 8052696fb5..4cb4795ef6 100644
--- a/applications/luci-statistics/luasrc/statistics/rrdtool/definitions/load.lua
+++ b/applications/luci-statistics/luasrc/statistics/rrdtool/definitions/load.lua
@@ -19,6 +19,8 @@ function rrdargs( graph, plugin, plugin_instance, dtype )
return {
title = "%H: Load", vlabel = "Load",
+ y_min = "0",
+ units_exponent = "0",
number_format = "%5.2lf", data = {
sources = {
load = { "shortterm", "midterm", "longterm" }
diff --git a/applications/luci-statistics/luasrc/statistics/rrdtool/definitions/nut.lua b/applications/luci-statistics/luasrc/statistics/rrdtool/definitions/nut.lua
index 4072d4db14..69f1ae305c 100644
--- a/applications/luci-statistics/luasrc/statistics/rrdtool/definitions/nut.lua
+++ b/applications/luci-statistics/luasrc/statistics/rrdtool/definitions/nut.lua
@@ -53,6 +53,8 @@ function rrdargs( graph, plugin, plugin_instance, dtype )
local percentage = {
title = "%H: Battery charge on UPS \"%pi\"",
vlabel = "Percent",
+ y_min = "0",
+ y_max = "100",
number_format = "%5.1lf%%",
data = {
sources = {