sanku has asked for the wisdom of the Perl Monks concerning the following question:

hi monks, i am using GD modules in my program, i was able to set the colors of the bars in the graph,but i am not able to set the background color of bar chart image and also the x-axis label orientation as vertical direction. this is the code which i am trying with,
$width=$xaxiss[0]; $height=$xaxiss[$#xaxiss]; $mygraph->set( title => "$pairs[0]", x_label => "@xaxis", X_ORIENT='VERTICAL', bar_width => 18, show_values => 1, line_width => 2, dclrs => ['green'] , BACKGROUND='black', ) or warn $mygraph->error;
---newcode-- $mygraph->set_x_label_font(GD::gdGiantFont); $mygraph->set_y_label_font(GD::gdGiantFont);
along with this i also want to know how to change the color of the shwo_values in bar chart. Any suggestions thanks in advance monks.

Replies are listed 'Best First'.
Re: question on GD::Graph module in perl
by artist (Parson) on Nov 05, 2006 at 08:31 UTC
    No expert on GD::Graph here, but in your code, it should be
    BACKGROUND=>'black',
    rather than
    BACKGROUND='black',
    --Artist
Re: question on GD::Graph module in perl
by zentara (Cardinal) on Nov 05, 2006 at 15:56 UTC
    Try this:
    #!/usr/bin/perl -w use strict; use GD::Graph::bars; my @data = ( [qw(a b c d e f g)], [1,2,3,4,5,6,7] ); my $graph = GD::Graph::bars->new(200, 200); $graph->set( transparent => '0', bgclr => 'lgray', boxclr => 'white', fgclr => 'white', cycle_clrs => '1', x_label => 'X Label', y_label => 'Y label', ); my $gd = $graph->plot(\@data); binmode STDOUT; #print "Content-type: image/png\n\n"; print $gd->png();

    I'm not really a human, but I play one on earth. Cogito ergo sum a bum
      hi zentara, thank u very much, i got the answer. thanks again.