简体   繁体   中英

Create Graph or chart in java/ gwt?

I have to create a graph or a chart in GWT which look like 图表

P,Y,T,A,R are the organisations and the 10 is the Max limit . For P the value is 5 , For Y value is 7..

Is there any library availabe for this chart .? If not can any tell me the approach to achieve this.??

Thanks

You can always use d3.js . There are hundreds of example charts.

It's a JavaScript library, so you will need to use JSNI to use it. There is also a GWT wrapper for it called gwt-d3 .

Here is an example of a spider/radar plot. The advantage of d3 is that it's very customizable, interactive and (in my opinion) the prettiest chart library for javascript.

在此输入图像描述

We use JFreeChart ( http://www.jfree.org/jfreechart ) library on server side successfuly in GWT application. JFreeChart brings us great flexibility to what could be rendered. The only major drawback is that it runs only on server side (JVM). You need special servlet for handling graph generations. On client side you should create eg img html element with special url passing either chart parameters or special token (for chart identification) returned in previous RPC (Ajax) call, invoked for chart processing.

This approach requires more work than using client-side charting library, but brings you possibility to tune up charts in future in the way you need. Please check JFreeChart Web Start Demo with sources - http://www.jfree.org/jfreechart/samples.html . For your use case there is one nice example - Spider Web Chart Demo - which is certainly possible to adopt for your requirements.

蜘蛛网图表演示1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM