Commit 72ad98a3 authored by olau@iola.dk's avatar olau@iola.dk

Fixed corner-case bug with axis-autoadjustment for flat datasets

git-svn-id: https://flot.googlecode.com/svn/trunk@97 1e0a6537-2640-0410-bfb7-f154510ff394
parent 45f0757d
......@@ -2,7 +2,9 @@ Flot 0.x
--------
Fixed two corner-case bugs when drawing filled curves (report and
analysis by Joshua Varner).
analysis by Joshua Varner). Fix auto-adjustment code when setting min
to 0 for an axis where the dataset is completely flat on that axis
(report by chovy).
Flot 0.5
......
......@@ -375,14 +375,14 @@
if (max - min == 0.0) {
// degenerate case
var widen;
if (max == 0.0)
widen = 1.0;
else
widen = 0.01;
var widen = max == 0 ? 1 : 0.01;
min -= widen;
max += widen;
if (axisOptions.min == null)
min -= widen;
// alway widen max if we couldn't widen min to ensure we
// don't fall into min == max which doesn't work
if (axisOptions.max == null || axisOptions.min != null)
max += widen;
}
else {
// consider autoscaling
......
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