4

Possible Duplicate:
Create excel chart using Apache POI

Is it possible to add different charts in an Excel sheet using Apache POI library?

Community
  • 1
  • 1
user755174
  • 77
  • 2
  • 8

1 Answers1

2

Not currently. There is talk of support for XSSF on the dev list, from a contributor, but there's nothing yet. If you're willing to monkey with lots of XML, then you can largely get something done with XSSF for now, but it's hard. You'd need to search the dev list for details.

The recommended solution is to create a template file with the charts you want in them. The charts should be defined using named ranges for all the data in them. Now, open this in POI (either HSSF or XSSF), and put in all your data. Finally, update the named range to point to the data you've added. When you open excel, it'll show your chart with the new data.

Gagravarr
  • 47,320
  • 10
  • 111
  • 156