[rrd-users] Re: rrdcgi dynamic size of images

Alex van den Bogaerdt alex at ergens.op.het.net
Sun Apr 17 10:40:27 MEST 2005

On Sat, Apr 16, 2005 at 02:13:57PM +0200, Stefan Bachmaier wrote:
> Hello, i use a self scripted rrdcgi for use on my servers, it looks like
> this:
> <P><RRD::GRAPH /var/www/intern/system-rrd/memory_<RRD::CV RRD_TIME>.png
>           --imginfo '<IMG SRC=/system-rrd/%s WIDTH=%lu HEIGHT=%lu >'
>           -a PNG
>           -w 1000 -h 230
>           -s -1<RRD::CV RRD_TIME>
>           -t "Memory/Swap"
>           ....
> It would be nice to get the size of the browser window (frame) and put it
> in the -w parameter, so the generated image on the page doesn't produce a
> horizontal scrollbar (and is the same size of the frame, as big as
> possible). The parser of the file is rrdcgi and so javascript won't work,
> because the image is processed on the server.

So you need to use server side scripting, such as PHP, combined with
client side scripting, such as javascript.  Get the window size in
javascript. Then use this knowledge to fetch another page where you
specify this size, for instance encoded in the URL or maybe you use
a form for this.

Also, the -w parameter doesn't specify the width of the whole image
but rather the width of the canvas, the part where the actual graph
is being made, not the axis, vertical label and such.


Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://lists.ee.ethz.ch/rrd-users
WebAdmin    http://lists.ee.ethz.ch/lsg2.cgi

More information about the rrd-users mailing list