Chartjs-Custom label title for scatter in React-ChartJS-2

0👍

Add label title to either of the axes like so:

const options = {
  scales: {
    y: {
      beginAtZero: true,
      title: {
        display: true,
        text: 'label for Y'
      }
    },
    x: {
        beginAtZero: true,
        title: {
          display: true,
          text: 'label for X'
        }
      },
  },
};

the text property is the text label to be displayed on the axes. ‘options’ variable is what you pass to the options prop.

Leave a comment