Is there a public library for Java (free) that can be used to display graphs (I am talking about discrete graphs - not bar charts, pie charts, etc...)?
-
Do you mean something like this jfree.org/index.htmlGustyWind– GustyWind2010-09-03 12:09:14 +00:00Commented Sep 3, 2010 at 12:09
-
ExtremeCoder, why don't you help yourself by naming examples of the kinds of graphs you want. Telling us what you don't want is necessary but not sufficient. X-Y plots of functions? Scatter plots? Renderings of statistical concepts? Help us help you.duffymo– duffymo2010-09-03 12:27:28 +00:00Commented Sep 3, 2010 at 12:27
7 Answers
The JUNG (Java Universal Network/Graph Framework) framework allows you to sample their various graphing layouts online. Here is a screen shot of the ShowLayouts2 demo:

Comments
JFreeChart is good.
And if laying out graphs is what you're after, I'd recommend AT&T's graphviz as an alternative. Give it the data and it lays out the graph for you.
5 Comments
If using Google's Chart API is an option, check out Charts4J.
I use it and have had no problems.
6 Comments
JFreeChart. The code is free. You have to pay for the authors docs, but there are plenty of examples around and it's pretty easy to learn to use.
2 Comments
Sorry, I misunderstood the question. The thing you are looking for is called JUNG - the Java universal network/graph library. It can store, display and calculate various metrics on sparse or dense graphs. The official site has excellent samples.
Quote from the website above:
"The JUNG architecture is designed to support a variety of representations of entities and their relations, such as directed and undirected graphs, multi-modal graphs, graphs with parallel edges, and hypergraphs. It provides a mechanism for annotating graphs, entities, and relations with metadata. This facilitates the creation of analytic tools for complex data sets that can examine the relations between entities as well as the metadata attached to each entity and relation."
1 Comment
There is a Graphviz library for Java at http://www2.research.att.com/~john/Grappa/. I have used Graphviz for a project in the past to draw graphs and I found it quite easy to use. If you are just looking for a server side solution, then you could just use a standard Graphviz distribution and send it the commands with the "dot" syntax that it uses.