From c20f3bfc89a81e291b6374b6f414a1a4cac0a2e6 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/program@190 a5681a0c-68f1-0310-ab6d-d61299d08faa --- src/rrd_graph.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/rrd_graph.c b/src/rrd_graph.c index 451e891..715f0dc 100644 --- a/src/rrd_graph.c +++ b/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.11.0