tags:

views:

161

answers:

1

How to disable panning in Jquery flot when there is no further data ?

I am currently using plot.pan({ left: -100 }); and plot.pan({ left: 100 }); on left arrow click and right arrow click.

A: 

I've handeled panning limitation by setting the panRange option every time the plot's data values change. This way you don't need any other changes, the navigation plugin will do the rest.

plot.getOptions().xaxis.panRange =
  [plot.getAxes().xaxis.datamin, plot.getAxes().xaxis.datamax];
plot.getOptions().yaxis.panRange =
  [plot.getAxes().yaxis.datamin, plot.getAxes().yaxis.datamax];
Jawa