I tried use the chartjs-plugin-labels, but doesn't work for me. My code for chart options is below.
Code: Select all
{
legend: {
position: 'right'
}
};
Code: Select all
{
legend: {
position: 'right'
}
};
Code: Select all
this.pieData = {
labels: ['A', 'B', 'C'],
datasets: [
{
data: [300, 50, 100],
backgroundColor: [
'#FFC107',
'#03A9F4',
'#4CAF50'
],
hoverBackgroundColor: [
'#FFE082',
'#81D4FA',
'#A5D6A7'
]
}]
};
this.pieOptions = {
legend: {
position: 'right'
}
};
Code: Select all
<p-chart type="pie" [data]="pieData" [options]="pieOptions"></p-chart>
Users browsing this forum: No registered users and 16 guests