Hi, thanks for your reply. I am ok with this font size. i.e - $graph->set_values_font($font, 8). My graph is PERFECT now. I thank you again for your wonderful support. Anyway, I would like to learn below codes since I want to draw in that way. because It's a very perl way. Could you pls explain below codes.
my %count=(); # A hash -it is bcos of of key/value pairs? while (<$fh>){ if (/amavis.*(Passed|Blocked) (CLEAN|SPAM|INFECTED|BANNED)/){ ++$count{$2}; # Why ++$count? why {$2} here? is it bcos of (Passed +|Blocked) ? } elsif (/amavis.*(BAD-HEADER)-/) { ++$count{$1}; # why {$1} here? is it bcos of (BAD-HEADER) } elsif (/reject/){ ++$count{'REJECTED'}; #Hmm, Why {'REJECTED'}? } }
Now I want to learn next code
my @data = map{ $count{$_} || 0 } qw(CLEAN SPAM INFECTED BANNED BAD-HE +ADER REJECTED); Why map{ $count{$_} || 0 } ? qw(CLEAN SPAM INFECTED BANNED BAD-HEADER REJECTED) # here you create a +n array for count values?
my $data = GD::Graph::Data->new([ ["Cleaned","Spam","Virus","Banned","BadHeader","Rejected"], [@data], ]) or die GD::Graph::Data->error; [@data] has count values coming from line qw(CLEAN SPAM INFECTED BANN +ED BAD-HEADER REJECTED)
Could you pls explain me these, Since I PREFER this method and I can learn a lot of perl as well.
In reply to Re^6: problem with show_values => 1, while drawing a bar graph with variables
by theravadamonk
in thread problem with show_values => 1, while drawing a bar graph with variables
by theravadamonk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |