Topic: How to remove labels from Pie Chart and the tooltip still there
Just for Fun asked 7 years ago
//pie
var ctxP = document.getElementById("pieChart").getContext('2d');
var myPieChart = new Chart(ctxP, {
type: 'pie',
data: {
labels: ["Tagihan Selesai", "Tagihan Telat Bayar", "Total Tagihan"],
datasets: [
{
data: [300, 50, 120],
backgroundColor: ["#F7464A", "#46BFBD", "#4D5360"],
hoverBackgroundColor: ["#FF5A5E", "#5AD3D1", "#616774"]
}
]
},
options: {
responsive: true,
labels: false
}
});
Jakub Strebeyko staff answered 7 years ago
The easiest way to have no labels would be to modify global options for the chart legend, which are defined in
Chart.defaults.global.legend
as seen here. For this and other fun chart options I recommend visiting official chart.js documentation.With Best Regards, Kuba
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Resolved
- User: Free
- Premium support: No
- Technology: Other
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: No