Holiday Notice: Support will be provided on a limited scale from December 24th, 2024, to January 2nd, 2025. Happy holidays and a wonderful New Year!


Topic: How to remove labels from Pie Chart and the tooltip still there

Just for Fun free asked 7 years ago


Hi, Can you guys help me? I want my pie chart without the labels, but when i removed the labels, the tooltip remind undefined. Here is the javascript //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


Hi there Just For Fun,

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

Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Resolved

Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: Other
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No
Tags