Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

Hi Perl Monks,

I was hoping someone might have a solution to creating a column chart in excel along with a line chart.

I've done a quite a bit of searching, I'm hoping this is not a redundant question.

Below i have a piece of code which after writing the excel values creates a graph from the relative positions. $summary_counter_column contains the final column value that was written for the graph source data. $summary_counter_row contains the final row value used.

I know that each third cycle through the data will be the comparative result of the previous two columns (column 1 - column 2 = difference). I was hoping to plot this is as a line chart over the column chart. So the columns are the values used for comparison, the line is the difference between them.

Either way, the below might be useful to someone else even in it's current state.

$row_counter=0; $column_counter=0; my $chart = $workbook->add_chart( type => 'column',embedded => 1 ); $alphabetic_increment='A'; for ( $column_counter=1; $column_counter < $summary_counter_column; $c +olumn_counter++ ) { $alphabetic_increment++; $chart->add_series ( name => '=SUMMARY!$'."$alphabetic_increment".'$1', categories =>'=SUMMARY!$A$2:$A'."$summary_counter_row", values =>'=SUMMARY!$'."$alphabetic_increment".'$2:$'."$alphab +etic_increment".'$'."$summary_counter_row" ); } $chart->set_title ( name => 'Summary' ); $chart->set_x_axis( name => 'Item List' ); $chart->set_y_axis( name => 'Amount' ); $summary->insert_chart( 'D16', $chart, 100, 50 );

In reply to Using two charts in a single graph by zxc420

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!
  • 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, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            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.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others meditating upon the Monastery: (18)
    As of 2014-07-11 14:24 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      When choosing user names for websites, I prefer to use:








      Results (227 votes), past polls