diff options
author | Manuel Luis SanmartĂn Rozada | 2015-04-04 00:47:16 +0200 |
---|---|---|
committer | Pim van den Berg | 2015-06-22 11:04:06 +0200 |
commit | 87ddc9f759c8786ed3589419aaf3711019bd6cbf (patch) | |
tree | 6d0962b46da437ebec88ef481da987ea13b7e938 | |
parent | jsrrdgraph: Fix tabs and spaces (diff) | |
download | apt-panopticon_cgp-87ddc9f759c8786ed3589419aaf3711019bd6cbf.zip apt-panopticon_cgp-87ddc9f759c8786ed3589419aaf3711019bd6cbf.tar.gz apt-panopticon_cgp-87ddc9f759c8786ed3589419aaf3711019bd6cbf.tar.bz2 apt-panopticon_cgp-87ddc9f759c8786ed3589419aaf3711019bd6cbf.tar.xz |
jsrrdgraph: Fix TICK
Diffstat (limited to '')
-rw-r--r-- | js/RrdCmdLine.js | 7 | ||||
-rw-r--r-- | 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 = { | |||
608 | color = this.graph.color2rgba(color); | 608 | color = this.graph.color2rgba(color); |
609 | } | 609 | } |
610 | 610 | ||
611 | var faction = undefined; | 611 | var fraction = undefined; |
612 | if (args.length == 3) | 612 | if (args.length >= 3 && args[2].legth > 0) |
613 | fraction = args[2]; | 613 | fraction = parseFloat(args[2]); |
614 | |||
615 | var legend = undefined; | 614 | var legend = undefined; |
616 | if (args.length == 4) | 615 | if (args.length == 4) |
617 | legend = args[3]; | 616 | 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) | |||
325 | this.col = color; | 325 | this.col = color; |
326 | if (fraction !== undefined) | 326 | if (fraction !== undefined) |
327 | this.yrule = fraction; | 327 | this.yrule = fraction; |
328 | else | ||
329 | this.yrule = 0.1; | ||
328 | if (legend === undefined) this.legend = ''; | 330 | if (legend === undefined) this.legend = ''; |
329 | else if (legend.length === 0) this.legend = ''; | 331 | else if (legend.length === 0) this.legend = ''; |
330 | else this.legend = ' '+legend; | 332 | else this.legend = ' '+legend; |