Create Excel Charts in Java

calendar_today Asked Feb 9, 2010
thumb_up 5 upvotes
history Updated April 16, 2026

Question posted 2010 · +15 upvotes

I’ve been using Apache POI to create and modify Excel spreadsheets, but I’m wondering if there is a way (even if it’s with a different library, preferably open source) to create charts in Excel in the new xlsx format. It looks like POI has an HSSFChart but I believe that’s for the older format (please correct me if I’m wrong). Has anyone used a Java solution to create charts in Excel?

Accepted answer +5 upvotes

An option may be to create the charts beforehand and use POI to write the values where the chart can read them.

That is what I ended up doing, and it works great.

Make sure if you have formulas in your data, you go through every cell in the spreadsheet and evaluate them before writing it out to disk.

Top excel Q&A (6)

+5 upvotes ranks this answer #152 out of 167 excel solutions on this site .