From: oetiker Date: Fri, 26 Dec 2003 16:54:55 +0000 (+0000) Subject: using --riggid it is possible to get a case where minval is bigger than maxval .... X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=0873fc86cb3d4286e2bde9c0a458e7d2f8624e8d;p=rrdtool.git using --riggid it is possible to get a case where minval is bigger than maxval ... this breaks the horizontal grid ... git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@229 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/src/rrd_graph.c b/src/rrd_graph.c index c60717f..afcbc01 100644 --- a/src/rrd_graph.c +++ b/src/rrd_graph.c @@ -1072,6 +1072,11 @@ data_proc( image_desc_t *im ){ else im->maxval = maxval; } + /* make sure min is smaller than max */ + if (im->minval > im->maxval) { + im->minval = 0.99 * im->maxval; + } + /* make sure min and max are not equal */ if (im->minval == im->maxval) { im->maxval *= 1.01;