<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="GENERATOR" content="GtkHTML/4.8.5">
</head>
<body>
Hi Martin,<br>
<br>
I think you can get some ideas of the following.<br>
<br>
I can't test it - so I just took some code that I had in a completely different graph.<br>
But I think the idea is to create different CDEF's according to the temperature intervals.<br>
Then set the color according to this.<br>
<br>
Good luck!<br>
/Johan<br>
<br>
<br>
<pre>
rrdtool graph ping_${host}_hour.png -h 300 -w 700 -a PNG \
--imginfo '<IMG SRC=/%s WIDTH=%lu HEIGHT=%lu >' \
--start -28800 --end -60  \
-v "Round-Trip Time (ms)" \
--rigid \
--lower-limit 0 \
--title "Ping statistics: $host" \
DEF:rtt=${host}_rtt.rrd:ds0:AVERAGE \
DEF:rtt_min=${host}_rtt_min.rrd:ds0:MIN \
DEF:rtt_max=${host}_rtt_max.rrd:ds0:MAX \
DEF:ploss=${host}_packet_loss.rrd:ds0:AVERAGE \
CDEF:rtt_diff=rtt_max,rtt_min,- \
CDEF:PLNone=ploss,0,0,LIMIT,UN,UNKN,INF,IF \
CDEF:PL10=ploss,1,10,LIMIT,UN,UNKN,INF,IF \
CDEF:PL25=ploss,10,25,LIMIT,UN,UNKN,INF,IF \
CDEF:PL50=ploss,25,50,LIMIT,UN,UNKN,INF,IF \
CDEF:PL75=ploss,50,75,LIMIT,UN,UNKN,INF,IF \
CDEF:PL100=ploss,75,100,LIMIT,UN,UNKN,INF,IF \
COMMENT:"(Packet Loss Percentage)" \
AREA:PLNone#FFFFFF:"0%": \
AREA:PL10#FFFF00:"0-10%": \
AREA:PL25#CCEE00:"10-25%": \
AREA:PL50#BBB000:"25-50%": \
AREA:PL75#FFD000:"50-75%": \
AREA:PL100#FF0000:"75-100%": \
COMMENT:"\n" \
LINE1:rtt_min#3030ff \
AREA:rtt_diff#a0a0ff::STACK \
LINE1:rtt_max#3030ff \
LINE1:rtt_min#3030ff \
LINE2:rtt#0000ff:${host} \
GPRINT:rtt:LAST:"Cur\: %5.2lf" \
GPRINT:rtt:AVERAGE:"Avg\: %5.2lf" \
GPRINT:rtt:MAX:"Max\: %5.2lf" \
GPRINT:rtt:MIN:"Min\: %5.2lf\n"
</pre>
<br>
<br>
<br>
<br>
On Wed, 2015-09-09 at 16:34 +0200, Martin wrote:
<blockquote type="CITE">
<pre>
Hello all,

I´m wondering if anyone has a code example for showing diffrent colors 
in a graph depending on temperatue like this, if it above +0 and up the 
color is red and if its below -0 its blue ?

cheers //M

_______________________________________________
rrd-users mailing list
<a href="mailto:rrd-users@lists.oetiker.ch">rrd-users@lists.oetiker.ch</a>
<a href="https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users">https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users</a>
</pre>
</blockquote>
</body>
</html>