Page 1 of 1

Markers on Chart

Posted: Wed Aug 03, 2005 3:35 pm
by 9637256
Hi All,

Can someone point me to an example or the documentation for adding a marker to a chart. I am trying to implement adding 1, 2, or 3 markers and the functions move marker to min, max, and taking the delta between markers.

Thanks,

Terry

Posted: Thu Aug 04, 2005 8:51 am
by Miguel
Hi Terry,

If I understand you correctly, what you need is adding a custom text at some location inside the chart... This can be done through the Annotation tool and you can see some examples in the features demo of TeeChart (see All features / Tools / Annotation).

If you need further help, please do not hesitate to contact us again.

Markers on Chart

Posted: Thu Aug 04, 2005 2:37 pm
by 9637256
Sorry, I guess I was not clear. A "marker" must be an overloaded term.

In my case I would like to put a graphical object (a marker) on a data point on a trace and have it display the data at that point. As the trace moves the "marker" moves and reads out the new data point. I would like to be able to move the marker to a different data point (and have it read that data point out) and give the user a button to press that will move the marker to the minimum or maximum value on the trace.

There are typically 1 or 2 markers on a trace at a time. When there are two markers I need to be able to display the different between the values of the trace where the markers are.

This type of functionality is prevelant on electronic instruments that are measureing electronic signals.

Thanks,

Terry

Posted: Fri Aug 05, 2005 10:30 am
by Chris
Hi Terry,

I think we could be talking about the same thing here. Does the following code so something similar to what you're looking for?

Code: Select all

	private Steema.TeeChart.Styles.FastLine fastLine1;
		private Steema.TeeChart.Tools.Annotation mark1;
		
		private void InitializeChart() 
		{
			tChart1.Aspect.View3D = false;
			tChart1.Legend.Visible = false;
			fastLine1 = new Steema.TeeChart.Styles.FastLine(tChart1.Chart);
			mark1 = new Steema.TeeChart.Tools.Annotation(tChart1.Chart);
			timer1.Enabled = true;
			timer1.Interval = 500;
			mark1.Shape.CustomPosition = true;
			
		}

		private int count = new int();
		private Random rnd = new Random();

		private void timer1_Tick(object sender, System.EventArgs e)
		{
			count++;
			fastLine1.Add(count, rnd.Next(100));
			double maxX = fastLine1.XValues.Maximum;
			tChart1.Axes.Bottom.SetMinMax(maxX - 10, maxX);

			mark1.Text = fastLine1.YValues.Last.ToString();
			mark1.Left = fastLine1.CalcXPos(fastLine1.Count - 1) - 75;
			mark1.Top = fastLine1.CalcYPos(fastLine1.Count - 1);
		}

Thanks

Posted: Wed Aug 10, 2005 4:11 pm
by 9637256
Thanks for your help guys, this is doing it.