summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8d46034)
raw | patch | inline | side by side (parent: 8d46034)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Wed, 19 Aug 2009 15:24:11 +0000 (15:24 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Wed, 19 Aug 2009 15:24:11 +0000 (15:24 +0000) |
$ rrdtool graph --border=0
to disable the 3d border around the image. -- Bernhard Reutner-Fischer rep.dot.nop gmail.com
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@1898 a5681a0c-68f1-0310-ab6d-d61299d08faa
to disable the 3d border around the image. -- Bernhard Reutner-Fischer rep.dot.nop gmail.com
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@1898 a5681a0c-68f1-0310-ab6d-d61299d08faa
NEWS | patch | blob | history | |
doc/rrdgraph.pod | patch | blob | history | |
src/rrd_graph.c | patch | blob | history | |
src/rrd_graph.h | patch | blob | history | |
src/rrd_tool.c | patch | blob | history |
index ba0d8ad92f80748318b839b08190a286fdcc454c..d5a4ad2e60c5c5a49b091ddec9e10a33ec49f268 100644 (file)
--- a/NEWS
+++ b/NEWS
* allow the HW smoothing window size to be set to 0 with rrdtool tune
by sylvain luiset
+* new graph option --border to set the 3d border width
+ by Bernhard Reutner-Fischer
+
+
for more detail see the CHANGES file.
diff --git a/doc/rrdgraph.pod b/doc/rrdgraph.pod
index 57359ac66972b176f1f253067e8711a376030f22..dc8081f2b131e637ac4bd615a40ebc3ff49b31dc 100644 (file)
--- a/doc/rrdgraph.pod
+++ b/doc/rrdgraph.pod
A green arrow is made by: C<--color ARROW#00FF00>
+[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
diff --git a/src/rrd_graph.c b/src/rrd_graph.c
index 323fec6dcfc1ba3d0d79c455961915e8f16e9ba0..002137fa00334af0a90980bb1d3fb530509e94f5 100644 (file)
--- a/src/rrd_graph.c
+++ b/src/rrd_graph.c
}
- if (!(im->extra_flags & NOLEGEND) & !(im->extra_flags & ONLY_GRAPH)) {
+ if (!(im->extra_flags & NOLEGEND) && !(im->extra_flags & ONLY_GRAPH)) {
if ((legspace = (int*)malloc(im->gdes_c * sizeof(int))) == NULL) {
rrd_set_error("malloc for legspace");
return -1;
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) {
}
/* graph labels */
- if (!(im->extra_flags & NOLEGEND) & !(im->extra_flags & ONLY_GRAPH)) {
+/* 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')
continue;
im->daemon_addr = NULL;
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;
{ "base", required_argument, 0, 'b'},
{ "logarithmic", no_argument, 0, 'o'},
{ "color", required_argument, 0, 'c'},
+ { "border", required_argument, 0, 1007},
{ "font", required_argument, 0, 'n'},
{ "title", required_argument, 0, 't'},
{ "imginfo", required_argument, 0, 'f'},
return;
}
break;
+ case 1007:
+ im->draw_3d_border = atoi(optarg);
+ break;
case 1002: /* right y axis */
if(sscanf(optarg,
diff --git a/src/rrd_graph.h b/src/rrd_graph.h
index 0593d4a931207c1351c3d235c121d160c99a298c..d3de4cf05fc6e215e10312adf2e3d9a555f7e3d7 100644 (file)
--- a/src/rrd_graph.h
+++ b/src/rrd_graph.h
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 */
diff --git a/src/rrd_tool.c b/src/rrd_tool.c
index 8f233268f3fe46d5cb5b1387f5868d81cc6af829..1f7e6b09d07675553030af700ece8920801453ce 100644 (file)
--- a/src/rrd_tool.c
+++ b/src/rrd_tool.c
"\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 =