Chart.js: Row and column names for axis's

Created on 17 Jun 2016  ·  3Comments  ·  Source: chartjs/Chart.js

Can I give labels to the X and Y axis's by a bar or line chart like image below? I've searched in the documentation but nothing found that works.

image

I need to do that for show statistics for a big data site. The users will see how many users are registered by city, town or village.

I use the latest version of chart.js

Most helpful comment

Based on the documentation and a few examples, it should be feasible using the scale.scaleLabel.labelString option:

  options: {
    scales: {
      xAxes: [{
        scaleLabel: {
          labelString: 'Month'
        }
      }],
      yAxes: [{
        scaleLabel: {
          labelString: 'New Items'
        }
      }]
    }
  }

All 3 comments

I actually have the same question

Based on the documentation and a few examples, it should be feasible using the scale.scaleLabel.labelString option:

  options: {
    scales: {
      xAxes: [{
        scaleLabel: {
          labelString: 'Month'
        }
      }],
      yAxes: [{
        scaleLabel: {
          labelString: 'New Items'
        }
      }]
    }
  }

@simonbrunel is correct.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SylarRuby picture SylarRuby  ·  3Comments

adriantombu picture adriantombu  ·  3Comments

benmccann picture benmccann  ·  3Comments

gabrieldesouza picture gabrieldesouza  ·  3Comments

lbowers picture lbowers  ·  3Comments