Okay, now I am stumbling into the next problem. The navigate plugin does not work for me any longer. I just can't get it to pan. This time I tried both the distribution version and including the complete source files, but it did not make any difference. I'll attach the source code of a mini-example below. Any idea of what I am doing wrong?
Also, I noticed that in the online example the panRanges are still specified, but the plugin no longer seems to support them (which is a bad move ... without a method to limit the panning, the plugin is pretty useless for many cases).
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Mini-flot</title>
<script language="javascript" type="text/javascript" src="jquery.js"></script>
<script language="javascript" type="text/javascript" src="jquery.flot.js"></script>
<script type='text/javascript'>
$('document').ready( function() {
var data = [[ [1, 3], [2, 14.01], [3.5, 3.14] ], [[1,1], [2, 2], [3, 3]]];
var options = {
legend: {position: "nw"},
xaxis: {
show: true,
plotPan: true,
axisPan: false,
min: 0,
max: 5,
//panRange: [-10, 10]
},
yaxis: {
show: true,
plotPan: true,
axisPan: false,
min: -5,
max: 15,
//panRange: [-10, 20]
},
series: {
lines: {
show: true,
lineWidth: 1
}
},
pan: {
interactive: true,
mode: 'manual',
cursor: 'move',
frameRate: 20
}
};
var plot = $.plot('#placeholder', data, options);
plot.setupGrid();
plot.draw();
$('#placeholder').bind("plotpan", function (event, plot) {
var axes = plot.getAxes();
$("div#message").text("Panning to x: " + axes.xaxis.min.toFixed(2)
+ " – " + axes.xaxis.max.toFixed(2)
+ " and y: " + axes.yaxis.min.toFixed(2)
+ " – " + axes.yaxis.max.toFixed(2));
});
});
</script>
</head>
<body>
<div id='placeholder' style='width: 500px; height: 300px;'></div>
<div id='message'></div>
</body>