Markers on Chart

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Terry
Newbie
Newbie
Posts: 9
Joined: Wed Jun 22, 2005 4:00 am
Location: California

Markers on Chart

Post by Terry » Wed Aug 03, 2005 3:35 pm

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

Miguel
Site Admin
Site Admin
Posts: 12
Joined: Thu Jul 28, 2005 4:00 am
Location: Barcelona
Contact:

Post by Miguel » Thu Aug 04, 2005 8:51 am

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.
Best regards
Miguel Espinosa

Steema Software
http://support.steema.com

Terry
Newbie
Newbie
Posts: 9
Joined: Wed Jun 22, 2005 4:00 am
Location: California

Markers on Chart

Post by Terry » Thu Aug 04, 2005 2:37 pm

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

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

Post by Christopher » Fri Aug 05, 2005 10:30 am

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);
		}
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/

Terry
Newbie
Newbie
Posts: 9
Joined: Wed Jun 22, 2005 4:00 am
Location: California

Thanks

Post by Terry » Wed Aug 10, 2005 4:11 pm

Thanks for your help guys, this is doing it.

Post Reply