onClick event with a stacked bar chart

How can I find out which section of a stacked bar chart a user clicks on?

What I’d like to do is allow the user to be taken to a page of details related to the section of the chart he clicks on. To do this I need to know which bar he clicked on and which segment of the bar was clicked.

You can use “onItemClick” event. Please check docs.dhtmlx.com/doku.php?id=dhtm … nitemclick

I still cannot find out what segment the user clicked on. The id returned by the onClick event is the same no matter which colored segment of the bar he clicked on. Is there a way to know which segment of the stacked bar was clicked?

Can be retrieved in the next way

barChart1.attachEvent("onItemClick", function(id, event){ var target = event.target||event.srcElement; alert(target.getAttribute("userdata")); });

Excellent! Thank you.