X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Frrd_graph.c;h=d7ff2b003b3e4e4546a82a043f122c6098fc6f6d;hb=676ee5fcdd443a42045ccda0025a652ce5ecdd72;hp=97ede52125f738ee89113359d846267dbade1f06;hpb=593389115650121241900a7a4240b32ae75c436e;p=rrdtool.git diff --git a/src/rrd_graph.c b/src/rrd_graph.c index 97ede52..d7ff2b0 100644 --- a/src/rrd_graph.c +++ b/src/rrd_graph.c @@ -1,5 +1,5 @@ /**************************************************************************** - * RRDtool 1.2rc8 Copyright by Tobi Oetiker, 1997-2005 + * RRDtool 1.2.0 Copyright by Tobi Oetiker, 1997-2005 **************************************************************************** * rrd__graph.c produce graphs from data in rrdfiles ****************************************************************************/ @@ -2118,7 +2118,7 @@ graph_size_location(image_desc_t *im, int elements ** +-+-------------------------------------------+ */ int Xvertical=0, Yvertical=0, - Xtitle =0, Ytitle =0, + Ytitle =0, Xylabel =0, Xmain =0, Ymain =0, #ifdef WITH_PIECHART @@ -2152,11 +2152,12 @@ graph_size_location(image_desc_t *im, int elements ** automatically has some vertical spacing. The horizontal ** spacing is added here, on each side. */ - Xtitle = gfx_get_text_width(im->canvas, 0, + /* don't care for the with of the title + Xtitle = gfx_get_text_width(im->canvas, 0, im->text_prop[TEXT_PROP_TITLE].font, im->text_prop[TEXT_PROP_TITLE].size, im->tabwidth, - im->title, 0) + 2*Xspacing; + im->title, 0) + 2*Xspacing; */ Ytitle = im->text_prop[TEXT_PROP_TITLE].size*2.5; } @@ -2207,7 +2208,8 @@ graph_size_location(image_desc_t *im, int elements im->xorigin = Xspacing + Xylabel; - if (Xtitle > im->ximg) im->ximg = Xtitle; + /* the length of the title should not influence with width of the graph + if (Xtitle > im->ximg) im->ximg = Xtitle; */ if (Xvertical) { /* unit description */ im->ximg += Xvertical; @@ -2673,7 +2675,6 @@ int rrd_graph(int argc, char **argv, char ***prdata, int *xsize, int *ysize, FILE *stream, double *ymin, double *ymax) { image_desc_t im; - rrd_graph_init(&im); im.graphhandle = stream; @@ -2797,7 +2798,8 @@ rrd_graph_init(image_desc_t *im) if (windir != NULL) { strncpy(rrd_win_default_font,windir,999); rrd_win_default_font[999] = '\0'; - strcat(rrd_win_default_font,"\\fonts\\cour.ttf"); + strcat(rrd_win_default_font,"\\fonts\\"); + strcat(rrd_win_default_font,RRD_DEFAULT_FONT); for(i=0;i