Java 在 JSF 中绘制图形(图表)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2040296/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Drawing Graphs (charts) in JSF
提问by Anand Sunderraman
How can I draw dynamic graphs in web pages in JSF ? People have suggested Google Chart Api
如何在 JSF 中的网页中绘制动态图形?人们建议使用 Google Chart Api
I want something that can work offline
我想要可以离线工作的东西
采纳答案by Anand Sunderraman
Hey I found an answer to my question after scouring the net. Apache myFaces has a tr:chart component that solves my problem :)
嘿,我在网上搜索后找到了我的问题的答案。Apache myFaces 有一个 tr:chart 组件可以解决我的问题:)
回答by D.C.
how about the new Canvas API? may be too bleeding edge to be counted on but it is functional in Chrome and Firefox, and looks to have a lot of potential. Its API reminds of Quartz / OpenGL (but a lot simpler) which makes programatic drawing pretty easy.
新的 Canvas API 怎么样?可能太前沿而无法指望,但它在 Chrome 和 Firefox 中可以正常工作,并且看起来有很大的潜力。它的 API 让人想起 Quartz / OpenGL(但要简单得多),这使得编程绘图变得非常容易。
回答by stacker
Richfaces provides a component to draw 2D graphics. http://livedemo.exadel.com/richfaces-demo/richfaces/paint2D.jsf
Richfaces 提供了一个组件来绘制 2D 图形。 http://livedemo.exadel.com/richfaces-demo/richfaces/paint2D.jsf
回答by prakash.panjwani
I have used jfreechart to draw 3d and 2d Chart at run time. I am using that graph on my pdf file as a report. I will suggest you to use this jfreechart api, I have attached some link for you please check it , Click here:
我在运行时使用 jfreechart 绘制 3d 和 2d 图表。我在我的 pdf 文件中使用该图表作为报告。我会建议你使用这个 jfreechart api,我已经为你附上了一些链接,请检查它,点击这里:
Second link is a example of jsp page with graph.
第二个链接是带有图形的jsp页面示例。
回答by Bozho
PrimeFaceshave wonderful graph components. You can give them a try.
PrimeFaces有很棒的图形组件。你可以试试看。
Exadel Fijialso has nice graph components.
Exadel Fiji也有很好的图形组件。
MyFaces Trinidadis also an option (as indicated by the OP)
MyFaces Trinidad也是一个选项(如 OP 所示)
回答by George Suaridze
if you use JSF 2, you can look at flot4jsf2 project. This is JSF2 component for drawing charts, it uses javascript flot library.
如果您使用 JSF 2,您可以查看flot4jsf2 项目。这是用于绘制图表的 JSF2 组件,它使用 javascript 浮点库。
回答by Amit Tikoo
We were going through the same issue and ended up using JQPlot. It is extensive, JQuery based and so far so good.
我们遇到了同样的问题,最终使用了 JQPlot。它是广泛的,基于 JQuery,到目前为止还不错。
回答by Yan
There is a Highcharts wrapper :
有一个 Highcharts 包装器:
the demo is here : http://showcase-jsfcharts.rhcloud.com/