Spreadsheet-WriteExcel - Re: Help with Multiple charts using chartex

Posted on Thu Apr 14 03:02:32 2005 by jmcnamara in response to 330 (See the whole thread of 8)
Re: Help with Multiple charts using chartex

Hi,

I couldn't reproduce your bug.

I created a workbook with two worksheets with data in cells A1:B10 and two charts which referred to the worksheet data.

I then extracted the charts and ran the program below

#!/usr/bin/perl -w use strict; use Spreadsheet::WriteExcel; my $workbook = Spreadsheet::WriteExcel->new("demo4.xls"); my $worksheet1 = $workbook->add_worksheet(); my $worksheet2 = $workbook->add_worksheet(); my $chart1 = $workbook->add_chart_ext('demo401.bin', 'Chart1'); my $chart2 = $workbook->add_chart_ext('demo402.bin', 'Chart2'); # Link the chart to the worksheet data using a dummy formula. $worksheet1->store_formula('=Sheet1!A1'); $worksheet1->store_formula('=Sheet2!A1'); # Add some extra formats to cover formats used in the charts. $workbook->add_format(color => 1); $workbook->add_format(color => 2); $workbook->add_format(color => 3); $workbook->add_format(color => 4); # Add all other formats (if any). # Add data to range that the chart refers to. my @nums = (0, 1, 2, 3, 4, 5, 6, 7, 8, 9); my @squares = map {$_**2} @nums; my @cubes = map {$_**3} @nums; $worksheet1->write_col('A1', \@nums ); $worksheet1->write_col('B1', \@squares); $worksheet2->write_col('A1', \@nums ); $worksheet2->write_col('B1', \@cubes );

The output from this was fine. Which isn't to say that there isn't a bug. Only that I couldn't reproduce it. :-)

So the best thing to do is post a complete (but minimal) example that demonstrates the problem.


John.
--
Direct Responses: 340 | Write a response