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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.