All,

I'm using HighCharts in a web app I'm working on, and generally, I like it very much.

However, I'm having a hard time figuring out how capture a mouse click on the ENTIRE chart.

In other words - I'd like to know when the user clicks ANYWHERE on the chart (e.g., the plot area, the title, the x- or y-axis, the margins and padding around the chart elements, etc.)

Or, I'd like to disable events altogether, so I can trap the event in the container itself.

More detailed version...

I have a DIV that contains my HighChart.

I want to know if the user clicks ANYWHERE within that DIV.

So - initially I tried attaching an "onclick" event to the DIV, but that never gets fired, presumably because the click is getting trapped by the HighChart.

So, in the code that sets up the HighChart, I added this:

var chart = new Highcharts.Chart({
    chart: {
        renderTo: "container",
        events: {
            click: function(event) {
                // do something
            }
        },
        ...
    }
    ...
});


This works OK IF the user clicks somewhere within the plot area, but not if she clicks anywhere else in the chart (e.g., the x-axis, the y-axis, the title, the padding around the chart elements, etc.)

So - how can I make the ENTIRE chart clickable?

Many thanks in advance!


Question: How do I prevent unwanted routing errors in production
Answer: Rails does this automatically when application running in production mode.When uploading application to live server, Rails takes care of handling those exceptions and rendering the correct error pages with the correct header status.You can directly find the files inside public folder.

Whenever you set up your Rails application on a live server, you give the site root as the /public folder in your application. Then, whenever a request is made to that server address, Web server first looks in that public folder and tries to serve a static asset (this is a configurable option in config/environment.rb). If it can't find the requested page, then the request is forwarded through the Ruby stack.

When in production mode, if Rails encounters an error that isn't handled, it throws the error to the stack, which then tells Web server to render an appropriate error.

Here are some common errors that you'll see in development mode and what they render in production mode:

ActiveRecord::RecordNotFound =&gt; 404 (page not found)
nil.method =&gt; 500 (server error) unless you turn off whiny nils
ActionController::RoutingError =&gt; 404 (page not found)