Chartjs-Draw Line Chart Using Chart.js

0👍

Just override the scaleLabel option

  ...
  scaleLabel: function(valueObj) {
    if (valueObj.value === '0')
        return 'Mean'
    else if (Number(valueObj.value) > 0)
      return '+' + valueObj.value + 's';
    else
      return valueObj.value + 's';
  }
});

Note that unless your data range is static, you’ll also need to override the scale.


Fiddle – http://jsfiddle.net/Lbk9ughy/

Leave a comment