hi,

i need some help with creating a chart in MSexcel. currently i'm using Spreadsheet::WriteExcel module to import data into excel. i have several 2 column tables one under another . something like this:

column1 column2 column1 column2 column1 column2 column1 column2 column1 column2 column1 column2 column1 column2 ... ... column1 column2 column1 column2 column1 column2 column1 column2 column1 column2 column1 column2 column1 column2 ... ...
the thing is that the number of rows in columns and number of columns is variable, but if the first column has 5 rows then all other columns have 5 rows, but the number of other sets of columns is always different.

up till now i was solving this problem by creating an excel template for let say 10 rows in a column and 10 sets of columns, and then just populate the correct template. but this is not possible any more. so if anyone has an conceptual idea on how to do this please do share .

this is just the example of what i'm doing now

sub _xlsout { ################################################## my ($self, %arg) = @_; my $value = $self->{values}=$arg{values}; # get the values my $key = $self->{key}=$arg{key}; # decide about the right te +mplate my @SHarray = @$key; my $indeks = @SHarray; my $workbook = Spreadsheet::WriteExcel->new("Phylostratigraphic_map.x +ls"); # create xls file my $worksheet = $workbook->add_worksheet(); my $chart = $workbook->add_chart_ext("./bin/Phylo$indeks.bin", '####Ma +p####'); # ----------> here is where i import the excel template $worksheet->store_formula('=Sheet1!A1'); my $chart_font_1 = $workbook->add_format(font_only => 1); my $chart_font_2 = $workbook->add_format(font_only => 1); my $bold = $workbook->add_format(bold => 1); $worksheet->set_column('A:A', 18); $worksheet->set_column('B:B', 18); $worksheet->write('A1', 'Phylostratum', $bold); $worksheet->write('B1', 'Hit', $bold); my $row = 1; $worksheet->write_col('A2', $value); }
thanx

In reply to perl xls chart by baxy77bax

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.