X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Frrd_graph.c;h=5a54c3dfe9d0dc13134e948dd4b78b891808944f;hb=4414926d4c2ab02e84ffe1d55d26b27632cb18aa;hp=d785331f21df4c0115c1a725802f041b4a6b71e8;hpb=3882bb0c2d15f97298aaa7602d6353a1888f5547;p=rrdtool.git diff --git a/src/rrd_graph.c b/src/rrd_graph.c index d785331..5a54c3d 100644 --- a/src/rrd_graph.c +++ b/src/rrd_graph.c @@ -1,5 +1,5 @@ /**************************************************************************** - * RRDtool 1.2.16 Copyright by Tobi Oetiker, 1997-2006 + * RRDtool 1.2.19 Copyright by Tobi Oetiker, 1997-2007 **************************************************************************** * rrd__graph.c produce graphs from data in rrdfiles ****************************************************************************/ @@ -1448,9 +1448,11 @@ leg_place(image_desc_t *im) } /* only valid control codes */ if (prt_fctn != 'l' && + prt_fctn != 'n' && /* a synonym for l */ prt_fctn != 'r' && prt_fctn != 'j' && prt_fctn != 'c' && + prt_fctn != 's' && prt_fctn != 't' && prt_fctn != '\0' && prt_fctn != 'g' ) { @@ -1459,7 +1461,12 @@ leg_place(image_desc_t *im) return -1; } + /* remove exess space */ + if ( prt_fctn == 'n' ){ + prt_fctn='l'; + } + while (prt_fctn=='g' && leg_cc > 0 && im->gdes[i].legend[leg_cc-1]==' '){ @@ -2417,7 +2424,7 @@ graph_size_location(image_desc_t *im, int elements if (im->draw_x_grid) { Yxlabel=im->text_prop[TEXT_PROP_AXIS].size *2.5; } - if (im->draw_y_grid) { + if (im->draw_y_grid || im->forceleftspace ) { Xylabel=gfx_get_text_width(im->canvas, 0, im->text_prop[TEXT_PROP_AXIS].font, im->text_prop[TEXT_PROP_AXIS].size, @@ -3108,6 +3115,7 @@ rrd_graph_init(image_desc_t *im) im->maxval = DNAN; im->unitsexponent= 9999; im->unitslength= 6; + im->forceleftspace = 0; im->symbol = ' '; im->viewfactor = 1.0; im->extra_flags= 0; @@ -3277,6 +3285,7 @@ rrd_graph_options(int argc, char *argv[],image_desc_t *im) break; case 'L': im->unitslength = atoi(optarg); + im->forceleftspace = 1; break; case 'T': im->tabwidth = atof(optarg);