score:4

Accepted answer

Add this

hover: {
    onHover: function(e) {
    $("#canvas1").css("cursor", "auto");
  }

to options:


Like this:

var ctx = document.getElementById("canvas1").getContext("2d");

var mychart = new Chart(ctx, {
  type: 'doughnut',
  data: {
    labels: ['uno', 'dos', 'tres', 'cuatro'],
    datasets: [{
      data: [1, 2, 3, 4],
      backgroundColor: ["#BDC3C7","#9B59B6","#E74C3C","#26B99A"]
    }]
  },
  options: {
    hover: {
        onHover: function(e) {
        $("#canvas1").css("cursor", "auto");
      }
    },
    legend: {
                position: 'bottom',
                onHover: function(c) {
                    console.log(c);
                    $("#canvas1").css("cursor", "pointer");                 
                }
     }
  }
});

https://jsfiddle.net/v77twcww/


Related Query