Changeset 16110 for lang/perl

Show
Ignore:
Timestamp:
07/23/08 09:26:41 (5 years ago)
Author:
daisuke
Message:

docs

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/Google-Chart/branches/moose/lib/Google/Chart.pm

    r16096 r16110  
    3636    required => 1, 
    3737    lazy     => 1, 
    38     default  => sub { Google::Chart::Size->new( width => 200, height => 300 ) }, 
     38    default  => sub { Google::Chart::Size->new( width => 400, height => 300 ) }, 
    3939); 
    4040 
     
    7777    } 
    7878 
    79     my $uri = BASE_URI->clone; 
     79    # If in case you want to change this for debugging or whatever... 
     80    my $uri = $ENV{GOOGLE_CHART_URI} ?  
     81        URI->new($ENV{GOOGLE_CHART_URI}) : 
     82        BASE_URI->clone; 
    8083    $uri->query_form( %query ); 
    8184    return $uri; 
     
    118121  ); 
    119122  print $chart->as_uri, "\n"; 
    120   print $chart->render_to_file( 'filename.jpg' ); 
     123  print $chart->render_to_file( filename => 'filename.png' ); 
     124 
     125=head1 METHODS 
     126 
     127=head2 new(%args) 
     128 
     129=over 4 
     130 
     131=item type 
     132 
     133Specifies the chart type, such as line, bar, pie, etc. If given a string like 
     134'Bar', it will instantiate an instance of Google::Chart::Type::Bar by 
     135invoking argument-less constructor. 
     136 
     137If you want to pass parameters to the constructor, either pass in an 
     138already instanstiated object, or pass in a hash, which will be coerced to 
     139the appropriate object 
     140 
     141  my $chart = Google::Chart->new( 
     142    type => { 
     143      module => "Bar", 
     144      args   => { 
     145        orientation => "horizontal" 
     146      } 
     147    } 
     148  ); 
     149 
     150=item size 
     151 
     152Specifies the chart size. Strings like "400x300", hash references, or already 
     153instantiated objects can be used: 
     154 
     155  my $chart = Google::Chart->new( 
     156    size => "400x300", 
     157  ); 
     158 
     159  my $chart = Google::Chart->new( 
     160    size => { 
     161      width => 400, 
     162      height => 300 
     163    } 
     164  ); 
     165 
     166=back 
     167 
     168=head2 as_uri() 
     169 
     170Returns the URI that represents the chart object. 
     171 
     172=head2 render() 
     173 
     174Generates the chart image, and returns the contents. 
     175 
     176=head2 render_to_file( %args ) 
     177 
     178Generates the chart, and writes the contents out to the file specified by 
     179`filename' parameter 
    121180 
    122181=cut