JackTheRussel
Programmer
Hi,
I have program which draw picture where are min, max and avg bars.
I have tried everything, but I can't set different colours to different bars.
Here is the program
Here I try to set different colours to different bars
But it set all bars to gold-color.
And if I change order like this:
It set all bars to blue.
So what I have to do that I can set all tree bars into different colours ?
I have program which draw picture where are min, max and avg bars.
I have tried everything, but I can't set different colours to different bars.
Here is the program
Code:
#!/usr/bin/perl
use GD::Graph::bars3d;
my $graph = new GD::Graph::bars3d( 400, 300 );
my @data = (
["Min", "Max", "Avg"],
[ 2, 10, 5]
);
$graph->set(
x_label => 'x_label title',
y_label => 'y_label title',
title => 'Head title',
dclrs => [ qw(gold blue green) ],
);
my $gd = $graph->plot( \@data );
open(IMG, '>picture.png') or die $!;
binmode IMG;
print IMG $gd->png;
Here I try to set different colours to different bars
Code:
dclrs => [ qw(gold blue green) ],
But it set all bars to gold-color.
And if I change order like this:
Code:
dclrs => [ qw(blue gold green) ],
It set all bars to blue.
So what I have to do that I can set all tree bars into different colours ?