Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

highcharts panning

I'm trying to implement highcharts panning based on this example: http://jsfiddle.net/HXUmK/5/

But I want to be able to zoom with the left mouse button and pan with the right mouse button. So I modified the code above and managed to make it work a little, but when I pan holding the right mouse button, the charts also zoomes.

Is there a way I can disable right mouse button zooming in highcharts?

Edit: Sorry for not being very clear about it. The code in the jsfiddle is not my code. Forget that code, it's just an example form witch I started. I am trying to modify that code in order to get left button zoom and right button pan. So I disabled the mousewheel zoom and activated the standars highcharts zoom

Edit2: Here is my code: http://jsfiddle.net/TKPQN/

like image 347
Boos Avatar asked Apr 20 '12 11:04

Boos


1 Answers

You can try with selection event:

chart: {
        ...
        events:{
            selection: function(event) {
                if (lastButton == 1)
                    event.preventDefault();
            }
       }
    }

See http://jsfiddle.net/TKPQN/48/

like image 148
Luca Avatar answered Nov 16 '22 12:11

Luca