From: oetiker Date: Tue, 1 May 2007 20:40:15 +0000 (+0000) Subject: if the graph goes 'down' minval must be hanged instead X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=7b87bd32ffe294dc4fd3ba4f65be49d7290311ee;p=rrdtool.git if the graph goes 'down' minval must be hanged instead git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2/program@1041 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/src/rrd_graph.c b/src/rrd_graph.c index e16e5d8..7e607bb 100644 --- a/src/rrd_graph.c +++ b/src/rrd_graph.c @@ -497,7 +497,10 @@ apply_gridfit(image_desc_t *im) 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);