Commit edbec959 authored by olau@iola.dk's avatar olau@iola.dk

Pulled the autoscaleSkipPointsOutside option, it's causing trouble in edge...

Pulled the autoscaleSkipPointsOutside option, it's causing trouble in edge cases and it's probably easier to fix by preprocessing the data

git-svn-id: https://flot.googlecode.com/svn/trunk@123 1e0a6537-2640-0410-bfb7-f154510ff394
parent 55bc8c09
......@@ -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.
......
......@@ -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.
......
......@@ -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" }
});
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment