how to show tooltip of more than one node at once??

Mar 8, 2010 at 9:02 AM

Hi,

When the user select, say, 3 nodes and hover on one node, currently we only get the tooltip for the node the user is hovering.

What we want to do is to show tooltip for other two selected node as well.

Is it possible or not?

Thanks in advance.

pasa

Mar 8, 2010 at 3:57 PM

Pasa:

Yes, although you'll have to do the actual tooltip drawing with some custom code.  Try this:

1. Set NodeXLControl.ShowVertexToolTips to false.  That will turn off the built-in tooltip drawing.

2. Handle the VertexMouseHover event.  In your event handler, read the SelectedVertices property.  Create a Visual object for each selected vertex and draw the Visual objects on top of the NodeXLControl, using Vertex.Location to place them.  There are several ways to draw them.  You can add them to the container that contains the NodeXLControl, making sure to give the Visual objects a higher Z-order than the NodeXLControl, or you can use NodeXLControl.GraphDrawer.AddVisualOnTopOfGraph() to let the NodeXLControl do the work.

3. Handle the VertexMouseLeave event.  In your event handler, remove your tooltips.  If you used NodeXLControl.GraphDrawer.AddVisualOnTopOfGraph() to draw them, use NodeXLControl.GraphDrawer.RemoveVisualFromTopOfGraph() to remove them.

I haven't actually tried this.  It's sort of an unusual requirement.

-- Tony

 

Mar 8, 2010 at 9:05 PM

Another option, perhaps easier:

1. Set NodeXLControl.ShowVertexToolTips to true.

2.  Handle the PreviewVertexToolTipShown event.  In your event handler, create a single Visual the size of the NodeXLControl and set the VertexToolTipShownEventArgs.VertexToolTip property to your Visual.  The Visual should be transparent, except for some boxes you draw to represent the tooltips, one box per selected vertex.  The NodeXLControl will draw your Visual on top of the graph, and because most of your Visual is transparent, you'll see the graph overlaid with your boxes.  The NodeXLControl will automatically take care of hiding the Visual when the tooltip times out.

-- Tony

Jan 24, 2012 at 4:09 PM

Hi Tony,

I have a related question - can I change the default duration for the tooltip?  Or, am I going to have to go the route of handling VertexHover and VertexLeave, if I want the tooltip to stay "indefinitely" until the mouse leaves.

Brian

Jan 24, 2012 at 4:30 PM

Brian:

Starting with version 1.0.1.196 of NodeXL, vertex tooltips stay on the screen for 60 minutes.  (It was five seconds in previous versions.)  The NodeXLControl does not expose a public property for this.  If you need it to be something other than 60 minutes, you will have to add a line to the source code (I can give you that line) and recompile it.

I've made a note to add a public property for this in a future version.

-- Tony

Jan 24, 2012 at 8:11 PM

Perfect. Thanks, I had only updated to 195.

On Jan 24, 2012 11:30 AM, "tcap479" <notifications@codeplex.com> wrote:

From: tcap479

Brian:

Starting with version 1.0.1.196 of NodeXL, vertex tooltips stay on the screen for 60 minutes. (It was five seconds in previous versions.) The NodeXLControl does not expose a public property for this. If you need it to be something other than 60 minutes, you will have to add a line to the source code (I can give you that line) and recompile it.

I've made a note to add a public property for this in a future version.

-- Tony

Read the full discussion online.

To add a post to this discussion, reply to this email (NodeXL@discussions.codeplex.com)

To start a new discussion for this project, email NodeXL@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com