From 87ddc9f759c8786ed3589419aaf3711019bd6cbf Mon Sep 17 00:00:00 2001 From: Manuel Luis SanmartĂ­n Rozada Date: Sat, 4 Apr 2015 00:47:16 +0200 Subject: jsrrdgraph: Fix TICK --- js/RrdCmdLine.js | 7 +++---- js/RrdGraph.js | 2 ++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/js/RrdCmdLine.js b/js/RrdCmdLine.js index 10adc5e..077acfa 100644 --- a/js/RrdCmdLine.js +++ b/js/RrdCmdLine.js @@ -608,10 +608,9 @@ RrdCmdLine.prototype = { color = this.graph.color2rgba(color); } - var faction = undefined; - if (args.length == 3) - fraction = args[2]; - + var fraction = undefined; + if (args.length >= 3 && args[2].legth > 0) + fraction = parseFloat(args[2]); var legend = undefined; if (args.length == 4) legend = args[3]; diff --git a/js/RrdGraph.js b/js/RrdGraph.js index 1a9cc9f..d2dbdb4 100644 --- a/js/RrdGraph.js +++ b/js/RrdGraph.js @@ -325,6 +325,8 @@ RrdGraphDesc.prototype.tick = function (graph, vname, color, fraction, legend) this.col = color; if (fraction !== undefined) this.yrule = fraction; + else + this.yrule = 0.1; if (legend === undefined) this.legend = ''; else if (legend.length === 0) this.legend = ''; else this.legend = ' '+legend; -- cgit v1.1