admin管理员组

文章数量:1422062

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.

/

If anyone knows how to do that with any of the charting plugins can kindly share.

thanks

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/grVFk/5074/

If anyone knows how to do that with any of the charting plugins can kindly share.

thanks

Share Improve this question edited Oct 12, 2011 at 10:58 Book Of Zeus 49.9k18 gold badges175 silver badges171 bronze badges asked Apr 18, 2011 at 7:03 fonfon 2652 gold badges7 silver badges16 bronze badges 2
  • how did you put up that chart in jsfiddle?? – S L Commented Apr 18, 2011 at 7:07
  • well i have anccount there so i can upload it things there. well u can also continue to work on mine or u create an account there and upload ur own files – fon Commented Apr 18, 2011 at 7:30
Add a ment  | 

1 Answer 1

Reset to default 5

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/scheffield/grVFk/5090/

本文标签: