I used angular -chart.js on my website to create a pie chart and I would like to customize the legend. By default, the legend displays the color and label. (As shown in the image below), I would like to add the value / data of this label, as shown in the chart tooltip.

This is my HTML code:
<canvas id="pie" class="chart chart-pie"
chart-data="chartData" chart-labels="chartLabels" chart-options="chartOptions">
</canvas>
Based on the documentation of angular -chart.js, the legend is now a parameter to Chart.js, so the chart legend attribute has been removed.
This is why in my JS code I tried to add generateLabels, just in case, this is what I need to set up the legend:
$scope.chartOptions = {
legend: {
display: true,
labels: {
generateLabels: function(chart){
console.log(chart.config);
}
}
}
};
, , . , - . , generateLabels - , .
- , ?
!