The only way that I see to do what you're wanting with Spreadsheet::WriteExcel is to import the chart from another source. That would be cumbersome, however, since it looks like import only pulls in the image, not the formula which creates the chart (ie, you'd have to export your data somewhere, create a chart, then import that chart -- ugh). Have you considered using Win32::OLE instead? It provides a very high level of control over Excel itself -- you can essentially do anything with it that you can do within the excel application itself.

Using Win32::OLE and excel, I actually do something quite similar. Using that module, you can define the chart in the excel spreadsheet and simply tell it to refresh once you've updated the data. I've placed the subroutine that implements the refresh on my scratch pad. You may also find RFC: Win32::OLE and Excel's RefreshAll worthwhile.


In reply to Re: Spreadsheet::WriteExcel, draw circles or a pie chart? by jrsimmon
in thread Spreadsheet::WriteExcel, draw circles or a pie chart? by sushi2k

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.