I want to make my application respond to clicks on the series in the chart.
I have made event handlers like this
foreach (Steema.TeeChart.Styles.Series S in this.Chart.Series)
S.Click +=new MouseEventHandler(S_Click);
but when I click on the series, the S_Click() method is never called, except from when clicking on the last added series.
Am I doing something wrong here?
Thanks
Alan
Only the last series triggers the Click event
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Alan,
It works fine for me here using the latest TeeChart for .NET v2 maintenance release and this code:
Which TeeChart version are you using?
It works fine for me here using the latest TeeChart for .NET v2 maintenance release and this code:
Code: Select all
private void Form1_Load(object sender, EventArgs e)
{
for (int i = 0; i < 5; i++)
{
tChart1.Series.Add(new Steema.TeeChart.Styles.Line());
}
foreach (Steema.TeeChart.Styles.Series s in tChart1.Series)
{
s.FillSampleValues();
s.Click += new MouseEventHandler(s_Click);
}
}
void s_Click(object sender, MouseEventArgs e)
{
Steema.TeeChart.Styles.Series s = (Steema.TeeChart.Styles.Series)sender;
label1.Text = tChart1.Series.IndexOf(s).ToString();
}
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 |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Alan,
The code I posted also works fine for me here using the latest TeeChart for .NET v1 release available at the client area. Are you using the latest version available, which is Build 1.1.2531.28391 from 6th December 2006?
The code I posted also works fine for me here using the latest TeeChart for .NET v1 release available at the client area. Are you using the latest version available, which is Build 1.1.2531.28391 from 6th December 2006?
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 |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Alan,
Have you tried running the example I posted? Does it work at your end? If the problem persists please send us a simple example project we can run "as-is" to reproduce the problem here.
You can post your files either at news://www.steema.net/steema.public.attachments newsgroup or at our download page at http://www.steema.net/upload/.
Thanks in advance.
Have you tried running the example I posted? Does it work at your end? If the problem persists please send us a simple example project we can run "as-is" to reproduce the problem here.
You can post your files either at news://www.steema.net/steema.public.attachments newsgroup or at our download page at http://www.steema.net/upload/.
Thanks in advance.
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 |