Hi There. I’m trying to replicate chart drill down in webix.
I can probably go on the click event but will need to get the value of the item in the series that was clicked.
Lets say i have xAxis months and series sales. If i click on sales for the month the chart data:"" needs to change passing the month i clicked on as a var to the ajax call.
Any ideas.
Kind Regards
Hi,
onItemClick
returns an item ID, so you can get the entire data item and particularly the month viachart.getItem(id).month
. But it won’t detect which one of the series was clicked.
The only way is to get its index via theuserdata
html arttribute:
onItemClick:function(id, e, node){
console.log(id+" "+node.getAttribute("userdata"))
}
Thank you very much for all your help. Will try this method.
Hello,
I have tested this solution and with the version 4.4.5 I have always 0 with userdata.
I see the index in attribut: node.getAttribute(“webix_area_id”)
That is normal ?
Regards,
Hello,
That is ok. I have made a mistake. Sorry.
The userdata is the serie index.
Regards,