From a5a2ae15e4206164ea9676e966dfe9c85655bc3c Mon Sep 17 00:00:00 2001 From: Richard Wall Date: Fri, 12 Aug 2011 22:31:17 +0100 Subject: fix some broken assignments --- docs/examples/assets/js/jsrrdgraph.js | 45 ++++++++++++++++++++++++++--------- 1 file changed, 34 insertions(+), 11 deletions(-) diff --git a/docs/examples/assets/js/jsrrdgraph.js b/docs/examples/assets/js/jsrrdgraph.js index 7e99ea7..7911f32 100644 --- a/docs/examples/assets/js/jsrrdgraph.js +++ b/docs/examples/assets/js/jsrrdgraph.js @@ -2440,7 +2440,11 @@ RRDGraph.prototype = { if (!this.gdes[i].strftm && (percent_s = this.gdes[i].format.indexOf('%S')) != -1) { if (magfact < 0.0) { //[printval, si_symb, magfact] = this.auto_scale(printval, si_symb, magfact); - var dummy = this.auto_scale(printval, si_symb, magfact); printval = dummy[0]; si_symb = dummy[1]; magfact = dummy[2]; + var dummy = this.auto_scale( + printval, si_symb, magfact); + printval = dummy[0]; + si_symb = dummy[1]; + magfact = dummy[2]; if (printval === 0.0) magfact = -1.0; } else { printval /= magfact; @@ -2448,7 +2452,11 @@ RRDGraph.prototype = { this.gdes[i].format = this.gdes[i].format.substr(0, percent_s+1)+'s'+this.gdes[i].format.substr(percent_s+2); } else if (!this.gdes[i].strftm && this.gdes[i].format.indexOf('%s') != -1) { //[printval, si_symb, magfact] = this.auto_scale(printval, si_symb, magfact); - var dummy = this.auto_scale(printval, si_symb, magfact); printval = dummy[0]; si_symb = dummy[1]; magfact = dummy[2]; + var dummy = this.auto_scale( + printval, si_symb, magfact); + printval = dummy[0]; + si_symb = dummy[1]; + magfact = dummy[2]; } @@ -3129,10 +3137,13 @@ RRDGraph.prototype = { var sval = value*this.second_axis_scale+this.second_axis_shift; if (!this.second_axis_format[0]){ if (this.force_units_si) { - var mfac = 1; - var symb = ''; - //[sval, symb, mfac ] = this.auto_scale(sval, symb, mfac); - var dummy = this.auto_scale(sval, symb, mfac); sval = dummy[0]; symb = dummy[1]; mfac = dummy[2]; + var mfac = 1; + var symb = ''; + //[sval, symb, mfac ] = this.auto_scale(sval, symb, mfac); + var dummy = this.auto_scale(sval, symb, mfac); + sval = dummy[0]; + symb = dummy[1]; + mfac = dummy[2]; graph_label_right = this.sprintf("%4.0f %s", sval,symb); } else { graph_label_right = this.sprintf("%3.0e", sval); @@ -3501,11 +3512,23 @@ RRDGraph.prototype = { nlabels++; if (this.second_axis_scale != 0){ var graph_label_right; - sval = this.ygrid_scale.gridstep*i*this.second_axis_scale+this.second_axis_shift; - if (!this.second_axis_format){ - if (!second_axis_magfact){ - var dummy = this.ygrid_scale.gridstep*(sgrid+egrid)/2.0*this.second_axis_scale+this.second_axis_shift; - [dummy, second_axis_symb, second_axis_magfact ] = this.auto_scale(dummy,second_axis_symb,second_axis_magfact); + sval = (this.ygrid_scale.gridstep * + i * + this.second_axis_scale + + this.second_axis_shift); + + if (!this.second_axis_format) { + if (!second_axis_magfact) { + var dummy = (this.ygrid_scale.gridstep * + (sgrid+egrid)/2.0 * + this.second_axis_scale + + this.second_axis_shift); + var scaled = this.auto_scale( + dummy, second_axis_symb, + second_axis_magfact); + dummy = scaled[0]; + second_axis_symb = scaled[1]; + second_axis_magfact = scaled[2]; } sval /= second_axis_magfact; if(MaxY < 10) { -- cgit v1.1-4-g5e80