OpenGuides::Statistics - generate graphs of the number of nodes on an OpenGuides site


OpenGuides-Statistics documentation  | view source Contained in the OpenGuides-Statistics distribution.

Index


NAME

Top

OpenGuides::Statistics - generate graphs of the number of nodes on an OpenGuides site

SYNOPSIS

Top

    use OpenGuides::Statistics;

    my $stats = 
      OpenGuides::Statistics->new( wiki_conf   => '/path/to/your/openguides/wiki.conf',
                                   import_date => '2000-01-01' );

    my ($total_graph, $rate_graph) = $stats->make_graphs;
    my $node_count                 = $stats->node_count;

DESCRIPTION

Top

This module will read your OpenGuides database and produce Chart::Strip graphs of the data therein to show you how fast you've accumulated nodes.

METHODS

Top

new()

    my $stats =
      OpenGuides::Statistics->new( wiki_conf   => '/path/to/your/openguides/wiki.conf',
                                   import_date => '2000-01-01' );

There's only one required argument, wiki_conf. This is a path to the configuration file of your OpenGuides installation, which this module will load to know how to access your wiki's database. Optional arguments:

* import_date Use this to ignore a certain date when reading the node creation dates from your database. This is useful if your database was created by importing an existing database, which would otherwise cause a large spike at the beginning of your graph. Takes a date string in the format yyyy-mm-dd.
* graph_width Width in pixels of your graphs. Defaults to 640.
* graph_height Height in pixels of your graphs. Defaults to 480.
* total_colour The colour of the filled area in the "total nodes" graph. Must be a six-digit hex colour, e.g. 6699CC. Defaults to 000000.
* rate_line_colour The colour of the line in the rate graph. Defaults to 000000.
* rate_points_colour The colour of the points in the rate graph. Defaults to 000000.
* include_redirects Show nodes that are only redirects to other nodes. Defaults to undef.

make_graphs()

    my ($total_graph, $rate_graph) = $stats->make_graphs;

This method will return two Chart::Strip objects, which have three possible output methods: png() (returns a PNG image), jpeg() (returns a JPEG image) and gd() (returns an underlying GD object). An example of how to use the objects is included in the 'examples' directory of this distribution.

node_count()

    my $node_count = $stats->node_count;

This method will return a scalar value of how many nodes there are in your database.

AUTHOR

Top

Earle Martin <EMARTIN@cpan.org>

http://purl.oclc.org/net/earlemartin/

LEGAL

Top

SEE ALSO

Top

OpenGuides
http://openguides.org/

OpenGuides-Statistics documentation  | view source Contained in the OpenGuides-Statistics distribution.