Search

Recent Posts

Tags


« | Main | »

RRDTool Graphs – refining Color Temperature Gradients

By Dale Reagan | May 28, 2012

So, what happens when you have a ‘hole’ in your RRD data source upon which you base a color gradient?

 

RRD Graph - gaps in data - attic-temps-Zone-Y
RRD Graph – gaps in data – attic-temps-Zone-Y

 

The first version of this graph used a gradient peak that was two points above the peak – but the holes were still there…

RRD Graph - gaps in data - attic-temps-Zone-Y-a

RRD Graph - gaps in data - attic-temps-Zone-Y-a

The preceding graphs were created by basing the gradient on one of the RRA’s in the RRD set being used to create the graph.  The next graph uses a separate RRD/RRA combo.

RRD Graph - NO gaps in data - attic-temps-Zone-Y-b

RRD Graph - NO gaps in data - attic-temps-Zone-Y-b

By referencing an external, reliable RRD, missing data is avoided in the gradient.

 

Another solution is to use a bit of RPN magic (a little math in the CDEFs.)

This is a partial example that uses 8 RRDs and a Reference RRD to manage the gradient;  a CDEF range is created based on the Reference RRD; an AREA is established using the specified RGB color to match the temperature range.

 "DEF:rrd8=${RRD8}:${RRD8_DS_NAME}:AVERAGE" \
"DEF:rrdmax=${REF_RRD}:${REF_DS}:MAX" \
    "CDEF:max_temp=rrdmax,INF,*" \
        "CDEF:temp190=max_temp,190,LT,max_temp,190,IF" "CDEF:temp190NoUnk=max_temp,UN,0,temp190,IF" "AREA:temp190NoUnk#FF0EF0" \
        "CDEF:temp188=max_temp,188,LT,max_temp,188,IF" "CDEF:temp188NoUnk=max_temp,UN,0,temp188,IF" "AREA:temp188NoUnk#FF0DF0" \
...

 

GR_DEF=”CDEF:max_temp=rrdmax,${GRADIENT_FUDGE},+” ## partial gradient
GR_DEF=”CDEF:max_temp=rrdmax,INF,*”               ## full gradient

RRDTool Temperature Gradient - Zone X - Roof.

RRDTool Temperature Gradient - Zone X - Roof.

 

Near Real-time Gradient Temperature Graphs

'Half' Gradient generated using RRDTool

'Half' Gradient generated using RRDTool

As part of my attic temperature project I am generating daily graphs using RRDTool with a 36 hour window (the page may be updated several times an hour, and yes, sometimes some of the charts will contain ‘data holes’…) Three versions of each graph are created – providing a simple eye-ball review for which type of presentation may best convey the information; I’m partial to the ‘half’ gradient for most charts:

  1. no gradient
  2. half gradient
  3. full gradients

Of course, your gradients will vary… 🙂

Topics: 1-Wire, Computer Technology, Web Problem Solving, Web Technologies | Comments Off on RRDTool Graphs – refining Color Temperature Gradients

Comments are closed.


________________________________________________
YOUR GeoIP Data | Ip: 73.21.121.1
Continent: NA | Country Code: US | Country Name: United States
Region: | State/Region Name: | City:
(US only) Area Code: 0 | Postal code/Zip:
Latitude: 38.000000 | Longitude: -97.000000
Note - if using a mobile device your physical location may NOT be accurate...
________________________________________________

Georgia-USA.Com - Web Hosting for Business
____________________________________