服务器端/从JFReechart到图像文件的图表渲染
一个人如何从JFReechart进行编程渲染图像文件。我有用于ChartPanel的代码:是否可以直接渲染到图像 - 而无需创建AWT/GUI组件?
val chart = .. // Imagine code to generate chart data here..
val panel = new ChartPanel(chart)
panel.renderToImage() // replace this with logic to save image file
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用方法,例如
writechartasjpeg()
或writechartaspng()
,可以写入java.io.outputstream
;或savechartasjpeg()
或savechartaspng()
,可以写入java.io.file
。看到了一些示例在这里和您还需要查看无头模式,提到在这里。
Use one of the
ChartUtilities
methods, such aswriteChartAsJPEG()
orwriteChartAsPNG()
, that can write to ajava.io.OutputStream
; orsaveChartAsJPEG()
orsaveChartAsPNG()
, that can write to ajava.io.File
. Some examples are seen here and here. For example,You'll also want to look into headless mode, mentioned here.