js/main.js
// Changes the names of each series.
Changes the names of each series.
Changes the names of each series .
function series() {
        if (args.length === 0) {
          return preerr + 'The series command adds a custom name to each series of a chart if one exists.  Please see <em>help series</em> for more information.' + sufans;
        } else {
          var chart = terminal.getChart(),
              tempArg;
          if (chart) {
            for (var k = 0; k < args.length; k++) {
              try {
                tempArg = parser.eval(args[k]);
                if (typeof tempArg === 'string') {
                  args[k] = tempArg;
                }
              } catch (error) {
              }
            }
            try {
              if (chart.series.length > 1 && chart.series[1].options.linkedTo === ':previous') {
                for (var i = 0; i < chart.series.length; i += 2) {
                  chart.series[i].update({
                    name: args[~~(i / 2)]
                  }, false);
                }
              } else {
                for (var j = 0; j < chart.series.length; j++) {
                  chart.series[j].update({
                    name: args[j]
                  }, false);
                }
              }
              chart.redraw();
            } catch(error) {
              return preerr + 'The text labels for the series command seems to be improperly formatted.  Please see <em>help series</em> for more information.' + sufans;
            }
          }
          return '';
        }
      }
function series ( ) { if ( args . length === 0 ) { return preerr + 'The series command adds a custom name to each series of a chart if one exists.  Please see <em>help series</em> for more information.' + sufans ; } else { var chart = terminal . getChart ( ) , tempArg ; if ( chart ) { for ( var k = 0 ; k < args . length ; k ++ ) { try { tempArg = parser . eval ( args [ k ] ) ; if ( typeof tempArg === 'string' ) { args [ k ] = tempArg ; } } catch ( error ) { } } try { if ( chart . series . length > 1 && chart . series [ 1 ] . options . linkedTo === ':previous' ) { for ( var i = 0 ; i < chart . series . length ; i += 2 ) { chart . series [ i ] . update ( { name : args [ ~ ~ ( i / 2 ) ] } , false ) ; } } else { for ( var j = 0 ; j < chart . series . length ; j ++ ) { chart . series [ j ] . update ( { name : args [ j ] } , false ) ; } } chart . redraw ( ) ; } catch ( error ) { return preerr + 'The text labels for the series command seems to be improperly formatted.  Please see <em>help series</em> for more information.' + sufans ; } } return '' ; } }
Changes the names of each series.
Changes the names of each series .
// Not a variable in the console. // No need to catch this, leave args[k] as is. // Check if this is a sample plot which uses both column and scatter to make the stem.