use GD; use GD::Graph::linespoints; use GD::Graph::bars3d; @colors = ('red', 'green', 'blue', 'gold', 'magenta'); @colorvals = ([255,0,0], [0,204,0],[0,0,255],[255,204,0],[255,0,255]); . . . $linechart = GD::Graph::linespoints->new(640, 640) or die "no chart!\n"; $linechart->set( # dclrs => [@colors], line_width => 3, x_label => 'Domain of ' . uc($fdat{domain}) . 's', y_label => 'Mean Value in ' . $ulong, title => "Test: '" . $fdat{testn} . "' Compared by " . uc($fdat{compare}), x_labels_vertical => 1) or die $linechart->error; $linechart->set_x_axis_font(gdSmallFont); $linechart->set_y_axis_font(gdSmallFont); $gd = $linechart->plot(\@gdata) or die $linechart->error; . . . $legend = new GD::Image($gdwidth,$gdheight); $legend->transparent($legend->colorAllocate(255,255,255)); $legend->rectangle(0,0,$gdwidth-1,$gdheight-1,$legend->colorAllocate(0,0,0)); for ($cn=0;$cn<@comps;$cn++) { . . . $thiscolor = $legend->colorAllocate($colorvals[$cn][0],$colorvals[$cn][1],$colorvals[$cn][2]); $legend->string(gdSmallFont,2,5+($cn*18),$rowdata,$thiscolor); }