it's my fault. I should describe it more clearly.

I know where is the problem.

I parse a text and want to get identical words and its times. So I have a hash: key is "identical words" and value is "times".

I hope I could draw a lines picture (x-axis is identical word and y-axis is times). In other words, "times" is data argument and "identical words" is chxl argument in URI::GoogleChart.

my ($x, @y); $x="0:"; foreach (sort { $word2_hash{$b} <=> $word2_hash{$a} or $a cmp $b} +keys %word2_hash) { $x .= "|$_"; #add identical words push @y, $word2_hash{$_}; #add times } my $chart = URI::GoogleChart->new("lines", 400, 150, data => \@y,#it is OK to parse array_ref range_show => "left", range_round => 1, color => ["red"], chxl => "$x", # chxt => "x", ); #getstore($chart, "chart.png"); #print "get pic\n";

<Sorry for my wrong post. It could work if use array_ref/p>

I find where is my problem. The chxl seems have limit. If I decrease the identical words. I can get the picture. If I use a lot of identical words, I couldn't get the picture.

Thanks for all your reply.


In reply to Re^2: draw picture by google Chart by HHCHANG
in thread draw picture by google Chart by HHCHANG

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.