[rrd-users] Re: [rrd-developers] Image clipping/stacking wanted in 1.1.x (Was: "Re:

Jakob Ilves jakob.ilves at oracle.com
Mon Mar 5 22:58:50 MET 2001


Alex van den Bogaerdt wrote:

> Jakob Ilves wrote:
> >
> > I would like rrdtool 1.1.x to support that images generated consists of partial
> > graphs.  A partial graph could be a graphic consisting solely of a timescale
> > X-axis.  Another partial graph could be just the graphed curves and areas
> > themselves (with X- and Y-axis graphics, paddings, legends etc. clipped away ).
> I think you present a solution to a problem here.  Maybe there is more
> than one solution so please present the problem only, not the solution.

Well, my intent was to present a solution to several problems and provided just one
problem it would solve.  Other uses for this enhanced control over what get's included
or not into the image is that an RRD image might be split into several images which
then might be either reassembled on a Web page using HTML tables or fed into other
image processing machinery.

In my opinion, the feature is a pretty basic one and if at least considered once 1.1.0
is created, it's easier to implement it in later 1.1.x releases.

> > If someone using rrdtool 1.0.x as of today and tries to get a "minimal" image,
> > the following is the result:
> >
> >[snip picture]
> >
> > As we see here, 1.0.x rrdtool makes the padding on all sides as well as the Y and
> > X axis mandatory.  The image cannot be generated without them.  (Not obvious from
> > my "image" is the fact that also the beveled frame around the image as well as
> > the right most logo also are included in all images).
> This is a problem.  This should (IMHO) be solved but it can be solved
> by other means than you suggest.
> > A user should be able to control what is included in the generated image.  For
> > example, if a X-axis and a graph with curves is all that is needed, then the user
> > should be able to specify just those two components on the command line or in the
> > Perl interface.
> Sounds resonable.  However:
> - you can already leave out the title
> - you can already leave out the vertical label
> - you can already leave out the x-axis
> - you can already leave out the y-axis
> - it makes no sense to leave out the canvas (where the graph is)

In my prototype app (which I cannot share with you :-( ) I use images consisting of
solely the X-axis (tiled under canvas images using HTML tables) so the canvas isn't
necessary for creating a meaning ful image.

> This leaves you with some whitespace that could (and IMHO should) be
> removed, and with a copyright notice that shouldn't be easy to remove.

Well, I understand why it would be desirable to keep the copyright notice but in
certain circumstances, it would be impractical.  Howerver, in my prototype hack, I
included the option of getting nothing but the copyright notice as a separate image
(implementing that option was just mandatory for me :-).

> When the excess whitespace is removed, I think you have what you need?

Well, not really.  Images containing only the Y-axis would not be possible to create.
Well, as I see it, if we make it possible to cut out the canvas, or cut out the X-axis,
or cut out them together etc. I strongly believe it would make the code SIMPLER if it
was made generic and allowed the user to just pick whatever parts of the image was

I know all this can be done with rrdtool 1.0.x if bolting on something similar to
ImageMagick but building ImageMagick seem to be non-trivial to say the least and also,
it has some performance hits (memory and CPU-wise) compared to get the clipping done by
rrdtool's graph generator.

> As a side note: I do think we need a way to specify the width and height
> of the total graph, not just the canvas.
> > But to make these things even hairier, I would like rrdtool to support multiple
> > graphs to be created and stacked on top of each other.  For example, what about
> > several graphs with a X-axis at the bottom?  Below is an example of three graphs
> > with an X-axis.
> >
> > +----------------------------+
> > | Graph with curves          |
> > | and areas.                 |
> > +----------------------------+
> > | Graph with curves          |
> > | and areas.                 |
> > +----------------------------+
> > | Graph with curves          |
> > | and areas.                 |
> > +----------------------------+
> >        X-axis
> Interesting.  How should the user interface look?  Read the bottom
> paragraphs first before you answer this as it might be sufficient.

The user interface, especially if multiple tiled graphs are considered for one single
image, is definitively an open topic.  I still vote for some kind of script language.

> > The graphs I have in mind are "threshold graphs".  A threshold graph isn't like
> > the normal graphs which take a 400x150 area and draw one or more curves/areas on
> > the graph.  The threshold graph has normal width, but is much lower, perhaps 10
> > pixels so it forms a "bar".  The bar's graphics show wether or not a certain
> > threshold condition has been met.  The graph might be green for points in time
> > when the value is below a certain threshold and it might be red for values
> > violating the threshold.  (You might also consider multiple colors and levels)
> If all unnecessary whitespace is eliminated, this can be done with RRDtool.
> Use --height 10, use AREA with a CDEF returning 0 or 10, use --x-axis none.
> When there is no whitespace to display, you can just stack the graphs on top
> as you suggested and have in fact what you asked for.

This is more or less what I used when creating the bars.  I used two AREAs, one green
and one red.  However, as I did use a normal --x-axis, that means there was a X-axis
grid visible in the bars.  It wasn't much of a grid, but it was there and made the bar
graph more readable.

> Another approach (bit of a workaround though) is to use the negative side
> of the y-axis.

Here I quite don't follow you.  Probably because the clock is too late and I've had too
little coffe...

> cheers,
> Alex

Best regards


                (Jakob Ilves) <jakob.ilves at oracle.com>
             {Oracle Global IT, Network Management Group}
[Office as well as mobile phone: +46/8/477 3666 | Fax: +46/8/477 3572]
         - Intranet Home Page: http://jilves.se.oracle.com -

-- Attached file removed by Listar and put at URL below --
-- Type: text/x-vcard
-- Desc: Card for Jakob Ilves
-- Size: 444 bytes
-- URL : http://www.ee.ethz.ch/~slist/pantomime/29-jakob.ilves.vcf

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://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi

More information about the rrd-users mailing list