Weekly, Monthly and Yearly totals from rrd4j

I now have rrd4j working as I want generating daily graphs from my end of day item totals. The graphs now look correct, storing only one GAUGE with a single MAX value for the day. I know I can read past values from rrd4j, but does anyone have a rule example that totals all the daily values for a range?