[rrd-users] line1 with dashes in a perl cgi script

Audio Phile da_audiophile at yahoo.com
Sun Sep 7 18:02:40 CEST 2008


I'm using version 1.32 of rrdtool via a perl cgi script.  I can do everyting EXCEPT generate graphs containing dashed lines.  It is due to my poorly formed syntax I believe in the cgi perl script.  I placed a # in front of the troublesome line.  Can someone show me the right syntax?

Thanks!

sub graph_temperature_history($$$)
{
        my $range = shift;
        my $file = shift;
        my $title = shift;
        my $step = $range*$points_per_sample/$xpoints;

        my ($graphret,$xs,$ys) = RRDs::graph($file,
                '--imgformat', 'PNG',
                '--width', $xpoints,
                '--height', $ypoints,
                '--start', "-$range",
                "--title= Current and Historical Temps in $city",
                '--vertical-label', 'Temperature (°F)',
                '--units-exponent', 0,
                '--lazy',
                '-Y',
                "DEF:real_c=$db_real:real:AVERAGE",
                "DEF:rech_c=$db_record_hig:rech:AVERAGE",
                "DEF:recl_c=$db_record_low:recl:AVERAGE",
                "DEF:aveh_c=$db_average_hi:aveh:AVERAGE",
                "DEF:avel_c=$db_average_lo:avel:AVERAGE",
#                'LINE1:rech_c#FF0000:"dashed line":dashes',
                 'GPRINT:rech_c:LAST: %5.2lf °F\\n',
                'LINE1:aveh_c#CC0000:Average High Temp',
                'GPRINT:aveh_c:LAST: %5.2lf °F\\n',
                'LINE1:avel_c#3366FF:Average Low Temp ',
                'GPRINT:avel_c:LAST: %5.2lf °F\\n',
                'LINE1:recl_c#0000CC:Record Low Temp  ',
                'GPRINT:recl_c:LAST: %5.2lf °F\\n',
                'LINE2:real_c#888888:Current Temp',
                'GPRINT:real_c:MIN:Min\\: %5.2lf °F',
                'GPRINT:real_c:MAX:Max\\: %5.2lf °F',
                'GPRINT:real_c:AVERAGE:Ave\\: %5.2lf °F',
                'GPRINT:real_c:LAST:Curr\\: %5.2lf °F\\j',
                "COMMENT: \\n",
                "COMMENT:RRDWeather $VERSION - $date",
        );


      



More information about the rrd-users mailing list