marcinski has asked for the wisdom of the Perl Monks concerning the following question:
My program looks generally like this (rough frame was created by Zooz):Tk::Error: Can't locate object method "add_chart" via package "Spreads +heet::WriteExcel::Worksheet" at C:\perl\KDC_v3charts.pl line 1352. main::analysis at C:\perl\KDC_v3charts.pl line 1352 Tk callback for .button4 Tk:__ANON__ at C:/Perl/site/lib/Tk.pm line 250 Tk::Button::butUp at C:/Perl/site/lib/Tk/Button.pm line 175 <ButtonRelease-1> <command bound to event>
Works great! But... Then I tried to add new charts via#!/usr/bin/perl use strict; use warnings; use Tk; #GUI use Tk::DirTree; #GUI use Cwd; #Current working dir use Tk::NumEntry; #GUI use Spreadsheet::ParseExcel; #Excel I/O use Statistics::Descriptive; #Statistics use Spreadsheet::WriteExcel; #Excel I/O use Spreadsheet::WriteExcel:Worksheet; listed global variables Tk MainLoop, where there is main window created for user input, multip +le variables, and the submit button: $ZWIDGETS{'Button3'} = $MW->Button( -text => 'SUBMIT FOR ANALYSIS', -command => 'main::analysis', )->grid( -row => 15, -column => 0, -sticky => 'w', -padx => 5, -pady => 5, ) sub analysis { importing data from an input file multiple statistical calculations creating a new output xls file via my $EXworkbook = Spreadsheet::WriteExcel->new("output.xls") my $EXworksheet = $EXworkbook->add_worksheet('Worksheet1') writing statistical calculations into worksheet }
If I try to embedd this into the main 'analysis' sub I get the above error.my $chart = $EXworksheet->add_chart( type => 'column', embedded => 1 )
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Tk / Spreadsheet::WriteExcel Charts problem
by jmcnamara (Monsignor) on Feb 08, 2011 at 19:57 UTC |