poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mathew Johnston <mathew.johns...@telus.com>
Subject Creating charts from a 'template'
Date Fri, 05 Oct 2012 00:28:09 GMT

I know (I think) that POI doesn't yet offer an XSSF API for chart 
manipulation, but, I figure that I don't really need one. Instead, 
I'm wondering if  this would be a reasonable approach:

1. Using Excel, create a workbook with 'template' charts
2. Open that workbook using POI
3. For each chart I want to create
3. a. Clone the relevant template into a new sheet
3. b. Make note of the corresponding new Chart XML file name/number
3. c. Write series data table into additional new sheets
3. d. I can then open the XSLX ZIP and directly (programatically) edit 
      the chart XML file to update series references to point to the 
      new data sheet.
4. User opens the workbook and it automatically updates the chart data 
      (I won't bother to edit cached values in the XML)

Does this seem like a viable approach? 

I'm totally new to POI, so I'm fairly unfamiliar with the API. My 
strategy depends on being able to blindly clone a chart object and 
any linked drawings (some of my charts have added connector lines 
drawn in them to provide a diagonal x=y guideline). 

I don't see an obvious way to duplicate a shape (I'm assuming I'm 
setting out to copy an XSSFShape?). How does one go about that? 
After that I'd need to identify the corresponding new Chart#.xml in 
the ZIP - possible?

Alternative approaches?

Thanks very much for any advice you can offer!


To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org

View raw message