From 2e28b180b6562f940a806a719cd4c650ede79659 Mon Sep 17 00:00:00 2001 From: Pim van den Berg Date: Sat, 5 Jul 2014 13:36:33 +0200 Subject: jsrrdgraph: RrdGraph.js: make HRULE support reference to variable The value of HRULE could be a reference to for example a VDEF variable. Closes #85 --- js/RrdGraph.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/RrdGraph.js b/js/RrdGraph.js index 9d35581..dfbbc07 100644 --- a/js/RrdGraph.js +++ b/js/RrdGraph.js @@ -379,7 +379,9 @@ RrdGraphDesc.prototype.vrule = function (graph, time, color, legend) RrdGraphDesc.prototype.hrule = function (graph, value, color, legend) { this.gf = RrdGraphDesc.GF_HRULE; - this.yrule = value; + this.vidx = graph.find_var(value); + if (this.vidx == -1) + this.yrule = value; this.col = color; if (legend === undefined) this.legend = ''; else this.legend = ' '+legend; -- cgit v1.1