开发者

Drawing a dynamic graph

I have a web appl开发者_如何转开发ication written with JavaServer Faces technology.

The application takes n inputs and provides an output.

I want the following functionality in my application.

I want to have sliders for each of my inputs.

I want the output to be depicted by a graph.

So whenever I change the input values via a slider I want the changed output value also displayed in the graph

So what will be the best way to do this?


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.


May be you could use the Google Chart API.


In one of my projects we had a similar request.

As we where using richfaces we used those components but for the graph drawing we used jGraph, a small 'open source' library.

We chose jGraph as it was the only (not too expensive) library we found that allowed us to layout automatically a graph. (automatic layout is part of a licensed version, not free)

We used the richfaces mediaoutput component to call our backingbean which used jGraph to render a jpg of our graph.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜