I’m currently using Jung to draw graphs (I really mean graphs not charts!). The problem is that Vertex and Edge Labels are overlapping with the Vertexes and the Edges. This leads into strange looking graphs. The Problem is not bound to a specific Layout-Algorithm (though I’ve been using FRLayout).
Are there any possibilities to tell JUNG to prevent these overlappings? I hoped this is already implemented and the only problem is to find the right options!
(The following answer assumes Jung2; I’m not familiar with pre-Jung2).
One of Jung’s strengths is that it is very extensible, and easily extended. Jung allows you to plug in various transformers (simple rendering properties), renderers (more complex rendering), and so forth, to customize the behavior when the default isn’t quite right. These are typically installed on the RenderContext (which you can get from your VisualizationViewer).
On the flip side, its drawbacks are its complexity and lack of decent documentation. If you’re going to do any moderate to heavy customization, you’ll need to dig into the Jung source.
For example, the vertex label rendering can be customized by plugging in a new vertex label renderer (Renderer.VertexLabel interface). For example, you can instantiate BasicVertexLabelRenderer and specifying a different position (north, west, center, etc.). You could put your label at the center, if you are willing to change the shape into something larger than that circle (to do so, install your own vertex shape transformer — an instance of Transformer). Alternatively, you could create your own custom implementation of this interface which renders a background under the label text.
You could also install your own tweaked version of Renderer.EdgeLabel (see Jung’s BasicEdgeLabelRenderer) to customize the positioning of the edge label.