I have a C3 xy chart, that I'm trying to add an onclick to. The onclick is commented out (lines 58-70) in the attached fiddle. Scatter Fiddle The chart does not show when I have the onclick code included, somewhere I've messed up the syntax.
var clickEvent = function(d) {
var clickData = d.id;
var clickValue = d.value; //y value ROS
var clickCat = [d.x]; //x value AU
var clickLegend = [d.name];
var clickYear = d.id == 'data1' ? tooltips.data1[d.index] : d.id == 'data2' ? tooltips.data2[d.index] : d.id == 'data3' ? tooltips.data3[d.index] : d.id == 'data4' ? tooltips.data4[d.index] : null;
var allTogether = clickData + "|" + clickValue + "|" + clickCat + "|" + clickLegend + "|" + clickYear;
var theURL = alert(allTogether);
}
onclick: clickEvent