Hi,
Either I got confused or I'm overworked or something...
When I get an event from an Annotation object, I can query the Chart object from the Annotation object - but how do I get the matching TChart object???
Best,
Michal Blazejczyk
TChart versus Chart
-
- Newbie
- Posts: 64
- Joined: Fri Jun 16, 2006 12:00 am
TChart versus Chart
Best,
Michal Blazejczyk
Lead Programmer
Genome Quebec
Michal Blazejczyk
Lead Programmer
Genome Quebec
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Michal,
In v2 there is no way to find the 'container' of the chart class. For v3, IChart, which is internal in the v2 sources, has been public and you'll be able to do something like this:
In v2 there is no way to find the 'container' of the chart class. For v3, IChart, which is internal in the v2 sources, has been public and you'll be able to do something like this:
Code: Select all
IChart iChart = annotation1.Chart.Parent as IChart;
IContainer container = iChart.GetContainer();.
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 |
-
- Newbie
- Posts: 64
- Joined: Fri Jun 16, 2006 12:00 am
Hi,
What I would like to know is how to get a TChart from a Chart:
Best,
Michal
What I would like to know is how to get a TChart from a Chart:
Code: Select all
TChart tChart = annotation1.Chart.???;
Michal
Best,
Michal Blazejczyk
Lead Programmer
Genome Quebec
Michal Blazejczyk
Lead Programmer
Genome Quebec
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Michal,
This is not possible because annotation.Chart.Parent can be either a TChart or a WebChart. This is why IChart was published, IChart is an interface where TChart and WebChart inherit from. Once you get IChart you can obtain several properties as shown in the snippet above.
This is not possible because annotation.Chart.Parent can be either a TChart or a WebChart. This is why IChart was published, IChart is an interface where TChart and WebChart inherit from. Once you get IChart you can obtain several properties as shown in the snippet above.
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 |
-
- Newbie
- Posts: 64
- Joined: Fri Jun 16, 2006 12:00 am
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Michal,
Yes, for example this will work:
Yes, for example this will work:
Code: Select all
Annotation anno1 = new Annotation(tChart1.Chart);
anno1.Text = "hello";
IChart ichart = anno1.Chart.Parent;
TChart tchart;
if (ichart is TChart)
{
tchart = ichart as TChart;
tchart.Header.Text = "hello";
}
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 |