Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Click on point event does not work for large heatmap #4052

Closed
yplakosh opened this issue Mar 31, 2015 · 2 comments
Closed

Click on point event does not work for large heatmap #4052

yplakosh opened this issue Mar 31, 2015 · 2 comments

Comments

@yplakosh
Copy link

I would like to handle clicks on points for large heatmap but click event does not work for my example:
http://jsfiddle.net/3y4qsazu/

I specified handler as following code:

plotOptions: {
heatmap: {
point: {
events: {
click: function() {
alert("Point was clicked!");
}
}
}
}
}

@ghost
Copy link

ghost commented Mar 31, 2015

The point click event does not work because you are rendering the chart using Canvas and it does not have any SVG elements to capture your mouseclick anymore.

There are two solutions:

  1. Remove the Canvas rendering (slower rendering, slightly heavier on memory use due to all the svg elements)

  2. Add a click event handler to the chart itself and find the point within the series.

events: {
   click: function (e) {
      // get the clicked point by searching the KD-Tree
      var point = this.series[0].searchPoint(e);
   }
}

@ghost ghost closed this as completed Mar 31, 2015
@yplakosh
Copy link
Author

But why mouseOver works in this http://jsfiddle.net/Lwt7e9q1/ configuration and click does not?
Are they handled differently?

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant