diff --git a/API.txt b/API.txt index bbb920b..5496e9f 100644 --- a/API.txt +++ b/API.txt @@ -168,7 +168,6 @@ Customizing the axes min: null or number max: null or number autoscaleMargin: null or number - autoscaleSkipPointsOutside: boolean labelWidth: null or number labelHeight: null or number @@ -195,12 +194,6 @@ specified, the plot will furthermore extend the axis end-point to the nearest whole tick. The default value is "null" for the x axis and 0.02 for the y axis which seems appropriate for most cases. -If you set a range on an axis with min/max and then set -"autoscaleSkipPointsOutside" to true, the autoscale algorithm will -skip points that are outside this range when computing the scale for -the other axis. Otherwise all points input to Flot are always -considered. - "labelWidth" and "labelHeight" specifies the maximum size of the tick labels in pixels. They're useful in case you need to align several plots. diff --git a/NEWS.txt b/NEWS.txt index 4450aaf..4465413 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -6,9 +6,6 @@ Changes: - Added support for disabling interactivity for specific data series (request from Ronald Schouten and Steve Upton). -- Added support for having the autoscale algorithm skip points outside - an axis range (autoscaleSkipPointsOutside on an axis). - - Flot now calls $() on the placeholder and optional legend container passed in so you can specify DOM elements or CSS expressions to make it easier to use Flot with libraries like Prototype or Mootools. diff --git a/examples/visitors.html b/examples/visitors.html index 919f903..4eddea9 100644 --- a/examples/visitors.html +++ b/examples/visitors.html @@ -60,7 +60,7 @@ $(function () { lines: { show: true, lineWidth: 1 }, shadowSize: 0, xaxis: { ticks: [], mode: "time" }, - yaxis: { ticks: [], min: 0, max: 4000 }, + yaxis: { ticks: [], min: 0, autoscaleMargin: 0.1 }, selection: { mode: "x" } }); diff --git a/jquery.flot.js b/jquery.flot.js index 251634f..80c63c2 100644 --- a/jquery.flot.js +++ b/jquery.flot.js @@ -31,7 +31,6 @@ min: null, // min. value to show, null means set automatically max: null, // max. value to show, null means set automatically autoscaleMargin: null, // margin in % to add if auto-setting min/max - autoscaleSkipPointsOutside: null, ticks: null, // either [1, 3] or [[1, "a"], 3] or (fn: axis info -> ticks) or app. number of ticks for auto-ticks tickFormatter: null, // fn: number -> string labelWidth: null, // size of tick labels in pixels @@ -275,7 +274,6 @@ axes[axis].datamax = bottomSentry; axes[axis].min = options[axis].min; axes[axis].max = options[axis].max; - axes[axis].skipoutside = options[axis].autoscaleSkipPointsOutside; axes[axis].used = false; } @@ -285,13 +283,14 @@ axisy = series[i].yaxis, mindelta = 0, maxdelta = 0; - // make sure we got room for the bar if (series[i].bars.show) { + // make sure we got room for the bar mindelta = series[i].bars.align == "left" ? 0 : -series[i].bars.barWidth/2; maxdelta = mindelta + series[i].bars.barWidth; } axisx.used = axisy.used = true; + for (var j = 0; j < data.length; ++j) { if (data[j] == null) continue; @@ -300,12 +299,6 @@ // convert to number if (x != null && !isNaN(x = +x)) { - if (axisx.skipoutside && - ((axisx.min != null && x + mindelta < axisx.min) || - (axisx.max != null && x + maxdelta > axisx.max))) { - continue; - } - if (x + mindelta < axisx.datamin) axisx.datamin = x + mindelta; if (x + maxdelta > axisx.datamax) @@ -313,11 +306,6 @@ } if (y != null && !isNaN(y = +y)) { - if (axisy.skipoutside && - ((axisy.min != null && y < axisy.min) || - (axisy.max != null && y > axisy.max))) - continue; - if (y < axisy.datamin) axisy.datamin = y; if (y > axisy.datamax)