Chart-OFC

 view release on metacpan or  search on metacpan

lib/Chart/OFC.pm  view on Meta::CPAN

The base class for all datasets. It has no formatting, and can only be
used with pie charts.

=item * Chart::OFC::Dataset::Bar

=item * Chart::OFC::Dataset::FadeBar

=item * Chart::OFC::Dataset::OutlinedBar

=item * Chart::OFC::Dataset::GlassBar

=item * Chart::OFC::Dataset::3DBar

=item * Chart::OFC::Dataset::SketchBar

Formats your data as a set of bars. There are many different styles of
bars.

=item * Chart::OFC::Dataset::Line

=item * Chart::OFC::Dataset::LineWithDots

Formats your data as a line, with optional dots marking each value.

=item * Chart::OFC::Dataset::Area

Like a line with dots, but this dataset also fills in the area between
the line and the X axis with a color.

=back

=head3 Axes and Axis Labels

When you are creating a non-pie chart, you will want to create an X
and Y axis for the chart. These are represented by the
C<Chart::OFC::XAxis> and C<Chart::OFC::YAxis> classes.

These classes in turn can take a C<Chart::OFC::AxisLabel> class to
define the label for the entire label.

=head3 Grid Charts

A grid chart can contain any number of datasets, in any combination of
bars and lines.

=head3 Pie Charts

A pie chart displays a single dataset, with each value as a pie slice.

=head2 Colors

Many attributes in different classes expect a color. Colors can be
provided as an RGB hex string with a leading "#" symbol, or as color
names. Names are translated into RGB by use of the
C<Graphics::ColorNames> module, using the "X" scheme. See that
module's docs for more details.

=head2 Opacity

Several classes accept an opacity value for an attribute. This should
be a value from 0 (completely transparent) to 100 (completely opaque).

=head1 ATTRIBUTES

This class has a number of attributes which may be passed to the
C<new()> method.

=head2 title

This is shown as the title of the chart.

This attribute is optional.

=head2 title_style

This should be a chunk of CSS specifying attributes that apply to
text, such as "font-size", "color", etc.

This defaults to the string "font-size: 25px". Without a default
specifying a sane size, the default size OFC uses seems to 1px or so.

=head2 tool_tip

This defines how tool tips are generated for data points. It uses a
simple templating language. See
http://teethgrinder.co.uk/open-flash-chart/gallery-tool-tip.php for
details.

This attribute is optional.

=head2 bg_color

The background color for the chart and surrounding text.

This attribute is optional.

=head1 METHODS

All of the above named may be accessed as read-only accessors on an
object.

This class also provide several additional methods.

=head2 as_ofc_data

Returns a textual representation of the chart suitable for delivering
to OFC.

=head1 ROLES

This class does the C<Chart::OFC::Role::OFCDataLines> role.

=head1 TODO

This distribution does not yet support all of the features of OFC.

There are a few items left to do, notably grid charts with 2 Y axes,
and background images.

It would also be nice to generate embeddable Javascript for populating
charts, since this lets you create a chart without making an



( run in 1.042 second using v1.01-cache-2.11-cpan-39bf76dae61 )