我有一个使用JavaServer Faces技术编写的 Web 应用程序。
该应用程序接受 n 个输入并提供一个输出。
我希望在我的应用程序中具有以下功能。
我想为我的每个输入设置滑块。
我希望输出用图表来描述。
因此,每当我通过滑块更改输入值时,我希望更改后的输出值也显示在图表中
那么最好的方法是什么?
我有一个使用JavaServer Faces技术编写的 Web 应用程序。
该应用程序接受 n 个输入并提供一个输出。
我希望在我的应用程序中具有以下功能。
我想为我的每个输入设置滑块。
我希望输出用图表来描述。
因此,每当我通过滑块更改输入值时,我希望更改后的输出值也显示在图表中
那么最好的方法是什么?
You need two components. One is the slider component which comes with pretty much every component library. Second one is the chart component I believe comes with the PrimeFaces component library. All JavaServer Faces component libraries support Ajax so you could give it a shot.
也许您可以使用Google Chart API。
在我的一个项目中,我们有类似的要求。
当我们使用 Richfaces 时,我们使用了这些组件,但对于图形绘制,我们使用了jGraph,一个小型的“开源”库。
我们选择了 jGraph,因为它是我们发现的唯一一个(不太昂贵)允许我们自动布局图形的库。(自动布局是许可版本的一部分,不是免费的)
我们使用richfaces mediaoutput组件来调用我们的backingbean,它使用jGraph 来呈现我们图形的jpg。