0

I am using Chart.js ver: 2.9.3. I am using custom tooltip to show up on the click of the bubble type dataset. Please refer below image: enter image description here Now, I want to unhighlight (make inactive) all the bubbles programatically on the click of the button. Can anybody please help me with this?

Rahul Gupta
  • 9,775
  • 7
  • 56
  • 69

1 Answers1

0

As show in the code snippet below, I used update method of the chart to rerender the chart after I set empty array for the active property of the chart.

JS:

var myChart = new Chart(ctx, {
  ....
  .....
});

function setInactiveAllPoints() {
  myChart.active = [];
  myChart.update();
}

HTML:

<button onclick="setInactiveAllPoints()">Set Inactive All Points On Chart</button>
Rahul Gupta
  • 9,775
  • 7
  • 56
  • 69