#!/usr/bin/perl -w

use strict;
use lib qw( /usr/local/rrdtool-1.2.26/lib/perl );
use RRDs;

RRDs::graph "./example6.png",
    "--title=user_total_credit",
    "--start=-720d",
    "--width=720",
    "--lower-limit=0",
    "DEF:user_total0=www.primegrid.com.rrd:total:LAST",
    "DEF:user_total1=milkyway.cs.rpi.edu_milkyway.rrd:total:LAST",
    "AREA:user_total0#0066FF:PrimeGrid:STACK",
    "AREA:user_total1#FF0000:MilkyWay\@home:STACK",
    "CDEF:total=user_total0,user_total1,+",# tutaj liczymy sumę dwóch parametrów
    "GPRINT:total:LAST:TOTAL %.2lf";# a tutaj umieszczamy na wykresie
if ( my $err = RRDs::error ) { print $err }
exit;
