在backing bean中生成png / jpeg的Primefaces图形图像? [英] Generate png/jpeg image of Primefaces Charts in backing bean?

查看:184
本文介绍了在backing bean中生成png / jpeg的Primefaces图形图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的应用程序中使用Primefaces 3.1.1图表,在JSF页面中生成图表没有问题,但我试图找出是否可以为图表生成图像(png或jpeg)可以在java中将这些图像插入到Excel文件(Apache POI)中。

I am using Primefaces 3.1.1 charts in my application, there is no problem generating charts in JSF page, but I'm trying to find out if it's possible to generate image (png or jpeg) for the charts so that I can insert these images into an Excel file (Apache POI) in java.

我知道最新的Primefaces版本3.4.1有一个导出图表功能,发生在客户端(它的jqPlot)。但我需要它在服务器端。

I know the latest Primefaces version 3.4.1 has an Export Chart feature, but the generated image only occurs at the client side (it's jqPlot). But I need it on the server side.

目前,我们使用jFreeChart的支持bean为此目的,所以浏览器中的图表与Excel中的图表非常不同。我们试图找出是否通过升级到Primefaces 3.4.1可以给我们选择使图表在浏览器和Excel中的图表看起来一样吗?

Currently we are using jFreeChart in the backing bean for this purpose, so the charts in browser looked very different from the charts in Excel. We are trying to find out whether by upgrading to Primefaces 3.4.1 can give us the option to make the charts in browser and the charts in Excel looked the same? Or is there another way of doing this?

如果这是一个问题,使用mojarra-2.1.3-FCS。

Using mojarra-2.1.3-FCS if this is a concern.

推荐答案

正如你已经知道Primefaces使用jqPlot插件来生成图表,由于jqPlot是一个jquery客户端插件,它不能在服务器端生成任何东西,它的一个jquery插件,而不是一些服务器端api(jar)

As you already know Primefaces uses the jqPlot plugin to generate the charts , Since jqPlot is a jquery client side plugin it cannot generate anything on the server side , its a jquery plugin and not some server side api (jar)

因此,答案是:/

您可以考虑使用一些其他服务器端图表生成器(参见下面的链接)来生成更好的图表。

You might consider using some other server side chart generator (look at the links below) that will generate a better looking charts

13。是否有其他开源图表库? (在底部)

什么是最好的开源java图表库? (jfreechart除外)

这篇关于在backing bean中生成png / jpeg的Primefaces图形图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆