code: function(maxLen) {
          // nearest power of 10 lower than maxLen
          var digits = parseInt(Math.log(maxLen) / Math.log(10));
          var pow10 = Math.pow(10, digits);
          
          // ok, find first character
          var firstChar = parseInt(maxLen / pow10);
  
          // right, put it into the correct bracket
          var barLen;
          if(firstChar > 5) {
              barLen = 5;
          } else if(firstChar > 2) {
              barLen = 2;
          } else {
              barLen = 1;
          }
  
          // scale it up the correct power of 10
          return barLen * pow10;
      }
docs: Method: getBarLen
  Given a number, round it down to the nearest 1,2,5 times a power of 10.
  That seems a fairly useful set of number groups to use.
  
  Parameters:
  maxLen - {float}  the number we're rounding down from
  
  Returns:
  {Float} the rounded number (less than or equal to maxLen)