lib/JSLitmus.js
function() {
      var n = JSLitmus._tests.length, markers = [], data = [];
      var d, min = 0, max = -1e10;
      var normalize = jsl.$('test_normalize').checked;

      // Gather test data
      for (var i=0; i < JSLitmus._tests.length; i++) {
        var test = JSLitmus._tests[i];
        if (test.count) {
          var hz = test.getHz(normalize);
          var v = hz != Infinity ? hz : 0;
          data.push(v);
          markers.push('t' + jsl.escape(test.name + '(' + jsl.toLabel(hz)+ ')') + ',000000,0,' +
            markers.length + ',10');
          max = Math.max(v, max);
        }
      }
      if (markers.length <= 0) return null;

      // Build chart title
      var title = document.getElementsByTagName('title');
      title = (title && title.length) ? title[0].innerHTML : null;
      var chart_title = [];
      if (title) chart_title.push(title);
      chart_title.push('Ops/sec (' + platform + ')');

      // Build labels
      var labels = [jsl.toLabel(min), jsl.toLabel(max)];

      var w = 250, bw = 15;
      var bs = 5;
      var h = markers.length*(bw + bs) + 30 + chart_title.length*20;

      var params = {
        chtt: escape(chart_title.join('|')),
        chts: '000000,10',
        cht: 'bhg',                     // chart type
        chd: 't:' + data.join(','),     // data set
        chds: min + ',' + max,          // max/min of data
        chxt: 'x',                      // label axes
        chxl: '0:|' + labels.join('|'), // labels
        chsp: '0,1',
        chm: markers.join('|'),         // test names
        chbh: [bw, 0, bs].join(','),    // bar widths
        // chf: 'bg,lg,0,eeeeee,0,eeeeee,.5,ffffff,1', // gradient
        chs: w + 'x' + h
      };
      return 'http://chart.apis.google.com/chart?' + jsl.join(params, '=', '&');
    }
function() {
      var n = JSLitmus._tests.length, markers = [], data = [];
      var d, min = 0, max = -1e10;
      var normalize = jsl.$('test_normalize').checked;

      // Gather test data
      for (var i=0; i < JSLitmus._tests.length; i++) {
        var test = JSLitmus._tests[i];
        if (test.count) {
          var hz = test.getHz(normalize);
          var v = hz != Infinity ? hz : 0;
          data.push(v);
          markers.push('t' + jsl.escape(test.name + '(' + jsl.toLabel(hz)+ ')') + ',000000,0,' +
            markers.length + ',10');
          max = Math.max(v, max);
        }
      }
      if (markers.length <= 0) return null;

      // Build chart title
      var title = document.getElementsByTagName('title');
      title = (title && title.length) ? title[0].innerHTML : null;
      var chart_title = [];
      if (title) chart_title.push(title);
      chart_title.push('Ops/sec (' + platform + ')');

      // Build labels
      var labels = [jsl.toLabel(min), jsl.toLabel(max)];

      var w = 250, bw = 15;
      var bs = 5;
      var h = markers.length*(bw + bs) + 30 + chart_title.length*20;

      var params = {
        chtt: escape(chart_title.join('|')),
        chts: '000000,10',
        cht: 'bhg',                     // chart type
        chd: 't:' + data.join(','),     // data set
        chds: min + ',' + max,          // max/min of data
        chxt: 'x',                      // label axes
        chxl: '0:|' + labels.join('|'), // labels
        chsp: '0,1',
        chm: markers.join('|'),         // test names
        chbh: [bw, 0, bs].join(','),    // bar widths
        // chf: 'bg,lg,0,eeeeee,0,eeeeee,.5,ffffff,1', // gradient
        chs: w + 'x' + h
      };
      return 'http://chart.apis.google.com/chart?' + jsl.join(params, '=', '&');
    }
function ( ) { var n = JSLitmus . _tests . length , markers = [ ] , data = [ ] ; var d , min = 0 , max = - 1e10 ; var normalize = jsl . $ ( 'test_normalize' ) . checked ; // Gather test data for ( var i = 0 ; i < JSLitmus . _tests . length ; i ++ ) { var test = JSLitmus . _tests [ i ] ; if ( test . count ) { var hz = test . getHz ( normalize ) ; var v = hz != Infinity ? hz : 0 ; data . push ( v ) ; markers . push ( 't' + jsl . escape ( test . name + '(' + jsl . toLabel ( hz ) + ')' ) + ',000000,0,' + markers . length + ',10' ) ; max = Math . max ( v , max ) ; } } if ( markers . length <= 0 ) return null ; // Build chart title var title = document . getElementsByTagName ( 'title' ) ; title = ( title && title . length ) ? title [ 0 ] . innerHTML : null ; var chart_title = [ ] ; if ( title ) chart_title . push ( title ) ; chart_title . push ( 'Ops/sec (' + platform + ')' ) ; // Build labels var labels = [ jsl . toLabel ( min ) , jsl . toLabel ( max ) ] ; var w = 250 , bw = 15 ; var bs = 5 ; var h = markers . length * ( bw + bs ) + 30 + chart_title . length * 20 ; var params = { chtt : escape ( chart_title . join ( '|' ) ) , chts : '000000,10' , cht : 'bhg' , // chart type chd : 't:' + data . join ( ',' ) , // data set chds : min + ',' + max , // max/min of data chxt : 'x' , // label axes chxl : '0:|' + labels . join ( '|' ) , // labels chsp : '0,1' , chm : markers . join ( '|' ) , // test names chbh : [ bw , 0 , bs ] . join ( ',' ) , // bar widths // chf: 'bg,lg,0,eeeeee,0,eeeeee,.5,ffffff,1', // gradient chs : w + 'x' + h } ; return 'http://chart.apis.google.com/chart?' + jsl . join ( params , '=' , '&' ) ; }
Generate a Google Chart URL that shows the data for all tests
Generate a Google Chart URL that shows the data for all tests