Possible Duplicate:
Create excel chart using Apache POI可能重复:使用Apache POI创建Excel图表
Is it possible to add different charts in an Excel sheet using Apache POI library?
是否可以使用Apache POI库在Excel工作表中添加不同的图表?
1 个解决方案
#1
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.
不是现在。在贡献者名单上有关于XSSF的支持,但是还没有。如果您愿意使用大量XML,那么您现在可以在很大程度上使用XSSF完成某些工作,但这很难。您需要搜索开发人员列表以获取详细信息。
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.
建议的解决方案是使用所需的图表创建模板文件。应使用其中所有数据的命名范围来定义图表。现在,在POI(HSSF或XSSF)中打开它,并输入您的所有数据。最后,更新命名范围以指向您添加的数据。当您打开Excel时,它会显示包含新数据的图表。
#1
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.
不是现在。在贡献者名单上有关于XSSF的支持,但是还没有。如果您愿意使用大量XML,那么您现在可以在很大程度上使用XSSF完成某些工作,但这很难。您需要搜索开发人员列表以获取详细信息。
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.
建议的解决方案是使用所需的图表创建模板文件。应使用其中所有数据的命名范围来定义图表。现在,在POI(HSSF或XSSF)中打开它,并输入您的所有数据。最后,更新命名范围以指向您添加的数据。当您打开Excel时,它会显示包含新数据的图表。