Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JUNG (Java Graph): How to prevent Vertex- and Edge-Labels from overlapping?

Tags:

java

graph

label

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!

like image 496
theomega Avatar asked Sep 14 '09 16:09

theomega


1 Answers

You just need to set the label offset:

vv.getRenderContext().setLabelOffset(20);

Where vv is your VisualizationViewer object.

like image 126
Emaad Ahmed Manzoor Avatar answered Sep 18 '22 17:09

Emaad Ahmed Manzoor