Outlined Area Graphs
How to build the graph
The graph is made up of stacked AREAs with stacked LINEs on top. The stacked AREAs are simple enough, however there is a problem when stacking the LINEs. The problem occurs when a data point at the bottom or the middle of the stack is zero, RRDTool won't draw an AREA for a zero value but will draw a LINE. A bit of RPN magic is needed here to convert the zeros to UNKNs and you need to stack the LINEs manually instead.
Suppose you have 4 data points called DP1, DP2, DP3 and DP4. You need to create a CDEF for each one to draw the LINE. The first one goes like this:
CDEF:Ln1=DP1,DP1,UNKN,IF
Subsequent CDEFs also need to add the previous values to manually stack the lines. Like this:
CDEF:Ln2=DP2,DP1,DP2,+,UNKN,IF CDEF:Ln3=DP3,DP1,DP2,DP3,+,+,UNKN,IF CDEF:Ln4=DP4,DP1,DP2,DP3,DP4,+,+,+,UNKN,IF
All you need to do then is draw the AREAs:
AREA:Ar1#EA644A AREA:Ar2#EC9D48::STACK AREA:Ar3#ECD748::STACK AREA:Ar4#54EC48::STACK
Then overlay the LINEs with matching darker colours. Remember not to stack these because you've already done this by adding the values in the CDEFs:
LINE1:Ln1#CC3118 LINE1:Ln2#CC7016 LINE1:Ln3#C9B215 LINE1:Ln4#24BC14
What colours to use
Here is a table of 'pleasing' colours. Simply use the LIGHT colours for the areas and the DARK colours for the overlay lines:
LIGHT | DARK | |
RED | #EA644A | #CC3118 |
ORANGE | #EC9D48 | #CC7016 |
YELLOW | #ECD748 | #C9B215 |
GREEN | #54EC48 | #24BC14 |
BLUE | #48C4EC | #1598C3 |
PINK | #DE48EC | #B415C7 |
PURPLE | #7648EC | #4D18E4 |
Example of what you can achieve
http://oss.oetiker.ch/rrdtool/gallery/btdmd8.png
B.Golden