Soma Holiday
Soma Holiday

Reputation: 185

Highcharts: Drag Point Over Another Point Invokes Click Event

I have two series of points on a Highcharts scatter plot. One of the series is draggable. The other has a click event:

events: {
  click: function(e) {
    if (e.point.v != 0) {
      if (e.point.options.p != 0) {
        location.href = 'newPage.php?pID=' + e.point.options.p;
      }
    }
  }
},

When I drag a point from the first series and leave it (mouse-up) over a point from the second series, the click event fires and the page is redirected.

I don't want that click event to occur when dragging a point over it.

Upvotes: 0

Views: 164

Answers (1)

Rahul Sharma
Rahul Sharma

Reputation: 912

You can try using the custom events plugin for this, so that for the second series the event is 'mousedown' and not click. That should solve the problem.

plotOptions: {
      series: {
            point: {
                events: {
                    mousedown: function () {
                        alert(this.y);
                    }
                }
            }
      }
}

A working example.

NOTE: You need to be running the latest version of Highcharts for this to work, which 3.0.7

Upvotes: 0

Related Questions