views:

368

answers:

6

I am looking for free java tool/library that provides drawing simple charts. Those chart supposed to be displayed as part of a web page (my application is running on Tomcat) and not thrugh swing (perhaps through Applet)

I found JFreechart but:
1. I am not convinced it is the right tool for my requirement (run not through swing) 2. It look like a free tool but to get explanation on how to get started with it you need to pay 40$ - and I even not sure that it fits my requirements.

So what do you know about this solution as well as other possible solutions?

+2  A: 

You can try JavaFX Charts. Than you can even animate the charts and do much more.

Chris-NTA
+5  A: 

this question could help you http://stackoverflow.com/questions/265777/what-is-the-best-open-source-java-charting-library-other-than-jfreechart

John Boker
Yes I would say this is a duplicate of that question
Shervin
+2  A: 

"not through swing (perhaps through Applet)"

You can use JApplet which is a swing component. JFreeChart can be used outside of Swing.

Not everyone uses JDK6 so you may not want to use JAVAFX related libraries, unless you are really in control.

You can do your work without the JFreeChart book but it's easier to get the book. There are few examples online(also the javadocs) and unless you're doing very sophisticated stuff, you'll be fine.

In my opinion, JFreeChart(with or without JasperReports) is probably the most used/known Open Source library for graphs in Java. JFreeChart is used by tons of Open Source and commercial companies.

John Doe
+1 Definitely possible to use JFreechart in a servlet environment and serve generated images (stream to output, or persist to local files) through HTTP interface.
Mads Hansen
A: 

Another option would be to use the Eclipse Business Intelligence Reporting Tools (Eclipse BIRT). It's an Open Source reporting framework that runs inside of a servlet container (e.g. Tomcat). You can use a database or XML files a sources for data and then build charts/reports/tables from the data.

Jeremy Raymond
+7  A: 

Seriously, you're not taking too much risks with JFreeChart (that can be used in a webapp, you can create an image map from a graph) which is a, no, the de facto standard for charting in Java and doesn't have any decent competitor. You're right about the fact the library is free and that the documentation isn't but the API Documentation is nice and free and it's not that hard to use. If really required, there are tutorials available on the web. Just google a bit.

However, if all this is really a problem and if you have simple needs, then have a look at jChart. But I'm not sure you'll find it better documented :) And really, it can't be compared with JFreeChart.

Another option would be to use Google Chart API if you have an Internet connection and if you don't mind sending charting datas to Google. The nice thing with this option is that google will take care of the rendering and save you a few CPU cycles. If this is an option, I would consider using charts4j, a Java API to generate URLs for the Google Chart API (it hides the complexity of these URLs).

Finally, did you consider using a Flash Charting API? I'd recommend Open Flash Chart which just looks uber sweet, has libraries for Java, js, php, ruby, python, perl, etc. etc. and uses JSON and is therefore AJAX compatible. Another good one is Yahoo!'s YUI charting component. But I prefer Open Flash Chart.

Pascal Thivent
+1 for Google Charts API, which fits the asker's scenario I think.
Grundlefleck
+1  A: 

It's easy to get started with JFreeChart using just the free demos; each API page links to the corresponding source. A the same time, the developer guide is excellent; I've surely paid more and gotten less elswhere.

Disclaimer: I'm a satisfied customer and occasional contributor.

trashgod