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 (100 views, 9.00 KB)



Similar Topics


Reading This Topic