Open jensaug opened 8 years ago
This is something that would actually be very useful. How does one tackle this?
Just an idea: why not using mousedown event on the container? Something like this: http://jsfiddle.net/4ktf1t6t/
In jQuery:
$('#container').on('mousedown', function () {
console.log(chart);
});
I've done that but there is no straightforward way to limit the events to the chart area. How do I get the chart area without going to deep in the highcharts layout?
Oh, so you want event on plotting area not chart object? There is internal method chart.isInsidePlot(x, y)
which would be helpful, snippet which should help:
var chartEvent = chart.pointer.normalize(event, chart.pointer.chartPosition),
isInsidePlot = chart.isInsidePlot(
chartEvent.chartX - chart.plotLeft,
chartEvent.chartY - chart.plotTop
);
This is def an enhancement request
Would it be possible to allow CustomEvents also on Chart object? I'd like to catch a mousedown event when zooming is initiated (mousedown on chart - so I can hide tooltip).
If I've understood this plugin correctly I cannot achieve this by adding mousedown event to any of the supported objects?
Thanks for a great plugin! Jens