summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6d026df)
raw | patch | inline | side by side (parent: 6d026df)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Tue, 1 May 2007 16:19:47 +0000 (16:19 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Tue, 1 May 2007 16:19:47 +0000 (16:19 +0000) |
program/doc/rrdgraph.pod | patch | blob | history | |
program/src/rrd_graph.c | patch | blob | history | |
program/src/rrd_graph.h | patch | blob | history |
index 59d3ac4ad65910b62e2519ae6abecacc451d0c87..9060bd831b97d695edbe6d1ac3392bd79174ee4d 100644 (file)
--- a/program/doc/rrdgraph.pod
+++ b/program/doc/rrdgraph.pod
would display slightly less than C<260-0.001> to slightly more than
C<260+0.001> (this feature was contributed by Sasha Mikheev).
+[B<-J>|B<--alt-autoscale-min>]
+
+Where C<--alt-autoscale> will modify both the absolute maximum AND minimum
+values, this option will only affect the minimum value. The maximum
+value, if not defined on the command line, will be 0. This option can
+be useful when graphing router traffic when the WAN line uses compression,
+and thus the throughput may be higher than the WAN line speed.
+
[B<-M>|B<--alt-autoscale-max>]
Where C<--alt-autoscale> will modify both the absolute maximum AND minimum
index 47c187ad981db4c6ec19046dd95a5639f6220d1c..e7554ac632b80648cfe3e728a74dbf1379dd4f57 100644 (file)
--- a/program/src/rrd_graph.c
+++ b/program/src/rrd_graph.c
im->minval -= adj;
im->maxval += adj;
}
+ else if(im->extra_flags & ALTAUTOSCALE_MIN) {
+ /* measure the amplitude of the function. Make sure that
+ graph boundaries are slightly lower than min vals
+ so we can see amplitude on the graph */
+ adj = (im->maxval - im->minval) * 0.1;
+ im->minval -= adj;
+ }
else if(im->extra_flags & ALTAUTOSCALE_MAX) {
/* measure the amplitude of the function. Make sure that
graph boundaries are slightly higher than max vals
{"no-minor", no_argument, 0, 'I'},
{"slope-mode", no_argument, 0, 'E'},
{"alt-autoscale", no_argument, 0, 'A'},
+ {"alt-autoscale-min", no_argument, 0, 'J'},
{"alt-autoscale-max", no_argument, 0, 'M'},
{"no-gridfit", no_argument, 0, 'N'},
{"units-exponent",required_argument, 0, 'X'},
break;
case 'A':
im->extra_flags |= ALTAUTOSCALE;
+ break;
+ case 'J':
+ im->extra_flags |= ALTAUTOSCALE_MIN;
break;
case 'M':
im->extra_flags |= ALTAUTOSCALE_MAX;
index e970d8b25ed08708b3cc162b80a1aeefd5c4f02a..e83b442aab6e0d6bb71ac1574ec858f5bd10359b 100644 (file)
--- a/program/src/rrd_graph.h
+++ b/program/src/rrd_graph.h
#define ALTYGRID 0x01 /* use alternative y grid algorithm */
#define ALTAUTOSCALE 0x02 /* use alternative algorithm to find lower and upper bounds */
-#define ALTAUTOSCALE_MAX 0x04 /* use alternative algorithm to find upper bounds */
-#define NOLEGEND 0x08 /* use no legend */
-#define NOMINOR 0x10 /* Turn off minor gridlines */
-#define ONLY_GRAPH 0x20 /* use only graph */
-#define FORCE_RULES_LEGEND 0x40 /* force printing of HRULE and VRULE legend */
+#define ALTAUTOSCALE_MIN 0x04 /* use alternative algorithm to find lower bounds */
+#define ALTAUTOSCALE_MAX 0x08 /* use alternative algorithm to find upper bounds */
+#define NOLEGEND 0x10 /* use no legend */
+#define NOMINOR 0x20 /* Turn off minor gridlines */
+#define ONLY_GRAPH 0x40 /* use only graph */
+#define FORCE_RULES_LEGEND 0x80 /* force printing of HRULE and VRULE legend */
-#define FORCE_UNITS 0x80 /* mask for all FORCE_UNITS_* flags */
-#define FORCE_UNITS_SI 0x80 /* force use of SI units in Y axis (no effect in linear graph, SI instead of E in log graph) */
+#define FORCE_UNITS 0x100 /* mask for all FORCE_UNITS_* flags */
+#define FORCE_UNITS_SI 0x100 /* force use of SI units in Y axis (no effect in linear graph, SI instead of E in log graph) */
enum tmt_en {TMT_SECOND=0,TMT_MINUTE,TMT_HOUR,TMT_DAY,
TMT_WEEK,TMT_MONTH,TMT_YEAR};