How to add marks on stack colunms bars graph

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
qcrnd
Advanced
Posts: 214
Joined: Mon Sep 04, 2006 12:00 am

How to add marks on stack colunms bars graph

Post by qcrnd » Sun Nov 02, 2008 9:45 am

Hello,

I have a graph with Stack Columns bars.
I want to add a permanent mark on the top of the bar with the total number of the bar ,and to add a different mark, that will be shown by Mouse Hover event and will show only the number of the selected area.

Can you please advice what is the best way to do it ?

Thank you

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

Post by Narcís » Mon Nov 03, 2008 10:57 am

Hello qcrnd,

In that case I'd use Annotation tools for the sum values and MarksTip tool for each value mark. You can use Annotations like this:

Code: Select all

			tChart1.Draw();

			for (int i = 0; i < line1.Count; i++)
			{
				Steema.TeeChart.Tools.Annotation annotation1 = new Steema.TeeChart.Tools.Annotation(tChart1.Chart);
				double tmp = 0;

				for (int j = 0; j < tChart1.Series.Count; j++)
				{
					tmp += tChart1[j].YValues[i];
				}

				annotation1.Text = tmp.ToString();
				annotation1.Shape.CustomPosition = true;
				annotation1.Shape.Left = line1.CalcXPos(i);
				annotation1.Shape.Top = line1.CalcYPos(i);
			}
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