OutLabels Plugin
var data = {
type: 'pie',
data: {
labels: ["Red",
"Green",
"Yellow"],
datasets: [{
data: [300, 50, 100],
backgroundColor: [
"#F7464A",
"#46BFBD",
"#FDB45C"],
hoverBackgroundColor: [
"#FF5A5E",
"#5AD3D1",
"#FFC870"]
}]
}
}
var options = {
responsive: true,
maintainAspectRatio: false,
layout: {
padding: 10
},
plugins: {
legend: {
display: false
},
outlabels: {
text: "%l (%p)",
textAlign: "center",
font: {
resizable: true,
minSize: 18,
maxSize: 25
}
}
}
}
//Initialize the chart by using setData
elements.chart.setData(data);
//Initialize additional options for outlabels plugin
elements.chart.setOptions(options);Options

Text Options

Last updated
Was this helpful?