Reputation: 175
I am using piechart from chart.js
for visualization in my application.
I am using a plug-in with it chartjs-plugin-piechart-outlabels
to show the labels as out-segments from the pie chart.
It's all working fine, except that, the labels exists on the pie chart, which I do not want, as I am showing the labels as out-segments.
I have looked through documentation and couldnt find solution to this, also looked some examples.
public static readonly pieChartOptions: ChartOptions = {
responsive: true,
maintainAspectRatio: false,
legend: {
display: false
},
tooltips: {
enabled: true
},
layout: {
padding: {
left: 0,
right: 0,
top: 70,
bottom: 0
}
},
plugins: {
outlabels: {
display: true,
borderWidth: 2,
lineWidth: 2,
padding: 3,
textAlign: 'center',
stretch: 15,
font: {
resizable: true,
minSize: 12,
maxSize: 18
},
valuePrecision: 1,
percentPrecision: 2
}
}
};
Upvotes: 3
Views: 4823
Reputation: 21
You need to turn off the sample labels, like this:
options: {
plugins: {
datalabels: {
display: false
}
outlabels: {
display: true
}
}
}
Upvotes: 2
Reputation: 175
@yurzui mentioned, there was reference of chartjs-plugin-labels
which i missed to remove. Thanks @yurzui
Upvotes: 0