Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Settings pie-chart color's in GD::Image::pie?

Status
Not open for further replies.

youradds

Programmer
Jun 27, 2001
817
0
0
GB
Hi,

I've written some perl code to make a pie chart in GD::Image::pie:

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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top