aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/js
diff options
context:
space:
mode:
authorManuel Luis SanmartĂ­n Rozada2014-07-25 18:12:13 +0200
committerPim van den Berg2014-07-25 20:35:50 +0200
commit0c9a7f2494dab9c9dc5d3bba1a73996c2b5a745c (patch)
tree5544a411c90348473311d3dc546924687b01ccf1 /js
parentjsrrdgraph: Fix textalign name typo. Thanks to Poil (diff)
downloadapt-panopticon_cgp-0c9a7f2494dab9c9dc5d3bba1a73996c2b5a745c.zip
apt-panopticon_cgp-0c9a7f2494dab9c9dc5d3bba1a73996c2b5a745c.tar.gz
apt-panopticon_cgp-0c9a7f2494dab9c9dc5d3bba1a73996c2b5a745c.tar.bz2
apt-panopticon_cgp-0c9a7f2494dab9c9dc5d3bba1a73996c2b5a745c.tar.xz
jsrrdgraph: Check when this.gdes[i].legend is null
Diffstat (limited to 'js')
-rw-r--r--js/RrdGraph.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/js/RrdGraph.js b/js/RrdGraph.js
index cba141d..642b9c5 100644
--- a/js/RrdGraph.js
+++ b/js/RrdGraph.js
@@ -1697,9 +1697,14 @@ RrdGraph.prototype.leg_place = function (calc_width)
1697 if (this.gdes[i].gf === RrdGraphDesc.GF_VRULE && (this.gdes[i].xrule < this.start || this.gdes[i].xrule > this.end)) 1697 if (this.gdes[i].gf === RrdGraphDesc.GF_VRULE && (this.gdes[i].xrule < this.start || this.gdes[i].xrule > this.end))
1698 this.gdes[i].legend = null; 1698 this.gdes[i].legend = null;
1699 } 1699 }
1700 this.gdes[i].legend = this.gdes[i].legend.replace(/\\t/gi, "\t") /* turn \\t into tab */
1701 1700
1702 leg_cc = this.gdes[i].legend.length; 1701 if (this.gdes[i].legend != null) {
1702 this.gdes[i].legend = this.gdes[i].legend.replace(/\\t/gi, "\t") /* turn \\t into tab */
1703 leg_cc = this.gdes[i].legend.length;
1704 } else {
1705 leg_cc = 0;
1706 }
1707
1703 /* is there a controle code at the end of the legend string ? */ 1708 /* is there a controle code at the end of the legend string ? */
1704 if (leg_cc >= 2 && this.gdes[i].legend.charAt(leg_cc - 2) === '\\') { 1709 if (leg_cc >= 2 && this.gdes[i].legend.charAt(leg_cc - 2) === '\\') {
1705 prt_fctn = this.gdes[i].legend.charAt(leg_cc - 1); 1710 prt_fctn = this.gdes[i].legend.charAt(leg_cc - 1);