summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ee05ed1)
raw | patch | inline | side by side (parent: ee05ed1)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Mon, 25 Oct 2004 22:22:53 +0000 (22:22 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Mon, 25 Oct 2004 22:22:53 +0000 (22:22 +0000) |
doc/rrdgraph.src | patch | blob | history | |
src/rrd_graph.c | patch | blob | history | |
src/rrd_graph.h | patch | blob | history |
diff --git a/doc/rrdgraph.src b/doc/rrdgraph.src
index ae3f8a68bd962f0ee767735cba481babe676ac5a..df7a836a00498f03afabfeb9eec74ce62e36df56 100644 (file)
--- a/doc/rrdgraph.src
+++ b/doc/rrdgraph.src
Suppress generation of legend; only render the graph.
+B<[-F|--force-rules-legend]>
+
+Force the generation of HRULE and VRULE legend even if those HRULE or VRULE will not be drawn because out of graph boundaries (mimics behaviour of pre 1.0.42 versions).
+
B<[-b|--base E<lt>valueE<gt>]>
If you are graphing memory (and NOT network traffic) this switch
diff --git a/src/rrd_graph.c b/src/rrd_graph.c
index d22c85350a2750d36455411afa08b74308975f6c..85984b3e46adcf0d63615256387636ea2d567a6a 100644 (file)
--- a/src/rrd_graph.c
+++ b/src/rrd_graph.c
/* 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';
+ if(!(im->extra_flags & FORCE_RULES_LEGEND)) {
+ 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);
{"lazy", no_argument, 0, 'z'},
{"zoom", required_argument, 0, 'm'},
{"no-legend", no_argument, 0, 'g'},
+ {"force-rules-legend",no_argument,0, 'F'},
{"only-graph", no_argument, 0, 'j'},
{"alt-y-grid", no_argument, 0, 'Y'},
{"no-minor", no_argument, 0, 'I'},
opt = getopt_long(argc, argv,
- "s:e:x:y:v:w:h:iu:l:rb:oc:n:m:t:f:a:I:zgjYAMX:S:N",
+ "s:e:x:y:v:w:h:iu:l:rb:oc:n:m:t:f:a:I:zgjFYAMX:S:N",
long_options, &option_index);
if (opt == EOF)
case 'g':
im->extra_flags |= NOLEGEND;
break;
+ case 'F':
+ im->extra_flags |= FORCE_RULES_LEGEND;
+ break;
case 'X':
im->unitsexponent = atoi(optarg);
break;
diff --git a/src/rrd_graph.h b/src/rrd_graph.h
index 7cf2a6ea888d5615d1e393a2566ab633085c71a4..181474cbd217a41009e23920e003f3e32cd5f6cb 100644 (file)
--- a/src/rrd_graph.h
+++ b/src/rrd_graph.h
#define NOLEGEND 0x08 /* use no legend */
#define NOMINOR 0x20 /* Turn off minor gridlines */
#define ONLY_GRAPH 0x24 /* use only graph */
+#define FORCE_RULES_LEGEND 0x40 /* force printing of HRULE and VRULE legend */
enum tmt_en {TMT_SECOND=0,TMT_MINUTE,TMT_HOUR,TMT_DAY,