git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2/program@782
a5681a0c-68f1-0310-ab6d-
d61299d08faa
Radoslaw Karas <rkaras with tyndall.ie>
Rainer Bawidamann <Rainer.Bawidamann with informatik.uni-ulm.de>
Roman Hoogant <rhoogant with ee.ethz.ch>
Radoslaw Karas <rkaras with tyndall.ie>
Rainer Bawidamann <Rainer.Bawidamann with informatik.uni-ulm.de>
Roman Hoogant <rhoogant with ee.ethz.ch>
+Ronan Mullally <ronan in 4L.ie>
Russ Wright <rwwright with home.com>
Sean Summers <sean with Fenstermaker.com> (RPM .spec)
Selena M Brewington <smbrewin with ichips.intel.com> add_ds
Russ Wright <rwwright with home.com>
Sean Summers <sean with Fenstermaker.com> (RPM .spec)
Selena M Brewington <smbrewin with ichips.intel.com> add_ds
should be set to 1024 so that one Kb is 1024 byte. For traffic
measurement, 1 kb/s is 1000 b/s.
should be set to 1024 so that one Kb is 1024 byte. For traffic
measurement, 1 kb/s is 1000 b/s.
+[B<-W>|B<--watermark> I<string>]
+
+Adds the given string as a watermark, horizontally centred, at the bottom
+of the graph.
+
=item Data and variables
B<DEF:>I<vname>B<=>I<rrdfile>B<:>I<ds-name>B<:>I<CF>[B<:step=>I<step>][B<:start=>I<time>][B<:end=>I<time>]
=item Data and variables
B<DEF:>I<vname>B<=>I<rrdfile>B<:>I<ds-name>B<:>I<CF>[B<:step=>I<step>][B<:start=>I<time>][B<:end=>I<time>]
5.5, im->tabwidth, 270,
GFX_H_RIGHT, GFX_V_TOP,
"RRDTOOL / TOBI OETIKER");
5.5, im->tabwidth, 270,
GFX_H_RIGHT, GFX_V_TOP,
"RRDTOOL / TOBI OETIKER");
+
+ /* graph watermark */
+ if(im->watermark[0] != '\0') {
+ gfx_new_text( im->canvas,
+ im->ximg/2, im->yimg-6,
+ ( im->graph_col[GRC_FONT] & 0xffffff00 ) | 0x00000044,
+ im->text_prop[TEXT_PROP_AXIS].font,
+ 5.5, im->tabwidth, 0,
+ GFX_H_CENTER, GFX_V_BOTTOM,
+ im->watermark);
+ }
/* graph labels */
if( !(im->extra_flags & NOLEGEND) & !(im->extra_flags & ONLY_GRAPH) ) {
/* graph labels */
if( !(im->extra_flags & NOLEGEND) & !(im->extra_flags & ONLY_GRAPH) ) {
** |v+--+-------------------------------+--------+
** | |..............legends......................|
** +-+-------------------------------------------+
** |v+--+-------------------------------+--------+
** | |..............legends......................|
** +-+-------------------------------------------+
+ ** | watermark |
+ ** +---------------------------------------------+
*/
int Xvertical=0,
Ytitle =0,
*/
int Xvertical=0,
Ytitle =0,
#if 0
Xlegend =0, Ylegend =0,
#endif
#if 0
Xlegend =0, Ylegend =0,
#endif
- Xspacing =15, Yspacing =15;
+ Xspacing =15, Yspacing =15,
+
+ Ywatermark =4;
if (im->extra_flags & ONLY_GRAPH) {
im->xorigin =0;
if (im->extra_flags & ONLY_GRAPH) {
im->xorigin =0;
xtr(im,0);
/* The vertical size is interesting... we need to compare
xtr(im,0);
/* The vertical size is interesting... we need to compare
- ** the sum of {Ytitle, Ymain, Yxlabel, Ylegend} with Yvertical
- ** however we need to know {Ytitle+Ymain+Yxlabel} in order to
- ** start even thinking about Ylegend.
+ ** the sum of {Ytitle, Ymain, Yxlabel, Ylegend, Ywatermark} with
+ ** Yvertical however we need to know {Ytitle+Ymain+Yxlabel}
+ ** in order to start even thinking about Ylegend or Ywatermark.
**
** Do it in three portions: First calculate the inner part,
**
** Do it in three portions: First calculate the inner part,
- ** then do the legend, then adjust the total height of the img.
+ ** then do the legend, then adjust the total height of the img,
+ ** adding space for a watermark if one exists;
*/
/* reserve space for main and/or pie */
*/
/* reserve space for main and/or pie */
*/
if(leg_place(im)==-1)
return -1;
*/
if(leg_place(im)==-1)
return -1;
+
+ if (im->watermark[0] != '\0') {
+ im->yimg += Ywatermark;
+ }
#if 0
if (Xlegend > im->ximg) {
#if 0
if (Xlegend > im->ximg) {
im->step = 0;
im->ylegend[0] = '\0';
im->title[0] = '\0';
im->step = 0;
im->ylegend[0] = '\0';
im->title[0] = '\0';
+ im->watermark[0] = '\0';
im->minval = DNAN;
im->maxval = DNAN;
im->unitsexponent= 9999;
im->minval = DNAN;
im->maxval = DNAN;
im->unitsexponent= 9999;
{"tabwidth", required_argument, 0, 'T'},
{"font-render-mode", required_argument, 0, 'R'},
{"font-smoothing-threshold", required_argument, 0, 'B'},
{"tabwidth", required_argument, 0, 'T'},
{"font-render-mode", required_argument, 0, 'R'},
{"font-smoothing-threshold", required_argument, 0, 'B'},
+ {"watermark", required_argument, 0, 'W'},
{"alt-y-mrtg", no_argument, 0, 1000}, /* this has no effect it is just here to save old apps from crashing when they use it */
{0,0,0,0}};
int option_index = 0;
{"alt-y-mrtg", no_argument, 0, 1000}, /* this has no effect it is just here to save old apps from crashing when they use it */
{0,0,0,0}};
int option_index = 0;
int col_start,col_end;
opt = getopt_long(argc, argv,
int col_start,col_end;
opt = getopt_long(argc, argv,
- "s:e:x:y:v:w:h:iu:l:rb:oc:n:m:t:f:a:I:zgjFYAMEX:L:S:T:NR:B:",
+ "s:e:x:y:v:w:h:iu:l:rb:oc:n:m:t:f:a:I:zgjFYAMEX:L:S:T:NR:B:W:",
long_options, &option_index);
if (opt == EOF)
long_options, &option_index);
if (opt == EOF)
im->canvas->font_aa_threshold = atof(optarg);
break;
im->canvas->font_aa_threshold = atof(optarg);
break;
+ case 'W':
+ strncpy(im->watermark,optarg,100);
+ im->watermark[99]='\0';
+ break;
+
case '?':
if (optopt != 0)
rrd_set_error("unknown option '%c'", optopt);
case '?':
if (optopt != 0)
rrd_set_error("unknown option '%c'", optopt);
text_prop_t text_prop[TEXT_PROP_LAST]; /* text properties */
char ylegend[200]; /* legend along the yaxis */
char title[200]; /* title for graph */
text_prop_t text_prop[TEXT_PROP_LAST]; /* text properties */
char ylegend[200]; /* legend along the yaxis */
char title[200]; /* title for graph */
+ char watermark[100]; /* watermark for graph */
int draw_x_grid; /* no x-grid at all */
int draw_y_grid; /* no x-grid at all */
double grid_dash_on, grid_dash_off;
int draw_x_grid; /* no x-grid at all */
int draw_y_grid; /* no x-grid at all */
double grid_dash_on, grid_dash_off;
"\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[-f|--imginfo printfstr]\n"
"\t\t[-a|--imgformat PNG]\n"
"\t\t[-c|--color COLORTAG#rrggbb[aa]] [-t|--title string]\n"
- "\t\t[DEF:vname=rrd:ds-name:CF]\n"
- "\t\t[CDEF:vname=rpn-expression]\n";
+ "\t\t[-W|--watermark string]\n"
+ "\t\t[DEF:vname=rrd:ds-name:CF]\n";
+ "\t\t[CDEF:vname=rpn-expression]\n"
"\t\t[VDEF:vdefname=rpn-expression]\n"
"\t\t[PRINT:vdefname:format]\n"
"\t\t[GPRINT:vdefname:format]\n"
"\t\t[VDEF:vdefname=rpn-expression]\n"
"\t\t[PRINT:vdefname:format]\n"
"\t\t[GPRINT:vdefname:format]\n"