~richardw/jarmon/jsrrdgraph-integration

« back to all changes in this revision

Viewing changes to docs/examples/assets/js/jsrrdgraph.js

  • Committer: Richard Wall
  • Date: 2011-08-12 21:31:17 UTC
  • Revision ID: richard@largo-20110812213117-fatrqn1frxakatqv
fix some broken assignments

Show diffs side-by-side

added added

removed removed

Lines of Context:
2440
2440
          if (!this.gdes[i].strftm && (percent_s = this.gdes[i].format.indexOf('%S')) != -1) {
2441
2441
                        if (magfact < 0.0) {
2442
2442
                            //[printval, si_symb, magfact] = this.auto_scale(printval, si_symb, magfact);
2443
 
                            var dummy = this.auto_scale(printval, si_symb, magfact); printval = dummy[0]; si_symb = dummy[1]; magfact = dummy[2];
 
2443
                            var dummy = this.auto_scale(
 
2444
                                printval, si_symb, magfact);
 
2445
                            printval = dummy[0];
 
2446
                            si_symb = dummy[1];
 
2447
                            magfact = dummy[2];
2444
2448
                            if (printval === 0.0) magfact = -1.0;
2445
2449
                        } else {
2446
2450
                            printval /= magfact;
2448
2452
                        this.gdes[i].format = this.gdes[i].format.substr(0, percent_s+1)+'s'+this.gdes[i].format.substr(percent_s+2);
2449
2453
                    } else if (!this.gdes[i].strftm && this.gdes[i].format.indexOf('%s') != -1) {
2450
2454
                        //[printval, si_symb, magfact] = this.auto_scale(printval, si_symb, magfact);
2451
 
                        var dummy = this.auto_scale(printval, si_symb, magfact); printval = dummy[0]; si_symb = dummy[1]; magfact = dummy[2];
 
2455
                        var dummy = this.auto_scale(
 
2456
                            printval, si_symb, magfact);
 
2457
                        printval = dummy[0];
 
2458
                        si_symb = dummy[1];
 
2459
                        magfact = dummy[2];
2452
2460
 
2453
2461
                    }
2454
2462
 
3129
3137
        var sval = value*this.second_axis_scale+this.second_axis_shift;
3130
3138
        if (!this.second_axis_format[0]){
3131
3139
          if (this.force_units_si) {
3132
 
            var mfac = 1;
3133
 
            var symb = '';
3134
 
            //[sval, symb, mfac ] = this.auto_scale(sval, symb, mfac);
3135
 
            var dummy = this.auto_scale(sval, symb, mfac); sval = dummy[0]; symb = dummy[1]; mfac = dummy[2];
 
3140
              var mfac = 1;
 
3141
              var symb = '';
 
3142
              //[sval, symb, mfac ] = this.auto_scale(sval, symb, mfac);
 
3143
              var dummy = this.auto_scale(sval, symb, mfac);
 
3144
              sval = dummy[0];
 
3145
              symb = dummy[1];
 
3146
              mfac = dummy[2];
3136
3147
            graph_label_right = this.sprintf("%4.0f %s", sval,symb);
3137
3148
          } else {
3138
3149
                        graph_label_right = this.sprintf("%3.0e", sval);
3501
3512
                    nlabels++;
3502
3513
                    if (this.second_axis_scale != 0){
3503
3514
                        var graph_label_right;
3504
 
                        sval = this.ygrid_scale.gridstep*i*this.second_axis_scale+this.second_axis_shift;
3505
 
                        if (!this.second_axis_format){
3506
 
                            if (!second_axis_magfact){
3507
 
                                var dummy = this.ygrid_scale.gridstep*(sgrid+egrid)/2.0*this.second_axis_scale+this.second_axis_shift;
3508
 
                                [dummy, second_axis_symb, second_axis_magfact ] = this.auto_scale(dummy,second_axis_symb,second_axis_magfact);
 
3515
                        sval = (this.ygrid_scale.gridstep *
 
3516
                                i *
 
3517
                                this.second_axis_scale +
 
3518
                                this.second_axis_shift);
 
3519
 
 
3520
                        if (!this.second_axis_format) {
 
3521
                            if (!second_axis_magfact) {
 
3522
                                var dummy = (this.ygrid_scale.gridstep *
 
3523
                                             (sgrid+egrid)/2.0 *
 
3524
                                             this.second_axis_scale +
 
3525
                                             this.second_axis_shift);
 
3526
                                var scaled = this.auto_scale(
 
3527
                                    dummy, second_axis_symb,
 
3528
                                    second_axis_magfact);
 
3529
                                dummy = scaled[0];
 
3530
                                second_axis_symb = scaled[1];
 
3531
                                second_axis_magfact = scaled[2];
3509
3532
                            }
3510
3533
                            sval /= second_axis_magfact;
3511
3534
                            if(MaxY < 10) {