Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Highcharts: get category name on column click

I am a highcharts rookie and it seems like a very simple problem, but I am unable to get x axis category when I click on a column in a very simple column chart.

What I tried without success:

  • this,
  • x, this.x,
  • Having a look at the chart object (within my browser with developer tools) itself to see if there would be anything useful in its structure itself, but I don't seem to find what I need.

Here is a fiddle for you to play with: http://jsfiddle.net/9xskkkpx/

like image 981
ConfusedBoy Avatar asked Jan 19 '26 03:01

ConfusedBoy


1 Answers

column: {
    events: {
        click:function(event) {
            alert(event.point.category);
        }
    }
}

http://jsfiddle.net/9xskkkpx/1/

https://api.highcharts.com/highcharts/plotOptions.column.events.click

like image 157
Barbara Laird Avatar answered Jan 21 '26 18:01

Barbara Laird



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!