Chartjs-How to show Charts.js lables

0👍

You can find it in the Charts.js documentation but this is a working polar chart. Just need to create your canvas in the body of the html and reference it correctly. Changing labels: is where you will change the top part that you are requesting.

var ctx = document.getElementById("myChart").getContext('2d');
var myChart = new Chart(ctx, {
    type: 'polarArea',
    responsive: false,
    data: {
        labels: ["Red", "Green", "Yellow", "Grey", "Blue"],
        datasets: [{
            backgroundColor: [
                "red",
                "green",
                "yellow",
                "grey",
                "blue"
           ],
           data: [12, 19, 3, 17, 28]
        }]
    }
});

Leave a comment