summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ab8aff2)
raw | patch | inline | side by side (parent: ab8aff2)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Tue, 1 May 2007 20:40:15 +0000 (20:40 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Tue, 1 May 2007 20:40:15 +0000 (20:40 +0000) |
program/src/rrd_graph.c | patch | blob | history |
index e16e5d84ba60110a3c4070cbe9f6fa87a2735897..7e607bba0de00104b909c97b3760f2f74a51838b 100644 (file)
--- a/program/src/rrd_graph.c
+++ b/program/src/rrd_graph.c
double new_range = factor * (im->maxval - im->minval);
double gridstep = im->ygrid_scale.gridstep;
double minor_y, minor_y_px, minor_y_px_frac;
- im->maxval = im->minval + new_range;
+ if (im->maxval > 0.0)
+ im->maxval = im->minval + new_range;
+ else
+ im->minval = im->maxval - new_range;
ytr(im,DNAN); /* reset precalc */
/* make sure first minor gridline is on integer pixel y coord */
minor_y = gridstep * floor(im->minval / gridstep);