summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f99f5a6)
raw | patch | inline | side by side (parent: f99f5a6)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Mon, 25 Jan 2010 22:25:14 +0000 (22:25 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Mon, 25 Jan 2010 22:25:14 +0000 (22:25 +0000) |
doc/rrdgraph_graph.pod | patch | blob | history | |
src/rrd_graph.c | patch | blob | history |
diff --git a/doc/rrdgraph_graph.pod b/doc/rrdgraph_graph.pod
index 44efce727217047038ed03fd6682236832bd60e8..c740aad38c26e05816bbc44711add5af7f7042ca 100644 (file)
--- a/doc/rrdgraph_graph.pod
+++ b/doc/rrdgraph_graph.pod
A special case is COMMENT:B<\s> which inserts some additional vertical space
before placing the next row of legends.
-If you are using the proportional font in your graph, you can use tab
-characters or the sequence B<\t> to line-up legend elements. Note that
+If you want to have left and right aligned legends on the same line use COMMENT:B<\u>
+to go one line back like this:
+
+ COMMENT:left\l
+ COMMENT:\u
+ COMMENT:right\r
+
+When using a proportional font in your graph, the tab
+characters or the sequence B<\t> will line-up legend elements. Note that
the tabs inserted are relative to the start of the current legend
element!
diff --git a/src/rrd_graph.c b/src/rrd_graph.c
index 24b58d08bf48b9b8264789aa340aeb382a1c8bc9..a93fbb1c52708ca3d047630eb587434c6ac29a00 100644 (file)
--- a/src/rrd_graph.c
+++ b/src/rrd_graph.c
prt_fctn != 'r' &&
prt_fctn != 'j' &&
prt_fctn != 'c' &&
+ prt_fctn != 'u' &&
prt_fctn != 's' && prt_fctn != '\0' && prt_fctn != 'g') {
free(legspace);
rrd_set_error
leg_y += im->text_prop[TEXT_PROP_LEGEND].size * 1.8;
if (prt_fctn == 's')
leg_y -= im->text_prop[TEXT_PROP_LEGEND].size;
+ if (prt_fctn == 'u')
+ leg_y -= im->text_prop[TEXT_PROP_LEGEND].size *1.8;
if(calc_width && (fill > legendwidth)){
legendwidth = fill;