score:3

Accepted answer

chart.js does not draw any data labels itself by default. you most probably have activated (imported) a plugin such as chartjs-plugin-datalabels that draws these labels.

to disable a global plugin for a specific chart instance, the plugin options must be set to false.

in the case of chartjs-plugin-datalabels, this would be done as follows:

options: {
  plugins: {
    datalabels: {
      display: false
    }
  },
}

to avoid the cropped data labels, you can define some extra space to the left and the right of the chart through the option layout.padding as shown below:

options: {
  layout: {
    padding: {
      left: 50,
      right: 50
    }
  }
}

Related Query

More Query from same tag