142

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.

fccoelho
  • 6,012
  • 10
  • 55
  • 67

10 Answers10

59

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 if you search for them.

Bill the Lizard
  • 398,270
  • 210
  • 566
  • 880
  • 2
    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 Nov 06 '08 at 08:08
  • 4
    for some things (high-speed mathematical plotting) jfreechart is mediocre, not awesome. – Jason S Jul 02 '13 at 16:00
  • @JasonS What do you use for that? – Bill the Lizard Jul 02 '13 at 17:12
  • 2
    I don't, not in Java. I found JChart2D better than JFreeChart, but it had its limitations as well; for one project I ended up making my own graphing library, a painful experience but it did what I needed. I wish that a port of Python's matplotlib were available in Java. – Jason S Jul 02 '13 at 22:08
  • 9
    yes downloading the developer's guide for $65.00.... – Totty.js Jul 11 '13 at 16:28
  • 2
    Calling JFreeChart "awesome" is overstating it. "Awesome for simple stuff" might be more accurate. +1 for a matplotlib clone for Java – garyp Aug 16 '13 at 20:09
  • Tutorial link is dead. – funkybro Aug 18 '14 at 14:23
  • @JasonS, I'm not sure how "high-speed" you're talking about. I have integrated JFreeChart into our application doing mathematical simulates. The simulation engine is really fast and we plot the plots in real time and are able to update dozens of graphs (each with 2-6 line plots) as the user adjusts parameters by dragging their fingers across the trackpad over the parameter to change the value in real time. There is zero lag and a high enough frame rate that it's smooth as butter. Is that high-speed mathematical plotting? Of course it's now 2021, but we've been doing this since 2010. – Jason Oct 09 '21 at 22:00
  • My complaint about JFreeChart is that the charts are ugly. This is of course an opinion. The font's are pixelated or blurry (antialiasing is poor) and same with the lines. The library is not taking advantage of the resolution available to it while other parts of Java are and drawing beautiful fonts and lines. The contrast is stark making the JFreeChart graphics look like they're from the 1990's while the rest of the application looks modern. – Jason Oct 09 '21 at 22:04
  • Output from things like Google's Chart API are incredibly beautiful compared to JFreeChart, but this is not integrated locally... it would be a remote service. – Jason Oct 09 '21 at 22:05
  • Tried to install it, it's completely broken and old – Mouvre Oct 11 '21 at 16:20
  • @Mouvre This question and answer are from 2008. – Bill the Lizard Oct 11 '21 at 16:30
  • I have since updated my JFreeChart library to the latest version, which has support for HiDPI displays. I may have made a few other changes. The pixelation and blurry fonts are now gone and things look much better. I still think Google's charts look better, but the graphs drawn in JFreeChart in my application are no longer ugly in my opinion. So I retract my statement about the charts being ugly. – Jason Jan 24 '22 at 19:49
58

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.

Flow
  • 23,572
  • 15
  • 99
  • 156
Julien Chastang
  • 17,592
  • 12
  • 63
  • 89
15

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
  • 1
  • 1
  • 2
  • 1
    I know it is too late, but I am searching for documentation, not able to find one. Can you please share, if you have anything? – varunrao321 Feb 04 '13 at 14:40
  • 2
    Check out iceberg charts : http://frontangle.com/icharts/ I created it. I think its up there with JFreechart and all the rest. – Oliver Watkins Aug 13 '16 at 15:30
14

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
  • 53,737
  • 19
  • 129
  • 165
  • I created a simple "plot" wrapper around java chart construction kit, which makes it really easy to use for simple plots https://bitbucket.org/hughperkins/easyjcckit – Hugh Perkins Oct 18 '12 at 07:24
6

You can try Jzy3d. It helps drawing simple 3d charts (surfaces, scatters, bars, etc), and has lot of options for customizing layout of axes, ticks, etc. There are lot of examples and a documentation on the wiki.

It's free and open source.

Cheers,

Martin

rjdkolb
  • 10,377
  • 11
  • 69
  • 89
Martin Pernollet
  • 2,285
  • 1
  • 28
  • 39
5

For dynamic 2D charts, I have been using JChart2D. It's fast, simple, and being updated regularly. The author has been quick to respond to my one bug report and few feature requests. We, at our company, prefer it over JFreeChart because it was designed for dynamic use, unlike JFreeChart.

Poik
  • 2,022
  • 27
  • 44
4

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:

https://github.com/jgraph/jgraphx

drac_o
  • 427
  • 5
  • 11
BoboTheCodeMonkey
  • 1,157
  • 1
  • 10
  • 18
4

There is a new charting library in town: JChartlib JChartLib http://freshmeat.net/projects/jchartlib

suvi
  • 1
  • 1
  • It looks great!! Lightweight and no dependencies, wow, nice work. I took a look at the the wiki, pretty straightforward. My question: does it allow categories instead of numeric values on the X axis? – Gigab0rt Sep 19 '11 at 22:26
  • 2
    Wow, cool thanks for comment. The number of series are actually not limited in the linecharts. It draws as many charts as you like. I just released a new version that is able to save the chart to a jpg or png file. More chart type like barchart, cakechart, radarchart and so on are in the planning. – suvi Sep 23 '11 at 15:02
  • okay, let me try this one before it getting old... :D – gumuruh Jun 26 '12 at 13:08
  • It's GPL. Please can you make it LGPL? (Or Apache 2, or MPL) – Hugh Perkins Oct 18 '12 at 04:06
  • The main reason why I would consider using a different charting library other than jfreechart is that it would be nice to have a charting library that is (i) maintained by a community (ii) has decent documentation about how to use it available for free. Unfortunately jchartlib offers no advantage on either of these points :-( – Hugh Perkins Oct 18 '12 at 05:43
2

I found this framework: jensoft sw2d, free for non commercial use (dual licensing)

http://www.jensoft.org

regards.

sebastien
  • 1
  • 1
  • 2
    This site mentions that sw2d is licensed using the LGPL; isn't that free to use in both open-source and commercial tools? – Ewan Heming Sep 11 '12 at 22:31
1

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
  • 776
  • 1
  • 8
  • 17