Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

jmcnamara (659)

jmcnamara
  (email not shown publicly)
http://search.cpan.org/author/jmcnamara/


'ere I am, J.M.! The ghost in the machine:

perl -MCPAN -e 'install jmcnamara & _ x ord $ ;' | tail -1

Journal of jmcnamara (659)

Friday August 20, 2004
06:01 PM

Charts in Spreadsheet::WriteExcel

[ #20494 ]
A first look at charting with Spreadsheet::WriteExcel.

#!/usr/bin/perl -w

use strict;
use Spreadsheet::WriteExcel;

my $workbook  = Spreadsheet::WriteExcel->new("demo02.xls");
my $worksheet = $workbook->add_worksheet();
my $chart     = $workbook->add_chart_ext('chart200.bin', 'Chart1');

$chart->activate();

$worksheet->store_formula('=Sheet1!A1');
$ worksheet->set_column('A:A', 20);

$workbook->add_format(color => 1);
$workbook->add_format(color => 2, bold => 1);
$workbook->add_format(color => 3);

my @data = (

            ['BIFFwriter.pm',   275],
            ['Big.pm',           99],
            ['Chart.pm',        269],
            ['Format.pm',       724],
            ['Formula.pm',     1410],
            ['OLEwriter.pm',    447],
            ['Utility.pm',      884],
            ['Workbook.pm',    1925],
            ['WorkbookBig.pm',  112],
            ['Worksheet.pm',   3945],
        );

$worksheet->write_col('A1', \@data);

__END__

And the result. Hurrah!

The chart was produced in Excel with some spurious data, extracted from Excel and then added to a Spreadsheet::WriteExcel file with new input data.

For now this is hackery and a little fragile but it is promising and surprising satisfying.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.