From 74343867dc0c425d34a2f069f5b8c4dff32bc2ff Mon Sep 17 00:00:00 2001 From: oetiker Date: Sat, 8 Mar 2003 18:44:06 +0000 Subject: [PATCH] don't display legends for [HV]RULEs out of graph bounds (rrdgraph) -- Christophe Kalt git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk@190 a5681a0c-68f1-0310-ab6d-d61299d08faa --- program/src/rrd_graph.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/program/src/rrd_graph.c b/program/src/rrd_graph.c index 451e8914..715f0dc7 100644 --- a/program/src/rrd_graph.c +++ b/program/src/rrd_graph.c @@ -1358,6 +1358,16 @@ leg_place(image_desc_t *im) for(i=0;igdes_c;i++){ fill_last = fill; + + /* hid legends for rules which are not displayed */ + + if (im->gdes[i].gf == GF_HRULE && + (im->gdes[i].yrule < im->minval || im->gdes[i].yrule > im->maxval)) + im->gdes[i].legend[0] = '\0'; + + if (im->gdes[i].gf == GF_VRULE && + (im->gdes[i].xrule < im->start || im->gdes[i].xrule > im->end)) + im->gdes[i].legend[0] = '\0'; leg_cc = strlen(im->gdes[i].legend); -- 2.30.2