i'm having issues with the line names and values given for the x-axis. i have this code:

sub chart_me { my( $row, $name ) = @_; my $chart = $workbookout->add_chart( type => 'line', name => $name +); $chart->set_title( name => $name ); foreach my $i ( 1 .. 6 ) { my $rowi = $row + $i - 1; $chart->add_series( name => $header[ $i ], catagories => xl_range_formula( 'Sheet1', 1, 1, 2, $ma +xcol ), values => xl_range_formula( 'Sheet1', $rowi, $rowi +, 2, $maxcol ), ); } }

which generally works. my issue is that the value for 'name' should come from an array and instead is giving me "Row 2", "Row 3", etc. ie, "Row ".$i also, i can't find a way to get the values for the x-axis to be named as the date they come from (row 1) - i've got data from 2009-01 to 2010-12 and i'm getting 1 .. 24. is there any way to do this?

UPDATE

i did have some off by one issues, but correcting them just means that the data is fitting correctly in the graph - it didn't solve any of my issues.
$chart->add_series( name => $header[ $i ], catagories => xl_range_formula( 'Sheet1', 0, 0, 1, $ma +xcol ), values => xl_range_formula( 'Sheet1', $rowi, $rowi +, 1, $maxcol ), );

UPDATE #2

i figured out that the 'name' for each line is actually given by the 'name_format' value. i'm now not entirely sure what 'name' is for. i plan to keep playing with it, and see if i can get some better / interesting results to pop out. my current add_series object definition looks like:

$chart->add_series( name => $header[ $i ], name_formula => '=Sheet1!' . xl_rowcol_to_cell( $rowi +, 0, 1, 1 ), catagories => xl_range_formula( 'Sheet1', 0, 0, 1, +$maxcol ), values => xl_range_formula( 'Sheet1', $rowi, $r +owi, 1, $maxcol ), );

In reply to Help with Spreadsheet::WriteExcel::Chart by ag4ve

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.