Chart-Gnuplot-Pie

 view release on metacpan or  search on metacpan

lib/Chart/Gnuplot/Pie.pm  view on Meta::CPAN

    my $chart = Chart::Gnuplot::Pie->new(
        output => "pie.png",
        title  => "Sample Pie",
        ....
    );

    # Data set
    my $dataSet = Chart::Gnuplot::Pie::DataSet->new(
        data => [
            ['Item 1', 7500],
            ['Item 2', 3500],
            ['Item 3', 2000],
            ['Item 4', 4500],
        ],
        ....
    );

    # Plot a 2D pie chart
    $chart->plot2d($dataSet);

    #################################################

    # Plot a 3D pie chart
    $chart->plot3d($dataSet);

=head1 DESCRIPTION

This module provides an interface for plotting pie charts using Gnuplot, which
has not built-in command for pie. This module is an implementation of the idea
of L<The Impossible Gnuplot
Graphs|http://www.phyast.pitt.edu/~zov1/gnuplot/html/pie.html>.
L<Gnuplot|http://www.gnuplot.info> and L<Chart::Gnuplot> are required. 

B<IMPORTANT>: This is a preliminary version. Not many pie charting options are
provided currently. Besides, backward compatibility may not be guaranteed in
the later versions.

=head1 PIE CHART OBJECT

C<Chart::Gnuplot::Pie> is a child class of C<Chart::Gnuplot>. As a result, what
you may do on a C<Chart::Gnuplot> object basically works on a
C<Chart::Gnuplot::Pie> object too, with a few exceptions.

=head2 Pie Chart Options

The following options have no effect since they have not much meaning in pie
chart.

    xlabel, ylabel, zlabel
    x2label, y2label
    xrange, yrange, zrange
    x2range, y2range
    trange, urange, vrange
    xtics, ytics, ztics
    x2tics, y2tics
    timeaxis
    grid

Besides, the following options, though can be meaningful, are not supported yet.

    legend
    size
    bg
    plotbg

Supported options are:

    output
    title
    border
    tmargin, bmargin
    lmargin, rmargin
    orient
    imagesize
    origin
    timestamp
    view (only 3D pie)
    gnuplot
    convert
    terminal

=head1 DATASET OBJECT

C<Chart::Gnuplot::Pie::DataSet> is a child class of C<Chart::Gnuplot::DataSet>.

=head2 Dataset Options

The following options have no effect since they have not much meaning in pie
dataset.

    xdata, ydata, zdata
    points
    func
    title
    style
    width
    linetype
    pointtype
    pointsize
    axes
    smooth

Besides, the following options, though can be meaningful, are not supported yet.

    datafile
    fill
    timefmt

Supported options are:

    data
    rotate
    colors
    border

=head3 data

The data that would be displayed in the pie chart. The data should be organized
in a matrix of the format:

    [



( run in 0.851 second using v1.01-cache-2.11-cpan-df04353d9ac )