views:

1597

answers:

6

Can anyone recommend a good Java library for supporting charts and graphs. Timeseries, Histograms (bar charts) and fan charts are especially important.

Also useful is real flexibility to combine charts and extend with new types of chart (for example, if you wanted to write Fan charts.

+18  A: 

JFreeChart is among the best ones. And it's free. http://www.jfree.org/jfreechart/

Oh, and it's one of the very few ones that can make decent scientific plots. Usually these plotting packages are just for financial pie and bar charts.

Joonas Pulakka
JFreeChart is really one of the best, but the free documentation is not that good. If you're in a serious project I would recommend buying their book and getting access to the samples source code. It is an invaluable resource.
Handerson
I agree. By supporting the author by about 40 EUR (price per developer), you get a good 750 page manual (pdf) and excellent demo source code.
Joonas Pulakka
Beward: JFreeChart cannot be used for real-time rendering. When you ask it to repaint part of the screen it repaints *everything* which is very slow.
Gili
This is true. Can anyone recommend some comparable real-time library?
Joonas Pulakka
Actually this is such an important question, that I started a new thread: http://stackoverflow.com/questions/555804/real-time-java-graph-chart-library
Joonas Pulakka
+4  A: 

We've had a lot of experience with BIRT and consider it a very good solution. In fact, our company has built it into quite a few of our products. It has the same non-restrictive license as Eclipse itself.

Although it can be used as just a charting library, it's actually a very powerful report generation library which can connect to to JDBC sources and automatically render the data to reports and charts.

It comes with the latest Eclipse and the plug-in is quite easy to use (drag-n-drop) and can be deployed to a web server for proper web reporting or incorporated into a standalone Java application.

paxdiablo
For the general quality of the answer could you edit to add a link (I know anyone can google).
Nick Fortescue
+1  A: 

I have used ChartDirector for the last 5 years which has a Java version (my experience has been using it with ASP, and playing with the Python version).

Dan
A: 

I agree with mad-j regarding JFreeChart, we've implemented it in our application. You'd have all the source too, so you can hack and slash to your heart's content.

Neil McKeown
A: 

I also back up JFreeChart, for its ease of use, availability of code and an amazing support forum where the project lead is constantly answering questions.

Zabbala
+2  A: 

I would like to recommend my Java charts library, charts4j. It is a Java wrapper to the Google Chart API, and can be considered a cloud-computing solution to building charts and graphs from Java. Some features:

  • Supports nearly all features of the Google Chart API
  • Hides the ugly details of creating the URL parameters that are necessary for communicating with the Google Chart API
  • Can be incorporated into any Internet enabled Swing or web application environment (JSP/Servlet, GWT, Spring MVC, etc.)
  • 100% pure core Java solution. No need for special graphics libraries, etc.
  • Lightweight. Only one 160Kb jar and an Internet connection required
  • Well documented
  • Best of all, it is FREE!

The Google Chart API does support concentric pie charts which are similar to fan charts.

Julien Chastang