Profile Picture

How to autosize the edges to contain text

Posted By Sandor Nagy 14 Years Ago
Author
Message
Sandor Nagy
questionmark Posted 14 Years Ago
View Quick Profile
Forum Newbie

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
Last Active: 14 Years Ago
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 (101 views, 9.00 KB)
Nevron Support
Posted 14 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: 2 days ago @ 1:54 AM
Posts: 3,054, Visits: 4,009

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
Posted 14 Years Ago
View Quick Profile
Forum Newbie

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
Last Active: 14 Years Ago
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



Similar Topics


Reading This Topic