views:

428

answers:

7

Is it possible that anyone has a link to a graph class/library that I can use to produce a graph in Java?

Thanks for any help!

+1  A: 

JFreeChart.

JRL
+1  A: 

Visual graph: JFreeChart

You may also wish to consider the Google Charts API, if you can make web service requests.

Stefan Kendall
+2  A: 

I used JGraph as a visualizer for networks of nodes/topologies at my previous job, it's not half bad once you get past the architecture (it's a big state machine if I recall correctly).

JasonWyatt
A: 

graphviz would be my choice. It's not Java, but still terrific and easy to use.

There is a Java component that works with dot to generate graphs. I've used it - very nice, indeed.

duffymo
+2  A: 

My top choice would be JGraph as others have suggested; I am using JGraph5 because it is better documented than the newer alternative, JGraphX.

JGraph

Other alternatives I've researched:

JGraphT

"JGraphT is a free Java graph library that provides mathematical graph-theory objects and algorithms...complete source code included, under the terms of the GNU Lesser General Public License." (http://jgrapht.sourceforge.net/)

JUNG - Java Universal Network/Graph Framework

Main project repository

yEd Graph Editor

I82Much
This is contingent on you actually meaning Graph as in mathematical graph; if you mean charts, then like the others suggest, JFreeChart is the way to go.
I82Much
A: 

I would recommend JGraphT. I used it to create multi-leveled graphs in my dissertation and as the base of a GPS Routing Software, understanding what is going on I found a bit of a mind bender, but once looking at how the algorithms package works I found it quite easy to implement A*/D* heuristic algorithms. For working out the distance between nodes on the graph I'd also recommend looking at the Haversine function, if that's your thing.

Mark Iliffe
A: 

A really good alternative is to used the Google Charts API. Platform independent, easy to use, and fast processing (done on Google Server side)

Lastnico