in reply to Re: add_chart_ext does not work when compressed
in thread add_chart_ext does not work when compressed

Thanks for your reply! Below is the code that generates the error, if the user selects not to include a graph in the excel file (i.e. $graph==0) the error does not appear. I guess that means that it has to be the add_chart_ext command that generates the error

if ($graph==1) { #Write values for run chart $hidden_worksheet->write(0,$stab_column_end+1,"Time"); $hidden_worksheet->write_col(1,$stab_column_end+1,\@time_data) +; $hidden_worksheet->write(0,$stab_column_end+2,"Speed 1"); $hidden_worksheet->write_col(1,$stab_column_end+2,\@speed_1_da +ta); $hidden_worksheet->write(0,$stab_column_end+3,"Speed 2"); $hidden_worksheet->write_col(1,$stab_column_end+3,\@speed_2_da +ta); $hidden_worksheet->write(0,$stab_column_end+4,"Speed 3"); $hidden_worksheet->write_col(1,$stab_column_end+4,\@Speed_3_da +ta); #Add run chart my $run_chart = $workbook->add_chart_ext('.\charts\run_chart.b +in',"Step response run"); $worksheet->store_formula('=Hidden data sheet!A1'); }

There's alot more code generating a bunch information in the excel sheet before this snippet is executed, I don't know if that could affect anything. Furtheron, I have ensured that I have the bin-file run_chart at the indicated path.

Is there anything I'm doing wrong here?

Thank you in advance!

Replies are listed 'Best First'.
Re^3: add_chart_ext does not work when compressed
by jmcnamara (Monsignor) on Apr 21, 2011 at 09:32 UTC
    I'm at a loss to see how this is happening in Spreadsheet::WriteExcel, either inside or outside of a Cava package.

    Could you add Devel::SimpleTrace to your program and post the stack trace of the failing code.

    --
    John.

      maybe his $cwd isn't meshing with add_chart_ext('.\charts\run_chart.bin' or maybe he is filtering the packed modules through PodStrip or another one
        That was my first thought too but in that case there should be a different error message like this:
        Couldn't open .\charts\run_chart.bin in add_chart_ext(): No such file or directory.

        The particular error message that is being reported, "Chart type 'External' not supported in add_chart()" is generated when you try to add a chart type that doesn't exist via add_chart() (and not from add_chart_ext() as report by the OP):

        my $chart = $workbook->add_chart( type => 'foo' ); ... Chart type 'Foo' not supported in add_chart()
        However, there is an 'External' chart module (albeit invalid in this case) so if a program inadvertently tried to load it it would generate another different error message. As such I cannot see any way that particular error message can be generated.

        Confused? I am and I wrote the module. Hopefully the stack trace will clear things up a bit.

        Update: I was wrong about this. The External.pm module is loaded using the same factory method as the other Chart modules. I was clearly smoking a bit too much Java at the time I wrote it.

        --
        John.