English 中文(简体)
在Java中创建Excel图表
原标题:Create Excel Charts in Java

我一直在使用Apache POI来创建和修改Excel电子表格,但我想知道是否有一种方法(即使是使用不同的库,最好是开源的)可以在新的xlsx格式的Excel中创建图表。看起来POI有一个HSSFChart,但我认为那是为旧格式(如果我错了,请纠正我)。有人使用过Java解决方案来创建Excel中的图表吗?

问题回答

一个选择是事先创建图表,并使用POI将值写入图表读取的位置。

那就是我最终做的,而且效果很好。

确保如果您的数据中有公式,请在将其写入磁盘之前浏览电子表格中的每个单元格并对其进行评估。

我没有使用过Aspose Cells的Java版本,但我使用过.NET版本,它很好用。那里面说它可以打开和保存XLSX。但它不是免费的,也不是开源的。

我更喜欢使用JExcel来代替POI(API更简单),但似乎他们还不支持2007格式。





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签