1

I want to know how I would be able to show Labels on the doughnut chart and the legend, I'm using chart.js as plugin

I used scaleShowLabels: true but It doesn't work

here is my code :

  var data = [{
    value: 30,
    color: "#F7464A",
    label: "Yasser"
}, {
    value: 50,
    color: "#E2EAE9",
    label: "Zeyd"
}, {
    value: 100,
    color: "#D4CCC5",
    label: "Mouad"
}, {
    value: 40,
    color: "#949FB1",
    label: "Hanine"
}, {
    value: 120,
    color: "#4D5360",
    label: "Kheira"
}

]

var options = {
    animation: false,
    scaleShowLabels: true
};

//Get the context of the canvas element we want to select
var c = $('#myChart');
var ct = c.get(0).getContext('2d');
var ctx = document.getElementById("myChart").getContext("2d");
/*************************************************************************/
myNewChart = new Chart(ct).Doughnut(data, options);

DEMO + CODE

Stranger B.
  • 9,004
  • 21
  • 71
  • 108

1 Answers1

0

I found all the solutions of the Chart js main problems,

it's about an edited js file, which has all code samples, you can find more information about it here :

https://github.com/FVANCOP/ChartNew.js

Stranger B.
  • 9,004
  • 21
  • 71
  • 108