Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

histograms and function graphs with java swing

Is there any predefined component in Java Swing that allow to draw histograms or functions graphs?

If there is not. Does anyone know a good open-source library with a license that is not GPL2.0/3.0 ? ( I need any product licensed under MIT/Apache/Eclipse/LGpl licenses).

thanks in advance

like image 321
Heisenbug Avatar asked Dec 21 '22 13:12

Heisenbug


2 Answers

JFreeChart is a popular Java library with which you can make all kinds of charts, including histograms and function graphs. It's licensed with the LGPL license.

Something that I find a little annoying with JFreeChart is that you have to pay for their Developer Guide, and that you have to pay for each user of that guide separately (i.e. one developer can't legally lend his copy to another developer, unless you buy a more expensive site license). API documentation is available for free though.

like image 160
Jesper Avatar answered Jan 09 '23 11:01

Jesper


For a general purpose graphing library, try out Batik SVG Toolkit (Apache license). With Batik, you can embed any kind of SVG graphics into your Swing applications, including histograms and function graphcs. For Swing-specific documentation, see "Batik Swing Components".

Drawing histograms and function graphs in SVG is rather trivial. The histogram example you linked from Wikipedia for instance is an SVG file and can be viewed with Batik.

like image 41
jsalonen Avatar answered Jan 09 '23 11:01

jsalonen