Jump to content
Software FX Community

Change ToolTip for the Axis Label


Ronak
 Share

Recommended Posts

Hi,

 As you can see the below file. When ever i put mouse over any lable on Y axis it shows that name in ToolTip...

I want to change it such a way instead of the Name of the Task it shows me path also.

 

on Y axis i have Tasks : Pinal, Test1, Test2, Test3 ..path for each task is unique and i have them in one string array..

 How can i append path to the name of task for the tooltips..When i put the mouse over the label in Y axis it shoulw display something like this

 

Test1

Path: C:\Dev\Test1 

Link to comment
Share on other sites

This doen't completely solve your question, but I think it is a start in the right direction.  I was able to change the Tooltip for when the mouse hovers over the axes, but I can't determine which axis label it hovers over.

 Anyway, add an event handler for you chart's GetTip event.

private void chart1_GetTip(object sender, GetTipEventArgs e){ System.Diagnostics.Debug.WriteLine(e.Object.ToString() + " " + e.Text + " " + e.HitType.ToString() + " " + e.Series.ToString() + " " + e.Point); //if (e.HitType == HitType.Axis) if (e.Object.ToString().Equals("Main X Axis")) {   e.Text = "C:\MyPath\ " + e.Text; }}

As you can see the e.Text always came out as "X Axis".  You will probably need to determine the mouse coordinates yourself on the mouse move event.  Then perform you own HitTest like routine to determine which label it was over.  If you use the GetAxisLabel event you could store all the labels to an array and then once you've determined the location of the mouse to the chart just index the array for the proper label.

 Hope this helps.

Link to comment
Share on other sites

Hi DennisV,

 

Thanks for your help.. This is exactly what i was looking for meanwhile. When i tried to get the e.Point value it always comes -1. I really need it inorder to map the LabelName with Path .. as in my Graph the Same Label Name e.g. Test1 can appear more than one. So, I need the point value for each lable in order to identify them properly. Is there any way to know that Test1 is on Axis X at Point 0.. Test2 is on Axis X at Point 1 when i put the mouse over them using the GetTips event. 

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...