Hi,
I've written some perl code to make a pie chart in GD::Image:ie:
The problem is, how do I set my own custom colors? The ones that are being chosen at the moment don't go with the site design, so I want to change them to some "softer" ones.
I see something about GD::Image::color, but can't work out how to invoke it, and pass in these new colors :/
TIA
Andy
I've written some perl code to make a pie chart in GD::Image:ie:
Code:
my @data = (
['#1 Rating','#2 Rating','#3 Rating','#4 Rating','#5 Rating'],
[ $ratings->{1},$ratings->{2},$ratings->{3},$ratings->{4},$ratings->{5}],
);
my $graph = new GD::Graph::pie($PCFG->{ChartWidth}, $PCFG->{ChartHeight});
$graph->set(
title => 'Review Ratings',
label => '',
axislabelclr => 'black',
'3d' => 1,
start_angle => 30,
suppress_angle => 3,
)
or warn $graph->error;
$graph->set_title_font("$CFG->{admin_root_path}/tahoma.ttf", 15);
$graph->set_value_font("$CFG->{admin_root_path}/tahoma.ttf",$PCFG->{FontSize});
$graph->set_label_font("$CFG->{admin_root_path}/tahoma.ttf",14);
$graph->plot(\@data) or die $graph->error;
The problem is, how do I set my own custom colors? The ones that are being chosen at the moment don't go with the site design, so I want to change them to some "softer" ones.
I see something about GD::Image::color, but can't work out how to invoke it, and pass in these new colors :/
TIA
Andy