Home forums Feature Requests & Feedback Event handling on Chart Reply To: Event handling on Chart

#4609

Sunil Urs
Keymaster

Yes, you can do so. Because you don’t need event handler on any particular dataPoint/dataSeries but the entire Chart, you can directly use Chart’s Container element. Below is how

 

<div id=”chartContainer” data-url=”http://canvasjs.com” style=”width: 600px; height: 300px;”></div>

 

//Am using  jQuery here. You can do so even with plain javascript

$(“#chartContainer”).click(function () {

window.location.href = $(this).data(“url”);

});