NAME

DBD::Chart - DBI driver abstraction for DBD::Chart::Plot and GD::Graph

SYNOPSIS

$dbh = DBI->connect('dbi:Chart')
    or die "Cannot connect: " . $DBI::errstr;
#
#	create file if it deosn't exist, otherwise, just open
#
$dbh->do('CREATE TABLE mychart (name CHAR(10), ID INTEGER, value FLOAT)')
	or die $dbh->errstr;

#	add data to be plotted
$sth = $dbh->prepare('INSERT INTO mychart VALUES (?, ?, ?)');
$sth->bind_param(1, 'Values');
$sth->bind_param(2, 45);
$sth->bind_param(2, 12345.23);
$sth->execute or die 'Cannot execute: ' . $sth->errstr;

#	and render it
$sth = $dbh->prepare('SELECT BARCHART FROM mychart');
$sth->execute or die 'Cannot execute: ' . $sth->errstr;
@row = $sth->fetchrow_array;
print $row[0];

# delete the chart
$sth = $dbh->prepare('DROP TABLE mychart')
	or die "Cannot prepare: " . $dbh->errstr;
$sth->execute or die 'Cannot execute: ' . $sth->errstr;

$dbh->disconnect;

WARNING

THIS IS BETA SOFTWARE.

DESCRIPTION

The DBD::Chart provides a DBI abstraction for rendering pie charts, bar charts, and line and point graphs.

For detailed usage information, see the included dbdchart.html webpage. See DBI(3) for details on DBI. See GD(3), GD::Graph(3) for details about the graphing engines.

Prerequisites

Perl 5.005 minimum
DBI 1.14 minimum
DBD::Chart::Plot 0.10 minimum (included with this package)
GD::Graph 1.26 minimum
GD X.XX minimum
GD::Text X.XX minimum
libpng
zlib
libgd
jpeg-6b

Installation

For Windows users, use WinZip or similar to unpack the file, then copy Chart.pm to wherever your site-specific modules are kept (usually \Perl\site\lib\DBD for ActiveState Perl installations). Also create a 'Chart' directory in the DBD directory, and copy the Plot.pm module to the new directory. Note that you won't be able to execute the install test with this, but you need a copy of 'nmake' and all its libraries to run that anyway. I may whip up a PPM in the future.

For Unix, extract it with

gzip -cd DBD-Chart-0.40.tar.gz | tar xf -

and then enter the following:

cd DBD-Chart-0.40
perl Makefile.PL
make
make test

If any tests fail, let me know. Otherwise go on with

make install

Note that you probably need root or administrator permissions. If you don't have them, read the ExtUtils::MakeMaker man page for details on installing in your own directories. ExtUtils::MakeMaker.

FOR MORE INFO

Check out http://home.earthlink.net/~darnold/dbdchart with your favorite browser. It includes all the usage information.

AUTHOR AND COPYRIGHT

This module is Copyright (C) 2001 by Dean Arnold

Email: darnold@earthlink.net

You may distribute this module under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README file.

SEE ALSO

DBI(3)

For help on the use of DBD::Chart, see the DBI users mailing list:

dbi-users-subscribe@perl.org

For general information on DBI see

http://www.symbolstone.org/technology/perl/DBI