How to make tooltips never leave until mouse move out

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
mks-ydi
Newbie
Newbie
Posts: 26
Joined: Mon Nov 10, 2008 12:00 am

How to make tooltips never leave until mouse move out

Post by mks-ydi » Wed Jan 14, 2009 9:13 am

Currently we can use AutoPopDelay to set the time that tooltips will stay. Is it possible to tooltips never leave until mouse move out ?

Thank you very much.

Regards,
Forest

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Post by Sandra » Wed Jan 14, 2009 10:50 am

Hello mks-ydi,


For the moment is not possible to use AutoPopDelay to set the time that tooltips will stay, why I recomended than you use Annotation tools.
You can use annotation tools, with events ClickSeries or MouseMove.

You can use this code for exemple:

Code: Select all

        private void tChart1_MouseMove(object sender, MouseEventArgs e)
        {
            int index = bar1.Clicked(e.X, e.Y);
           
            if (index != -1)
            {
                anotation1.Active = true;
                anotation1.Text = bar1.YValues[index].ToString();
                anotation1.Left = e.X;
                anotation1.Top = e.Y - anotation1.Height;
            }
            else
            {
                anotation1.Active = false;
            }
            
        }
I hope than my help is usefull for you.


Best Regards,
Sandra Pazos



Steema Support Central
http://support.steema.com

mks-ydi
Newbie
Newbie
Posts: 26
Joined: Mon Nov 10, 2008 12:00 am

Another problem

Post by mks-ydi » Thu Jan 15, 2009 7:43 am

Hello Sandra Pazos,
Your reply really help us. Thank you very much. But annotation has a problem. We usually put the chart in a container, and sometimes the annotation can not be totally displayed,hidden by the border and its outside region of the container. I mean it is not always on top as tooltips does. How can we do this?

Regards,
Forest

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Post by Sandra » Thu Jan 15, 2009 10:13 am

Hello mks-ydi,

We have found a way for your problem. You have used a very simple tooltip in the MouseEvent or SeriesClick, as you will see on next exemple:

Code: Select all

        private void tChart1_MouseMove(object sender, MouseEventArgs e)
        {
            int index = bar1.Clicked(e.X, e.Y);

            if (index != -1)
            {
                string tmpText = bar1.YValues[index].ToString();

                if (tChart1.Chart.ToolTip.Text != tmpText)
                {
                    tChart1.Chart.ToolTip.Text = tmpText;
                    tChart1.Chart.ToolTip.Show();
                }
            }
            else
            {
                tChart1.Chart.ToolTip.Hide();
            }
        }

I hope than this code help you.


Best Regards,
Sandra Pazos


Steema Support Central
http://support.steema.com

Post Reply