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?
Bar Chart Click Event?
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
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.
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 |
Instructions - How to post in this forum |