Alex Rivera | Logout

Highcharts: Area clickable

Asked 2011-11-11T09:18:12.330
10

I have an area Highchart chart. Added a click event to the chart, like this:

plotOptions: {
                area: {
                    marker: {
                        enabled: false
                    },
                    cursor: 'Pointer',
                    stacking: 'normal',
                    events: {
                        click: function(event) {
                          alert("hi there");
                        }
                    }                   
                }
            }

It works fine. The problem is that you can only click very near to a line, but not on the area below the line, it is not clickable.

Is there a setting that I overlooked?

Edit
Report

1 Answer

3

According to the highcharts documentation, the click event only covers clicking on the series itself, so it will not register click events for clicking beneath the line.

To do what you want, you may need to handle things on your own by using the mouseOver event. Unforutnately, this event fires when the mouse hovers over the graph, which would mean you'd need to figure out where the mouse is on the graph and so forth.

Alternatively, you could modify the highcharts source code to suit your needs, or extend it, but in any case, I do not believe that this can be done easily.

answered 2011-11-16T17:26:01.047

Your Answer