views:

166

answers:

4

I want to use Pie, Bar, Line charts in java. What is the best API to use them? Is there any API by Sun to create these types of charts?

+9  A: 

take a look at JFreeChart.. it's not by SUN but it's quite notorious (and by the way I don't think JDK ships with any kind of graph API)

Jack
JFreeChart is quite easy to use.
Jeff Storey
do we need to purchase any licence for that? or is it free?
Mandar
@Mandar Nothing on the site seems to say anything about buying, and it's hosted on SourceForge, so I'm gonna assume it's free.
Slokun
"It is distributed under the terms of the GNU Lesser General Public Licence": http://www.gnu.org/licenses/lgpl.html
trashgod
+1  A: 

Use jFreeChart

"JFreeChart is "open source" or, more specifically, free software. It is distributed under the terms of the GNU Lesser General Public Licence (LGPL), which permits use in proprietary applications."

Stefan S
A: 

JFreeChart is free to use, and there are numerous "simple" examples on their website, as well as API documentation.

If it's useful to you, and if you start using anything more than really basic graphs, you might consider purchasing the full documentation with more detailed examples and guides on how to use it to the max of its power. It will certainly boost your productivity and also help to support the project.

Bastien
+1  A: 

Use JFreeChart like everyone who responded suggested or if that doesn't work for you check this SO question:
what-is-the-best-open-source-java-charting-library-other-than-jfreechart

mjh2007