GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Google::Chart(3) User Contributed Perl Documentation Google::Chart(3)

Google::Chart - Interface to Google Charts API

  use Google::Chart;

  my $chart = Google::Chart->new(
    type => "Bar",
    data => [ 1, 2, 3, 4, 5 ]
  );

  print $chart->as_uri, "\n"; # or simply print $chart, "\n"

  $chart->render_to_file( filename => 'filename.png' );

Google::Chart provides a Perl Interface to Google Charts API (http://code.google.com/apis/chart/).

Please note that version 0.05000 is a major rewrite, and has little to no backwards compatibility.

Creates a new Google::Chart instance.
type
Specifies the chart type, such as line, bar, pie, etc. If given a string like 'Bar', it will instantiate an instance of Google::Chart::Type::Bar by invoking argument-less constructor.

If you want to pass parameters to the constructor, either pass in an already instanstiated object, or pass in a hash, which will be coerced to the appropriate object

  my $chart = Google::Chart->new(
    type => Google::Chart::Bar->new(
      orientation => "horizontal"
    )
  );

  # or

  my $chart = Google::Chart->new(
    type => {
      module => "Bar",
      args   => {
        orientation => "horizontal"
      }
    }
  );
    
size
Specifies the chart size. Strings like "400x300", hash references, or already instantiated objects can be used:

  my $chart = Google::Chart->new(
    size => "400x300",
  );

  my $chart = Google::Chart->new(
    size => {
      width => 400,
      height => 300
    }
  );
    
marker
Specifies the markers that go on line charts.
axis
Specifies the axis labels and such that go on line and bar charts
legend
color
fill

Returns the URI that represents the chart object.

Generates the chart image, and returns the contents. This method internally uses LWP::UserAgent. If you want to customize LWP settings, create an instance of LWP::UserAgent and pass it in the constructor

    Google::Chart->new(
        ....,
        ua => LWP::UserAgent->new( %your_args )
    );

Proxy settings are automatically read via LWP::UserAgent->env_proxy(), unless you specify GOOGLE_CHART_ENV_PROXY environment variable to 0

Generates the chart, and writes the contents out to the file specified by `filename' parameter

The base URI for Google Chart

We don't believe that we fully utilize Google Chart's abilities. So there might be things missing, things that should be changed for easier use. If you find any such case, PLEASE LET US KNOW! Suggestions are welcome, but code snippets, pseudocode, or even better, test cases, are most welcome.

Standardize Interface
Objects need to expect data in a standard format. This is not the case yet. (comments welcome)
Moose-ish Errors
I've been reported that some Moose-related errors occur on certain platforms. I have not been able to reproduce it myself, so if you do, please let me know.

Daisuke Maki "<daisuke@endeworks.jp>" (current maintainer)

Nobuo Danjou "<nobuo.danjou@gmail.com>"

Marcel Grünauer "<marcel@cpan.org>" (original author)

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

See http://www.perl.com/perl/misc/Artistic.html

Hey! The above document had some coding errors, which are explained below:
Around line 267:
Expected text after =item, not a bullet
2009-08-21 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.