SYNOPSIS

    use Chart::Strip;

    my $ch = Chart::Strip->new(
                 title   => 'Happiness of our Group',
                 # other options ...
             );

    $ch->add_data( $davey_data, { style => 'line',
                                  color => 'FF0000',
                                  label => 'Davey' } );

    $ch->add_data( $jenna_data, { style => 'line',
                                  color => '00FF88',
                                  label => 'Jenna' } );

    print $ch->png();

DESCRIPTION

The Chart::Strip package plots data values versus time graphs, such as used for seismographs, EKGs, or network usage reports.

It can plot multiple data sets on one graph. It offers several styles of plots. It automatically determines the proper ranges and labels for both axii.

USAGE

Create the Chart

$chart = Chart::Strip->new(); $chart = Chart::Strip->new( option1 => value, option2 => value, );

If no options are specified, sensible default values will be used. The following options are recognized: The width of the image The height of the image. The title of the graph. Will be placed centered at the top. The label for the x axis. Will be placed centered at the bottom. The label for the y axis. Will be placed vertically along the left side. Should a grid be drawn on the graph? Should a border be drawn around the edge of the image? Should value labels be shown? Should each data set be labeled? Should the background be transparent? Should the grid be drawn over the data (1) or below the data (0)? Use powers of 2 instead of powers of 10 for the y axis labels. Style for drawing the graph labels. \*(C`text\*(C' or \*(C`box\*(C' Thickness of lines in pixels. (Requires \s-1GD\s0 newer than $VERSION). Don\'t draw a line into or out of a datapoint whose value is undefined. If false, undefined values are treated as though they were 0. Width of boxes for box style graphs. The width may also be specified as \*(C`width\*(C' in the data options or per point. If no width is specified a reasonable default is used.

Adding Data

$chart->add_data( $data, $options );

The data should be an array ref of data points. Each data point should be a hash ref containing:

{ time => $time_t, # must be a unix time_t value => $value, # the data value color => $color, # optional, used for this one point }

or, range style graphs should contain:

{ time => $time_t, # must be a unix time_t min => $low, # the minimum data value max => $high, # the maximum data value color => $color, # optional, used for this one point }

and the options may contain:

{ style => 'line', # graph style: line, filled, range, points, box color => 'FF00FF', # color used for the graph label => 'New England', # name of the data set }

points style graphs may specify the point diameter, as \*(C`diam\*(C'

box style graphs may specify the box width, as \*(C`width\*(C'

line and filled graphs may specify a \*(C`smooth\*(C' parameter, to connect points using smooth curves instead of straight lines. A value of 1 is recommended, larger values will be less smooth.

line, points, box, and filled graphs may specify a drop shadow, consisting of a hashref containing \*(C`dx\*(C', \*(C`dy\*(C', \*(C`dw\*(C', and optionally, \*(C`color\*(C'

shadow => { dx => 3, dy => 3, dw => 3, color => 'CCCCCC' }

Outputing The Image

Will return the \s-1PNG\s0 image Will return the jpeg image Will return the underlying \s-1GD\s0 object.

EXAMPLE IMAGES

http://argus.tcp4me.com/shots.html http://search.cpan.org/src/JAW/Chart-Strip-1.07/eg/index.html

LICENSE

This software may be copied and distributed under the terms found in the Perl \*(L"Artistic License\*(R".

A copy of the \*(L"Artistic License\*(R" may be found in the standard Perl distribution.

BUGS

There are no known bugs in the module.

RELATED TO Chart::Strip…

Yellowstone National Park.

AUTHOR

Jeff Weisberg - http://www.tcp4me.com