summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Wall <richard@largo>2011-08-12 22:31:17 +0100
committerRichard Wall <richard@largo>2011-08-12 22:31:17 +0100
commita5a2ae15e4206164ea9676e966dfe9c85655bc3c (patch)
treebe530acf3830b028974aa0bfd7dae9624dd3561b
parentd5495e0a8659be7e169ac7e88afd5264e2e6855b (diff)
fix some broken assignments
-rw-r--r--docs/examples/assets/js/jsrrdgraph.js45
1 files 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) {