ChartDirector [problem]

ChartDirector [problem]

am 14.10.2005 18:33:09 von Le_T

Hello all

I'm currently developping a cgi script which use ChartDirector, and I
have a HUGE problem with drawing...

Diagram displays correctly, but bars doesn't stop, and continue til the
top of the image zone.
Here is following my code:

main script :

use strict;
use warnings;
use CGI;
use CGI::Pretty;
use CGI::Carp qw(fatalsToBrowser);

#...
#all values are defined and are numeric

open(NUCDAT,">nucl.chartdata");
my $longueur = $a+$t+$g+$c;
print( NUCDAT $a." ".$c." ".$t." ".$g." ".$longueur);
close(NUCDAT);

print "\n\n";

#...
#there is no problem with the acces rights to file

diagram drawing script :

use File::Basename;
use lib dirname($0);

use perlchartdir;

my $ligne, $a, $t, $g, $c, $longueur;

open(NUCDAT," while( defined( $ligne = ) ) {
chomp($ligne);
($a, $t, $g, $c, $longueur) = split(/ /,$ligne);

}

my $pcc = abs($c/$longueur);
my $pct = abs($t/$longueur);
my $pcg = abs($g/$longueur);
my $pca = abs($a/$longueur);

my $labels = ["A", "T", "G", "C"];
my $ylabels = [0, 25, 50, 75, 100];
my @data = [\$pca ,\$pct ,\$pcg ,\$pcc ];

my $c = new XYChart(150, 150);

$c->setPlotArea(30, 20, 100, 100);

$c->addBarLayer(@data);

$c->xAxis()->setLabels($labels);
$c->yAxis()->setLabels($ylabels);

binmode(STDOUT);
print "Content-type: image/png\n\n";
print $c->makeChart2($perlchartdir::PNG);

Does someone knows how to help me?

Le_T

(PS : my config : FireFox 1.0.7, EasyPHP 1.7, Perl 5.8.7 Builder
813)