fix calculation for rrd graphs