[rrd-developers] patch to do vertical gradients

Rian Shelley rians at cc.usu.edu
Fri Nov 6 15:49:28 CET 2009

On Fri, Nov 6, 2009 at 7:20 AM, Mark Mills <extremely at hostile.org> wrote:
> If it was used to carry information, one that might help would be scale
> differences. I have had issues in the past where my boss at the time
> freaked out when a graph spiked and we had to point out that the one he
> was looking at had spiked from bits to kbits... not from mbits to gbits.
> ;-) A way to color the scale in the area (logarithmically?) would help
> when scanning graphs quickly. It wouldn't give the same cool fire effect
> but "ripples" in the area paint could effectively replace the need for
> grid lines.

Thats one of the reasons I wrote it. A negative height would be
aligned to the x axis, so that increasing values on the line change to
the next color, ie a gradient from green to red. Of course, to be
really useful, I would need to change it so that the height was
relative to the data set, and not given in pixels. I'll have to see
how to do that. gfx_area_fit maybe?

> I'd also recommend that the default second color be set to the graph
> background color with the transparency set to 0x20 and not be forced to
> #000000. Might as well make it do something cool by default no matter
> what color scheme they use.

Maybe. I figured it didn't matter much what the color was if the alpha
was zero. That way it always appeared to fade into whatever is behind
it, be it the background or another AREA. I'll have to play with it
and see what it looks like.

> Also, I'm jealous of Rian because I've been wanting to write this patch
> for like 5-6 years and never had the time. ;-) It looks even better than
> I hoped. I'm looking forward to this being in the main build.

All the heavy lifting is done by cairo :D. All I did was allow the
source pattern to be a gradient as well as a solid color. I think the
other option is to make the source pattern another image.


More information about the rrd-developers mailing list