Percent Sign on Chart Label


Topic: Percent Sign on Chart Label

lambrechtalex pro asked 7 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}});

Witold Tkaczyk commented 7 years ago

Hi, can you provide me your $scope and whoExpLabel variables to make this question complete?

lambrechtalex pro commented 7 years ago

whoExpLabel = 36 (which we want to be a percentage) and our data is [36,64].

Bartłomiej Malanowski staff pro premium commented 7 years ago

What is your version of MDB?

Please insert min. 20 characters.

FREE CONSULTATION

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

Status

Open

Specification of the issue
  • User: Pro
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No