Bar Chart Click Event?

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
phil1995
Newbie
Newbie
Posts: 31
Joined: Fri Dec 16, 2005 12:00 am
Location: Hattiesburg, Ms.
Contact:

Bar Chart Click Event?

Post by phil1995 » Mon Jan 16, 2006 4:14 pm

Is there a way to use a click event when clicking on a bar series in a bar chart?

For example, I have a bar chart showing the number of Apples, Oranges, and Banannas. Can I click on the apples bar and have it take me to my apple inventory section?

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 Jan 16, 2006 5:25 pm

Hi phil1995,

Yes, you can use Clicked method in the bar series Click event as shown below to retrieve which point was clicked in the series and do whatever you need related to that value.

Code: Select all

		private void Form1_Load(object sender, System.EventArgs e)
		{
			bar1.Add(25,"Bannana");
			bar1.Add(30,"Orange");
			bar1.Add(40,"Apple");
		}

		private void bar1_Click(object sender, System.Windows.Forms.MouseEventArgs e)
		{
			Form2 currentForm = new Form2();
			currentForm.Text=bar1.Labels[bar1.Clicked(e.X,e.Y)];
			currentForm.Show();
		}
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