From b9c6359c225c68252f808a4d0eb897baadde68d2 Mon Sep 17 00:00:00 2001 From: soenter Date: Sat, 11 Jan 2014 08:59:54 +0800 Subject: [PATCH 1/2] Improve the performance of large data processing --- examples/selection/index.html | 14 ++++++++------ examples/visitors/index.html | 14 ++++++++------ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/examples/selection/index.html b/examples/selection/index.html index 27f3367..88cc313 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..182f6aa 100644 --- a/examples/visitors/index.html +++ b/examples/visitors/index.html @@ -93,12 +93,14 @@ // 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 From 38f7a8c58d30e6be733e67bd538f4ab0f4ae5df8 Mon Sep 17 00:00:00 2001 From: soenter Date: Sun, 9 Feb 2014 08:23:35 +0800 Subject: [PATCH 2/2] Improve the performance of large data processing(fix spaces -> tabs) --- examples/selection/index.html | 14 +++++++------- examples/visitors/index.html | 9 ++++----- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/examples/selection/index.html b/examples/selection/index.html index 88cc313..6dbf2db 100644 --- a/examples/selection/index.html +++ b/examples/selection/index.html @@ -68,13 +68,13 @@ if (zoom) { $.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(); + 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 182f6aa..614c3ec 100644 --- a/examples/visitors/index.html +++ b/examples/visitors/index.html @@ -92,12 +92,11 @@ $("#placeholder").bind("plotselected", function (event, ranges) { // do the zooming - $.each(plot.getXAxes(), function(_, axis) { - var opts = axis.options; - opts.min = ranges.xaxis.from; - opts.max = ranges.xaxis.to; - }); + var opts = axis.options; + opts.min = ranges.xaxis.from; + opts.max = ranges.xaxis.to; + }); plot.setupGrid(); plot.draw(); plot.clearSelection();