How to print the group's name?

Jun 4, 2013 at 12:52 PM
Dear tcap479, when I lay out each of the group in its own box, how can I print the group's name
in the empty area of this box by using API(so that groups can be seen with half an eye )?
Jun 4, 2013 at 10:13 PM
When you create your GroupInfo objects that specify which vertices are in which groups, set the GroupInfo.Label property to the text you want to appear in the middle of the box. The NodeXL drawing code should then draw the labels you specified.

-- Tony
Jun 7, 2013 at 11:57 AM
But how to change the font size and location of group's label?
Jun 7, 2013 at 4:30 PM
Edited Jun 7, 2013 at 5:04 PM
To set the group label font size:
nodeXLControl.GraphDrawer.GroupDrawer.SetFont(Typeface typeface, Double fontSize)
To change the group label location:
nodeXLControl.GraphDrawer.GroupDrawer.LabelPosition = VertexLabelPosition.TopRight (for example)
-- Tony
Aug 30, 2013 at 5:17 PM
How can I know the location of each box, I want to output the group's name in the bottom of each box.
Sep 2, 2013 at 5:03 PM
Can't you just do the following and let NodeXL do all the work? It's not clear to me why you would want to draw the group labels yourself.
nodeXLControl.GraphDrawer.GroupDrawer.LabelPosition = VertexLabelPosition.BottomCenter;
-- Tony
Oct 22, 2013 at 12:15 AM
How do I print some text in the unique main form without in case of no group?
Oct 22, 2013 at 4:26 AM
Do you mean that you would like to add a label to the box that is reserved for vertices that are not part of a group? There isn't a direct way to do that. Group labels can only be applied to groups, and the "ungrouped vertices" box is not a group.

But can you manually add your ungrouped vertices to a fake group just for display purposes, and then give that fake group a label? The ungrouped vertex box will then become a "fake-group" box and it will look just like it did before, the only difference being that you can now give it a label.

If I misunderstood your question, please clarify what you need to know.

-- Tony
Oct 23, 2013 at 3:55 PM
Before I use group algorithms all vertices are plotted on the main form. At this time there is no groups unless you treat all vertices as a unnamed group (ungrouped vertices). I will try according to your method.
Oct 23, 2013 at 5:51 PM
Edited Oct 23, 2013 at 5:51 PM
Aha, so I did misunderstand you. I was misled by this discussion's name, which is "How to print the group's name?"

To add a label to the entire graph pane, you might try using NodeXLControl.GraphDrawer.AddVisualOnTopOfGraph() to add a WPF Label control to the top of the graph. I haven't tried it, but it ought to work.

An alternative is to add a "fake" vertex to the graph, give it a small size to make the vertex invisible, annotate it with a label using the ReservedMetadataKeys.PerVertexLabel key, place it in the middle of the graph pane by setting its Location, and locking it in place using the ReservedMetadataKeys.LockVertexLocation key. (I haven't tried that, either.)

-- Tony