add 'u' to backup one line for special legend placement tricks
authoroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Mon, 25 Jan 2010 22:25:14 +0000 (22:25 +0000)
committeroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Mon, 25 Jan 2010 22:25:14 +0000 (22:25 +0000)
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@2012 a5681a0c-68f1-0310-ab6d-d61299d08faa

doc/rrdgraph_graph.pod
src/rrd_graph.c

index 44efce7..c740aad 100644 (file)
@@ -365,8 +365,15 @@ in connection with B<%s> to suppress empty unit strings.
 A special case is COMMENT:B<\s> which inserts some additional vertical space
 before placing the next row of legends.
 
 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!
 
 the tabs inserted are relative to the start of the current legend
 element!
 
index 24b58d0..a93fbb1 100644 (file)
@@ -1730,6 +1730,7 @@ int leg_place(
                 prt_fctn != 'r' &&
                 prt_fctn != 'j' &&
                 prt_fctn != '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
                 prt_fctn != 's' && prt_fctn != '\0' && prt_fctn != 'g') {
                 free(legspace);
                 rrd_set_error
@@ -1839,6 +1840,8 @@ int leg_place(
                     leg_y += im->text_prop[TEXT_PROP_LEGEND].size * 1.8;
                 if (prt_fctn == 's')
                     leg_y -= im->text_prop[TEXT_PROP_LEGEND].size;
                     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;
 
                 if(calc_width && (fill > legendwidth)){
                     legendwidth = fill;