How to autosize the edges to contain text


Author
Message
Sandor Nagy
Sandor Nagy
Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)
Group: Forum Members
Posts: 7, Visits: 1
Hi,
The suggested LayerSpacing controls the distance between all of the vertices.
How can I set the minimum distance between two vertices? Or can I set a margin around just one vertex?

Thanks,
Sandor Nagy
Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K

Hi,

the edges cannot be sized to their text. Their size depens entirely on the distance between the shapes they connect and the type of the edge.

In your case, you can simply increase the LayerSpacing property of the Layered Graph Layout.



Best Regards,
Nevron Support Team


Sandor Nagy
Sandor Nagy
Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)
Group: Forum Members
Posts: 7, Visits: 1
Hi,
I'm using the NGraphDataSourceImporter class to import vertices and edges. For the layout I'm using NLayeredGraphLayout.

In the event of a vertex is imported (NGraphDataSourceImporter.VertexImported) I set the text of the vertex then I call the NShape.SizeToText(New NMarginsF(10)) method to resize automatically the vertex based on its content.

I try the same in case of edges (in the NGraphDataSourceImporter.EdgeImported event). Here is my code:
Private Sub OnEdgeImported(ByVal importer As NDataSourceImporter, ByVal shape As NShape, ByVal dataRecord As INDataRecord)
Dim text As Object = dataRecord.GetColumnValue("LinkTitle")
shape.Text = text.ToString()
Dim label As NLogicalLineLabel = CType(shape.Labels.GetChildAt(0), NLogicalLineLabel)
label.UseLineOrientation = True
shape.SizeToText(New NMarginsF(10))
End Sub
But this is not resizes the edge (see the attached screenshot)

How can I resize automaticaly the edged?

Thanks,
Sandor Nagy

Attachments
edge.png (117 views, 9.00 KB)
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search