From 2d6672dad4e59cfaa55dce87a9b5c0656f7645fc Mon Sep 17 00:00:00 2001 From: Pim van den Berg Date: Sat, 18 May 2013 21:30:01 +0200 Subject: 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. --- js/RrdGraph.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js') 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) this.vname = vname; this.vidx = graph.find_var(vname); this.legend = ''; - if (format === undefined) { + if (!format) { this.format = cf; switch (graph.gdes[this.vidx].gf) { case RrdGraphDesc.GF_DEF: -- cgit v1.1