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
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With