diff --git a/examples/selection/index.html b/examples/selection/index.html
index 27f3367..6dbf2db 100644
--- a/examples/selection/index.html
+++ b/examples/selection/index.html
@@ -67,12 +67,14 @@
var zoom = $("#zoom").attr("checked");
if (zoom) {
- plot = $.plot(placeholder, data, $.extend(true, {}, options, {
- xaxis: {
- min: ranges.xaxis.from,
- max: ranges.xaxis.to
- }
- }));
+ $.each(plot.getXAxes(), function(_, axis) {
+ var opts = axis.options;
+ opts.min = ranges.xaxis.from;
+ opts.max = ranges.xaxis.to;
+ });
+ plot.setupGrid();
+ plot.draw();
+ plot.clearSelection();
}
});
diff --git a/examples/visitors/index.html b/examples/visitors/index.html
index 8fc9a26..614c3ec 100644
--- a/examples/visitors/index.html
+++ b/examples/visitors/index.html
@@ -92,13 +92,14 @@
$("#placeholder").bind("plotselected", function (event, ranges) {
// do the zooming
-
- plot = $.plot("#placeholder", [d], $.extend(true, {}, options, {
- xaxis: {
- min: ranges.xaxis.from,
- max: ranges.xaxis.to
- }
- }));
+ $.each(plot.getXAxes(), function(_, axis) {
+ var opts = axis.options;
+ opts.min = ranges.xaxis.from;
+ opts.max = ranges.xaxis.to;
+ });
+ plot.setupGrid();
+ plot.draw();
+ plot.clearSelection();
// don't fire event on the overview to prevent eternal loop