ToolTips on WPF Alpha

TeeChart Beta versions
Post Reply
ITUser
Newbie
Newbie
Posts: 5
Joined: Fri Sep 07, 2007 12:00 am
Contact:

ToolTips on WPF Alpha

Post by ITUser » Mon Mar 10, 2008 6:09 pm

Using the following code:

Code: Select all

            
            Chart tChart = new Chart();
            tChart.ToolTip = new ToolTip { Content = "This tooltip does not show but should" };
When you mouse over the chart or a line or anything I do not get the tooltip poping up.

Is there a setting that I could be possibly missing?

Also would it not make some sense to attach tooltips per line instead of at the chart level. I noticed that Line and FastLine do not have a .ToolTip property.

Regards,
Michael Hohlios

Christopher
Site Admin
Site Admin
Posts: 1349
Joined: Thu Jan 01, 1970 12:00 am
Location: Riudellots de la Selva, Catalonia
Contact:

Re: ToolTips on WPF Alpha

Post by Christopher » Tue Mar 11, 2008 2:09 pm

Hello Michael,
Michael Hohlios wrote:Using the following code:
When you mouse over the chart or a line or anything I do not get the tooltip poping up.
No, I'm afraid TooTips were non-functional in the alpha version. This has since been improved.
Thank you!

Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/

ITUser
Newbie
Newbie
Posts: 5
Joined: Fri Sep 07, 2007 12:00 am
Contact:

Re: ToolTips on WPF Alpha

Post by ITUser » Wed Apr 02, 2008 3:16 pm

Chris wrote:Hello Michael,
Michael Hohlios wrote:Using the following code:
When you mouse over the chart or a line or anything I do not get the tooltip poping up.
No, I'm afraid TooTips were non-functional in the alpha version. This has since been improved.
Christopher,

So I am now playing around in the beta and I am still struggling with tooltips. I can get them to fire and display but not 100% of the time. It is sort of a random thing if the tooltip will actual display the data or not. Also I have noticed that once the tooltip is fired it just sticks there and so if I move to another line to pick up and display that lines data the tooltip just sticks in the old location. It used to move again to the location of the cursor when the new mouse over was fired.

Why doesn't the line control itself have a tooltip instead of the chart? Because it seems to be a slight problem when I have to attach the tooltip to the chart and then change the data inside of it each time I mouse over a line.

Is there another way that is recommended to do this sort of thing? I basically have taken ideas from our previous code base using TeeChart .Net and ported the ideas but it seems the ToolTip is the only thing I cannot get working correctly.

Regards
Michael Hohlios

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Apr 03, 2008 10:55 am

Hi Michael,

Yes, we are aware of that. This is strange but after a little while MarksTip tool stops working. When you move the mouse out of the window and enter it again it starts working again. We don't know which is the cause of this problem. In the meantime, we recommend you to use Annotation tools instead, for example:

Code: Select all

		public Window1()
		{
			InitializeComponent();
			InitializeChart();
		}

		private void InitializeChart()
		{
			Steema.TeeChart.Styles.Points points1 = new Steema.TeeChart.Styles.Points(tChart1.Chart);
			points1.FillSampleValues();

			//Steema.TeeChart.Tools.MarksTip mt1 = new Steema.TeeChart.Tools.MarksTip(tChart1.Chart);
			//mt1.Series = points1;
			//mt1.MouseAction = Steema.TeeChart.Tools.MarksTipMouseAction.Move;

			tChart1.MouseMove += new MouseEventHandler(tChart1_MouseMove);
		}

		void tChart1_MouseMove(object sender, MouseEventArgs e)
		{
			foreach (Steema.TeeChart.Styles.Series s in tChart1.Series)
			{
				Point p = e.GetPosition(tChart1.Chart.Parent.GetControl());
				int index = s.Clicked(p);

				tChart1.Tools.Clear();

				if (index != -1)
				{
					Steema.TeeChart.Tools.Annotation anno1 = new Steema.TeeChart.Tools.Annotation(tChart1.Chart);

					anno1.Text = s.YValues[index].ToString();
					anno1.Shape.CustomPosition = true;
					anno1.Shape.Left = p.X;
					anno1.Shape.Top = p.Y;
				} 
			}			
		}
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply