man Lire::ChartType () - Base interface for all ChartType.

NAME

Lire::ChartType - Base interface for all ChartType.

SYNOPSIS

  use base qw/ Lire::ChartType /;

DESCRIPTION

This package defines the interface which is implemented by all the different charts that Lire is able to produce using the ploticus pl(1) command.

A chart type will generate a chart using data from a subreport.

META INFORMATION METHODS

The Lire::ChartType interface extends the Lire::Plugin interface, so they must implement all standard meta-information methods (name(), title(), description()).

GENERATING A CHART

This will write a chart from the data contained in the Lire::Report::Subreport CW$subreport using the configuration CW$chart_config. Additional parameters are passed in 'key' => CW$value form. The CW$chart_config parameters should be a Lire::Config::Dictionary object instantiated from a Lire::Config::ChartSpec.

outputdir
Directory where the file will be created. Use the working directory by default.
format
One of eps, png, jpeg or gif. Default to the configuration variable lr_image_format.

The function returns the path to the created file. The filename is generated base on the 'name' configuration value or the subreport's id if the other isn't defined. The extension is added based on the output format.

It returns the file where the chart was written.

prefab()

This method must be implemented by the subclass and should return a string representing the first parameters to pass to ploticus (that is either -prefab name or the path to a script file). This method is used to write parameters to the ploticus file handle. This is the place to use the #set command to set all of the prefabs parameters. Subclass must chain to this implementation for the standard chart parameters. It also write '#set name' directives for each numerical variables defined by get_vars(). This method is used by the write_chart() implementation to write the chart data from CW$subreport to the Ploticus commond opened on CW$fh. It uses the get_vars() method to obtain the numerical variables that should be written to the stream and the encode_value() method to marshall values before writing them. This method should be overriden by subclasses to return an array reference containing the Lire::Report::ColumnInfo specifying the numerical column's of data that should be written. This is usually specified using a ReferenceSpec with the 'numerical_variables' index.

These variables will start at the ploticus index 2 (@2). By default, this method just returns the 'content' component of the item when the CW$value is a name and the 'value' component otherwise. It can used for data type that needs special encoding (like datetime).

SEE ALSO

AUTHOR

Francis J. Lacoste <flacoste@logreport.org>

VERSION

$Id: ChartType.pm,v 1.13 2004/10/08 18:36:43 flacoste Exp $

COPYRIGHT

Copyright (C) 2004 Stichting LogReport Foundation LogReport@LogReport.org

This file is part of Lire.

Lire is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program (see COPYING); if not, check with http://www.gnu.org/copyleft/gpl.html or write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.