summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7f4dd5f)
raw | patch | inline | side by side (parent: 7f4dd5f)
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) |
git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2/program@1041 a5681a0c-68f1-0310-ab6d-d61299d08faa
src/rrd_graph.c | patch | blob | history |
diff --git a/src/rrd_graph.c b/src/rrd_graph.c
index e16e5d84ba60110a3c4070cbe9f6fa87a2735897..7e607bba0de00104b909c97b3760f2f74a51838b 100644 (file)
--- a/src/rrd_graph.c
+++ b/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);