Skip to content Skip to sidebar Skip to footer

How To Catch The Click Event From The Axis Ticks Jqplot, Highcharts,flot

I want to be able to catch the clicked event that is hooked to all the axis ticks. here is what i have done so far. http://jsfiddle.net/grVFk/5074/ If anyone knows how to do that

Solution 1:

the plot isn't plain HTML. So there is no a tag. And the plot itself do not provide you with an api to catch the click event on an axis tick.

What you can do is to select the axis tick manually with jQuery and add a click event:

$('.highcharts-axis tspan').each(function(){
    var label = $(this),
        value = label.text();
    if(categoryLinks[value]) {
        label.click(function(){
            // you' free to what you want...alert('could link to another page: ' + categoryLinks[value]);
        });
    }
});

And there is the solution: http://jsfiddle.net/scheffield/grVFk/5090/

Post a Comment for "How To Catch The Click Event From The Axis Ticks Jqplot, Highcharts,flot"