Chartjs-How to add a title in Doughnut chart chart.js React

1👍

Since Chart.js version 3 title, subtitle, legend and tooltip are plugins and their options must be defined in plugins node.
As far as I have seen, react-chartjs-2 is working with Chartjs version >= 3.

const options = {
  responsive: true,
  plugins: {
    legend: {
      display: false,
      position: 'right',
    },
    title: {
      display: true,
      fontSize: 20, // <--- this is not a managed option since CHART.JS 3
      text: 'Tickets'
    }
  }
}

Leave a comment