views:

6138

answers:

6

Why are there not more opensource easy to use charting libraries for Java?. The only successful opensource project in this area seems to be jfreechart, and it doesn't even have any documentation or examples available.

+3  A: 

There is JChart which is all open source. I'm not sure exactly what you are graphing and how you are graphing it (servlets, swing, etc) so I would say just look at a couple different ones and see which works for you.

http://sourceforge.net/projects/jchart/

I've also used JGraph but I've only used their commercial version. They do offer an open source version however:

http://www.jgraph.com/

BoboTheCodeMonkey
+7  A: 

There aren't a lot of them because they would be in competition with JFreeChart, and it's awesome. You can get documentation and examples by downloading the developer's guide. There are also tons of free online tutorials like this one, if you just search for them.

Bill the Lizard
One very useful contribution to jfreechart was a simple API That would allow you the generate a plot with a simple function call like so: plot(array) and get a chart object in return which you could futher customize, i.e. add a title, gridlines, etc...
fccoelho
+4  A: 

There is charts4j which is a charts and graphs API. It enables developers to programmatically create the charts available in the Google Chart API through a straightforward and intuitive Java API.

Disclaimer: I wrote charts4j. We will be doing another major release in the next few weeks.

Julien Chastang
Good job! The only downside is the need for an internet conection, though I cant remenber when was the last time I was disconnected.;-)
fccoelho
@pyinsci: some shops prevent servers from connecting to external internet servers (even if the servers are reachable from the internet) for security reasons.
Joachim Sauer
+1  A: 

Good question, I was just looking for alternatives to JFreeChart myself the other day. JFreeChart is excellent and very comprehensive, I've used it on several projects. My recent problem was that it meant adding 1.6mb of libraries to a 50kb applet, so I was looking for something smaller.

The JFreeChart FAQ itself lists alternatives. Compared to JFreeChart, most of them are pretty basic, and some pretty ugly. The most promising seem to be the Java Chart Construction Kit and OpenChart2.

I also found EasyCharts, which is a commercial product but seemingly free to use in some circumstances.

In the end, I went back to the tried and trusted JFreeChart and used Proguard to butcher it into a more manageable size.

I suggest that you take another look at JFreeChart. The user guide is only available to buy, but the demo shows what is possible and it's pretty easy to work out how from the API documentation. Basically you start with the ChartFactory static methods and plug the resultant JFreeChart object into a ChartPanel to display it. If you get stuck, I'm sure you'll get some quick answers to your problems on StackOverflow.

Dan Dyer
A: 

I've used EasyCharts in the past and it lived up to it's name. It's not as powerful as JFreeChart, but the JAR for EasyCharts is much smaller than for JFreeChart.

mjh2007
A: 

EasyCharts is commercial so i couldn't use it for my project. I used the GRAL graphing library instead. I found it very easy to customize and it's licensed under LGPL just like JFreeChart, so you can use it for free:

http://trac.erichseifert.de/gral

Rick