Page 1 of 1

How to add marks on stack colunms bars graph

Posted: Sun Nov 02, 2008 9:45 am
by 9092401
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

Posted: Mon Nov 03, 2008 10:57 am
by narcis
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);
			}