Topic: Percent Sign on Chart Label
lambrechtalex pro asked 6 years ago
I want to show the percent sign when I hover over an area in a doughnut chart, but I cannot figure out how to change the hover number from a number to include the % sign.Here is my code:
var ctxD = document.getElementById("whoExpDonut").getContext('2d'); var myLineChart = new Chart(ctxD, { type:'doughnut', data:{ labels: [whoExpLabel,"Other"], datasets: [{ data: [$scope.whoExpPercentage,100-$scope.whoExpPercentage],backgroundColor: ["#4EBA75","#F5F5F5"], }] }, options:{responsive:true}});
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Status
Opened
Specification of the issue
- ForumUser: Pro
- Premium support: No
- Technology: MDB jQuery
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: No
Tags
Witold Tkaczyk free commented 6 years ago
Hi, can you provide me your $scope and whoExpLabel variables to make this question complete?lambrechtalex pro commented 6 years ago
whoExpLabel = 36 (which we want to be a percentage) and our data is [36,64].Bartłomiej Malanowski staff commented 6 years ago
What is your version of MDB?