#!/usr/bin/perl -w

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

RRDs::graph "./example3.png",
    "--title=user_avgrac_credit",
    "--start=-5d",
    "DEF:user_avgrac_credit=www.primegrid.com.rrd:avgrac:LAST",
    #mnożymy wartości przez 3600 aby uzyskać przyrosty "na godzinę" a nie domyślne "na sekundę"
    "CDEF:user_avgrac_credit2=user_avgrac_credit,3600,*",
    "AREA:user_avgrac_credit2#0066FF:Last",
    "GPRINT:user_avgrac_credit2:LAST:%lf%s\\n";
if ( my $err = RRDs::error ) { print $err }
exit;
