Reputation: 2674
Let's have a simple spline chart created using Highcharts library. Each point on the spline serie is selectable, once you set plotOptions.spline.allowPointSelect: true
. For each point you can then define plotOptions.spline.point.events.(un)select: fn(e) {...}
events.
Let's define both select and unselect events, select one point by clicking on it, and then unselect it by selecting a different one. The thing is, that select
event on new point fires before unselect
event on the old point. I would prefer that event unselect
of the old point would fire before select
event on the new point.
Any ideas how to achieve that?
Upvotes: 0
Views: 4137
Reputation: 45079
You can simply compare actual point to be unselected with array of actually selected points. For example: http://jsfiddle.net/2Wr8v/1/
unselect: function(event) {
var p = this.series.chart.getSelectedPoints();
if(p.length > 0 && p[0].x == this.x) {
$('#label').text('point unselected');
}
}
Upvotes: 3