-
I want to add labels around a pie chart (in Angular 11). But since the circle of the chart is as large that it reaches the "bottom-line" of the canvas, the bottom labels are not visible. Typescript code: plugins: {
datalabels: {
display: this.showLegend,
align: 'end',
anchor: 'end',
clamp: true,
font: { size: 12, weight: 'normal' },
color: '#333',
formatter(value, context) {
return context.chart.data.labels[context.dataIndex];
},
}
} |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
You can use layout padding to make room for the labels: |
Beta Was this translation helpful? Give feedback.
-
i am not even able to add labels around the pie-chart. can you help with this?? (using chartjs-plugin-datalabels version 2.2.0 and Chart.js v4.4.1)) |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
You can use layout padding to make room for the labels:
https://www.chartjs.org/docs/latest/configuration/layout.html