Franky
November 15, 2012, 3:57pm
#1
Hi
Tryed to add a event to a chart to launch a action.
I just found the “onItemClick” method and wanna known if there is a possibility to click ANYWHERE in the chart (instead exactly on the datapoint) to launch a action or function ?
Used code for the “onItemClick” method:
chart_1.attachEvent(“onItemClick”, function(id){
show_long_statistics_for_lpar(system_name, “AME FAKTOR”, “ame”, “1”);
})
Many thanks !
Regards,
Franky
Hi,
you may set event listener to div where chart is drawn. Try to use dhtmlx.event helper:
dhtmlx.event(document.getElementById(“chartDiv”),“click”,function(){
// your code here
});
Franky
November 21, 2012, 3:58pm
#3
Hello Alexandra
Thanks for your answer.
I didn’t use
for my charts, I draw them directly in the cell.
Could be that the misstake I make ?
var chart_1 = chart_layout_4.cells(“a”).attachChart(line_low_chart_1_cfg);
I’m really not a crack with HTML
Hello,
You may use the private property on a chart ("_obj") to get the container where the chart is created:
var chart_1 = chart_layout_4.cells(“a”).attachChart(line_low_chart_1_cfg);
dhtmlx.event(chart_1._obj,“click”,function(){
// your code here
});
Franky
November 23, 2012, 11:06am
#5
Alexandra
Thats really great !!!
Works exactlty the way I wanted
Best whishes
Franky