Topic: How to Add a Label in Pie Chart

Bubai free asked 5 years ago


How to Add a Label in pie chart,

var ctxP = document.getElementById("pieChart").getContext('2d');

var myPieChart = new Chart(ctxP, { type: 'pie', data: { labels: ["V", "VI", "VII", "VIII", "IX", "X", "XI", "XII"], datasets: [{ data: [10,20,30,40,50,15], backgroundColor: ["#f20c12", "#e8e620", "#FDB45C", "#949FB1", "#46BFBD", "#1f7372", "#44f614", "#e819d7"], hoverBackgroundColor: ["#cb060b", "#d1cf04", "#f78d0d", "#7288ac", "#04b1ae", "#135f5e", "#2ebf07", "#bc08ad"], // hoverBackgroundColor: ["#ff5a5e", "#5AD3D1", "#FFC870", "#A8B3C5", "#616774", "#177a79", "#5ce338", "#ed37de", "#4a7bca"] }] }, options: { responsive: true } });


Adam Jakubowski staff answered 5 years ago


Hi,

Could you explain exactly what label you would like to add ? Any example how would you like it to look?

Best,

Adam



Please insert min. 20 characters.

FREE CONSULTATION

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

Status

Answered

Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: 4.8.8
  • Device: Computer
  • Browser: Chrome
  • OS: Windows 10
  • Provided sample code: No
  • Provided link: No
Tags