applications/luci-statistics: move all models to the per-plugin level, provide titles...
[project/luci.git] / applications / luci-statistics / luasrc / statistics / rrdtool / definitions / wireless.lua
1 --[[
2
3 Luci statistics - wireless plugin diagram definition
4 (c) 2008 Freifunk Leipzig / Jo-Philipp Wich <xm@leipzig.freifunk.net>
5
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
9
10         http://www.apache.org/licenses/LICENSE-2.0
11
12 $Id$
13
14 ]]--
15
16 module("luci.statistics.rrdtool.definitions.wireless", package.seeall)
17
18 function rrdargs( graph, host, plugin, plugin_instance )
19
20         --
21         -- signal/noise diagram
22         --
23         local snr = {
24
25                 -- draw this diagram for each data instance
26                 per_instance = true,
27
28                 -- diagram data description
29                 title = "%H: Signal to Noise Ratio on %pi",
30                 vlabel = "dBm",
31                 data = {
32                         types = { "signal_noise", "signal_power" },
33
34                         -- special options for single data lines
35                         options = {
36                                 signal_power = {
37                                         overlay = true,         -- don't summarize
38                                         color   = "0000ff",     -- power is blue
39                                         title = "Signal",
40                                 },
41
42                                 signal_noise = {
43                                         overlay = true,         -- don't summarize
44                                         color   = "ff0000",     -- noise is red
45                                         title = "Noise",
46                                 }
47                         }
48                 }
49         }
50
51
52         --
53         -- signal quality diagram
54         --
55         local quality = {
56
57                 -- draw this diagram for each data instance
58                 per_instance = true,
59                 title = "%H: Signal Quality on %pi",
60                 vlabel = "n",
61
62                 -- diagram data description
63                 data = {
64                         types = { "signal_quality" },
65
66                         -- special options for single data lines
67                         options = {
68                                 signal_quality = {
69                                         noarea = true,          -- don't draw area
70                                         color  = "0000ff",      -- quality is blue
71                                         title = "Signal Quality"
72                                 }
73                         }
74                 }
75         }
76
77         return { snr, quality }
78 end