aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/js
diff options
context:
space:
mode:
authorPim van den Berg2013-05-18 21:30:01 +0200
committerPim van den Berg2013-05-18 22:02:33 +0200
commit2d6672dad4e59cfaa55dce87a9b5c0656f7645fc (patch)
tree1815453b4ad7ac28c955771156bd2c476d73f1a7 /js
parentadd support for graphing I/O using the negative X-axis (diff)
downloadapt-panopticon_cgp-2d6672dad4e59cfaa55dce87a9b5c0656f7645fc.zip
apt-panopticon_cgp-2d6672dad4e59cfaa55dce87a9b5c0656f7645fc.tar.gz
apt-panopticon_cgp-2d6672dad4e59cfaa55dce87a9b5c0656f7645fc.tar.bz2
apt-panopticon_cgp-2d6672dad4e59cfaa55dce87a9b5c0656f7645fc.tar.xz
jsrrdgraph: RrdGraph.js: gprint: fix check for undefined format in case of vdef
The GPRINT of a VDEF doesn't have a CF. For example: > "GPRINT:avg:LAST:%5.1lf%s Last" > "GPRINT:tot:%5.1lf%s Total\l" The format will be passed via the cf variable, so format is not defined. But it didn't show up in the legend. Firebug showed variable format isn't undefined, but an empty string in case of VDEF. So just check for falsy.
Diffstat (limited to 'js')
-rw-r--r--js/RrdGraph.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/js/RrdGraph.js b/js/RrdGraph.js
index 6bd75c9..e43fa51 100644
--- a/js/RrdGraph.js
+++ b/js/RrdGraph.js
@@ -323,7 +323,7 @@ RrdGraphDesc.prototype.gprint = function (graph, vname, cf, format, strftimefmt)
323 this.vname = vname; 323 this.vname = vname;
324 this.vidx = graph.find_var(vname); 324 this.vidx = graph.find_var(vname);
325 this.legend = ''; 325 this.legend = '';
326 if (format === undefined) { 326 if (!format) {
327 this.format = cf; 327 this.format = cf;
328 switch (graph.gdes[this.vidx].gf) { 328 switch (graph.gdes[this.vidx].gf) {
329 case RrdGraphDesc.GF_DEF: 329 case RrdGraphDesc.GF_DEF: