Page 1 of 1

How to hide the marktool text?

Posted: Mon Mar 06, 2006 11:31 am
by 9788742
I am using marksTip tool in my tchart to display the data point on the series.
Now the problem is, when the user clicks on the series the data point values are displayed.
Now I have another context (button) in my application on click of which the data point displayed should go away and user should be able to other things.
I tried doing marksTip.Active = false on click of button, but this does not hide or remove the data point that is already displayed. This code only ensures that the next click on the series will not result in display of data point, but how do I hide/remove the already shown data point?

Posted: Tue Mar 07, 2006 12:45 pm
by narcis
Hi Lakshmi,

To achieve what you request you'd better use an annotation tool and some code like:

Code: Select all

		private void Form1_Load(object sender, System.EventArgs e)
		{
			points1.FillSampleValues();
			annotation1.Active=false;
		}

		private void SetCallout(int AIndex)
		{
			// Change annotation text
			annotation1.Text="Point: "+AIndex.ToString()+"\r\n"+
				"Value: "+points1.ValueMarkText(AIndex);

			// Re-position annotation callout
			annotation1.Callout.XPosition=points1.CalcXPos(AIndex);
			annotation1.Callout.YPosition=points1.CalcYPos(AIndex);
			annotation1.Callout.ZPosition=0;
		}

		private void points1_Click(object sender, System.Windows.Forms.MouseEventArgs e)
		{
			annotation1.Active=true;
			annotation1.Callout.Arrow.Visible=true;

			SetCallout(points1.Clicked(e.X,e.Y));
		}

		private void points1_MouseLeave(object sender, System.EventArgs e)
		{
			annotation1.Active=false;
		}