Hi, The attached patch allows to $ rrdtool graph --border=0
to disable the 3d border around the image. PS: It would be nice if you could sort the getopt options alphabetically..... :-/ TIA && cheers,
Index: src/rrd_tool.c =================================================================== --- src/rrd_tool.c (revision 1896) +++ src/rrd_tool.c (working copy) @@ -154,7 +154,9 @@ "\t\t[-S|--step seconds]\n" "\t\t[-f|--imginfo printfstr]\n" "\t\t[-a|--imgformat PNG]\n" - "\t\t[-c|--color COLORTAG#rrggbb[aa]] [-t|--title string]\n" + "\t\t[-c|--color COLORTAG#rrggbb[aa]]\n" + "\t\t[-d|--border width\n" + "\t\t[-t|--title string]\n" "\t\t[-W|--watermark string]\n" "\t\t[DEF:vname=rrd:ds-name:CF]\n"); const char *help_graph3 = Index: src/rrd_graph.c =================================================================== --- src/rrd_graph.c (revision 1896) +++ src/rrd_graph.c (working copy) @@ -2548,20 +2548,23 @@ double X0, Y0; /* points for filled graph and more */ struct gfx_color_t water_color; - /* draw 3d border */ - gfx_new_area(im, 0, im->yimg, - 2, im->yimg - 2, 2, 2, im->graph_col[GRC_SHADEA]); - gfx_add_point(im, im->ximg - 2, 2); - gfx_add_point(im, im->ximg, 0); - gfx_add_point(im, 0, 0); - gfx_close_path(im); - gfx_new_area(im, 2, im->yimg - 2, - im->ximg - 2, - im->yimg - 2, im->ximg - 2, 2, im->graph_col[GRC_SHADEB]); - gfx_add_point(im, im->ximg, 0); - gfx_add_point(im, im->ximg, im->yimg); - gfx_add_point(im, 0, im->yimg); - gfx_close_path(im); + if (im->draw_3d_border > 0) { + /* draw 3d border */ + i = im->draw_3d_border; + gfx_new_area(im, 0, im->yimg, + i, im->yimg - i, i, i, im->graph_col[GRC_SHADEA]); + gfx_add_point(im, im->ximg - i, i); + gfx_add_point(im, im->ximg, 0); + gfx_add_point(im, 0, 0); + gfx_close_path(im); + gfx_new_area(im, i, im->yimg - i, + im->ximg - i, + im->yimg - i, im->ximg - i, i, im->graph_col[GRC_SHADEB]); + gfx_add_point(im, im->ximg, 0); + gfx_add_point(im, im->ximg, im->yimg); + gfx_add_point(im, 0, im->yimg); + gfx_close_path(im); + } if (im->draw_x_grid == 1) vertical_grid(im); if (im->draw_y_grid == 1) { @@ -2647,6 +2650,7 @@ } /* graph labels */ +/* didn't look closely, nor think.. but did you mean ') && !(' below? */ if (!(im->extra_flags & NOLEGEND) & !(im->extra_flags & ONLY_GRAPH)) { for (i = 0; i < im->gdes_c; i++) { if (im->gdes[i].legend[0] == '\0') @@ -3812,6 +3816,7 @@ im->base = 1000; im->draw_x_grid = 1; im->draw_y_grid = 1; + im->draw_3d_border = 2; im->extra_flags = 0; im->font_options = cairo_font_options_create(); im->forceleftspace = 0; @@ -3933,6 +3938,7 @@ { "base", required_argument, 0, 'b'}, { "logarithmic", no_argument, 0, 'o'}, { "color", required_argument, 0, 'c'}, + { "border", required_argument, 0, 'd'}, { "font", required_argument, 0, 'n'}, { "title", required_argument, 0, 't'}, { "imginfo", required_argument, 0, 'f'}, @@ -3978,7 +3984,7 @@ int col_start, col_end; opt = getopt_long(argc, argv, - "s:e:x:y:v:w:h:D:iu:l:rb:oc:n:m:t:f:a:I:zgjFYAMEX:L:S:T:NR:B:W:kP", + "s:e:x:y:v:w:h:D:iu:l:rb:oc:n:m:t:f:a:I:zgjFYAMEX:L:S:T:NR:B:W:kPd:", long_options, &option_index); if (opt == EOF) break; @@ -4118,6 +4124,9 @@ return; } break; + case 'd': + im->draw_3d_border = atoi(optarg); + break; case 1002: /* right y axis */ if(sscanf(optarg, Index: src/rrd_graph.h =================================================================== --- src/rrd_graph.h (revision 1896) +++ src/rrd_graph.h (working copy) @@ -204,7 +204,8 @@ char title[210]; /* title for graph */ char watermark[110]; /* watermark for graph */ int draw_x_grid; /* no x-grid at all */ - int draw_y_grid; /* no x-grid at all */ + int draw_y_grid; /* no y-grid at all */ + unsigned int draw_3d_border; /* size of border in pixels, 0 for off */ double grid_dash_on, grid_dash_off; xlab_t xlab_user; /* user defined labeling for xaxis */ char xlab_form[210]; /* format for the label on the xaxis */ Index: doc/rrdgraph.pod =================================================================== --- doc/rrdgraph.pod (revision 1896) +++ doc/rrdgraph.pod (working copy) @@ -313,6 +313,12 @@ A green arrow is made by: C<--color ARROW#00FF00> +[B<-d>|B<--border> I<width>]] + +Width in pixels for the 3d border drawn around the image. Default 2, 0 +disables the border. See C<SHADEA> and C<SHADEB> above for setting the border +color. + [B<--zoom> I<factor>] Zoom the graphics by the given amount. The factor must be E<gt> 0
_______________________________________________ rrd-developers mailing list rrd-developers@lists.oetiker.ch https://lists.oetiker.ch/cgi-bin/listinfo/rrd-developers