Coder
Coder

Reputation: 9

Adding prefix or suffix like $ to data labels in plugins in react-chartjs-2

  1. Any idea of adding prefix like $ to add before data labels in "chartjs-plugins-datalbels" .

  2. Any idea to move the datalabels to left or right on top of the bar on barchart in "chartjs-plugins-datalbels" .

Any help would be appreciated .

Upvotes: 1

Views: 1179

Answers (1)

Pujan Sapkota
Pujan Sapkota

Reputation: 1

const option ={
plugins: {
  tooltip: {
    callbacks: {
      label: (item) =>
        `${item.label}: ${item.formattedValue}`,
    },
  },

} }

Upvotes: 0

Related Questions