Problem with loading template files
Problem with loading template files
Version
1.1.2531.28391
Steps to create problem: -
1/ Create a chart.
2/ Add a Bar Series.
3/ Add random data.
4/ Add a "Mark Tips" Tool from the TeeChart Editor Tools Section.
5/ Verify the tooltips are showing.
6/ Create a GetText handler for the Mark Tips tool.
7/ Verify the Mark Tips toll uses this handler.
8/ Now execute the following: -
this.tChart1.Export.Template.Save("test.ten");
this.tChart1.Import.Template.Load("test.ten");
You will find that when loading the template file, the chart still thinks it has the Mark Tips tool and the handler you created (which is what I expect), however, the handler is now never used. The only work around I could find was to delete the Mark Tips tool, recreate the handler and add it back again after loading.
Therefore I conclude, that when using the "Mark Tips" tool, the template file is incorrect.
1.1.2531.28391
Steps to create problem: -
1/ Create a chart.
2/ Add a Bar Series.
3/ Add random data.
4/ Add a "Mark Tips" Tool from the TeeChart Editor Tools Section.
5/ Verify the tooltips are showing.
6/ Create a GetText handler for the Mark Tips tool.
7/ Verify the Mark Tips toll uses this handler.
8/ Now execute the following: -
this.tChart1.Export.Template.Save("test.ten");
this.tChart1.Import.Template.Load("test.ten");
You will find that when loading the template file, the chart still thinks it has the Mark Tips tool and the handler you created (which is what I expect), however, the handler is now never used. The only work around I could find was to delete the Mark Tips tool, recreate the handler and add it back again after loading.
Therefore I conclude, that when using the "Mark Tips" tool, the template file is incorrect.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi VH1,
Event handlers are not exported with TeeChart. After importing a chart you should manually re-assign the events you wish to be used.
Event handlers are not exported with TeeChart. After importing a chart you should manually re-assign the events you wish to be used.
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 |
After loading, if I look at the Mark Tips tool object....
The GetText property is still populated with the correct information.
Please take a look at
GetText->
System.MulticastDelegate->
System. Delegate->
Method->
System.Reflection.RuntimeMethodInfo->
Name
This holds the name of the method which should be called for the GetText event handler. I agree TeeChart should not store the actual event handler in the template file, but merely a reference to it.
As far as I can see, this information is exactly what is required, however, it seems after loading it does not do anything with it anymore.
I am guessing there are some checks being made in the MarkTips tool object and for some reason it thinks it does not have the event reference anymore?
The GetText property is still populated with the correct information.
Please take a look at
GetText->
System.MulticastDelegate->
System. Delegate->
Method->
System.Reflection.RuntimeMethodInfo->
Name
This holds the name of the method which should be called for the GetText event handler. I agree TeeChart should not store the actual event handler in the template file, but merely a reference to it.
As far as I can see, this information is exactly what is required, however, it seems after loading it does not do anything with it anymore.
I am guessing there are some checks being made in the MarkTips tool object and for some reason it thinks it does not have the event reference anymore?
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi VH1,
Could you please send us a simple example project we can run "as-is" to reproduce the behaviour you're reporting here?
You can either post your files at news://www.steema.net/steema.public.attachments or at our upload page.
Thanks in advance.
Could you please send us a simple example project we can run "as-is" to reproduce the behaviour you're reporting here?
You can either post your files at news://www.steema.net/steema.public.attachments or at our upload page.
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 |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi VH1,
Thanks for the example.
After importing previously exported chart Marks display series Y values unless you reassign GetText event after importing the chart:
Thanks for the example.
After importing previously exported chart Marks display series Y values unless you reassign GetText event after importing the chart:
Code: Select all
foreach (Steema.TeeChart.Tools.MarksTip mt in tChart1.Tools)
{
mt.GetText += new Steema.TeeChart.Tools.MarksTipGetTextEventHandler(marksTip1_GetText_1);
}
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 |
Hello,
Hmmm....
Re.
The code appears to work on the test project you uploaded when added before the end of the button1_Click method. Only other change made to project was to update TeeChart reference to 1.1.2531.28391. Please check the TeeChart reference.
Regards,
Marc Meumann
Hmmm....
Re.
Code: Select all
foreach (Steema.TeeChart.Tools.MarksTip mt in tChart1.Tools)
{
mt.GetText += new Steema.TeeChart.Tools.MarksTipGetTextEventHandler(marksTip1_GetText_1);
}
The code appears to work on the test project you uploaded when added before the end of the button1_Click method. Only other change made to project was to update TeeChart reference to 1.1.2531.28391. Please check the TeeChart reference.
Regards,
Marc Meumann
Steema Support
Hmm, you are right, your code works...
However, as I did not want to change all Marktips tools I originally tried just...
And that did not work.
Code: Select all
foreach (Steema.TeeChart.Tools.MarksTip mt in tChart1.Tools)
{
mt.GetText += new Steema.TeeChart.Tools.MarksTipGetTextEventHandler(marksTip1_GetText_1);
}
Code: Select all
this.marksTip1.GetText += new Steema.TeeChart.Tools.MarksTipGetTextEventHandler(this.marksTip1_GetText);
Hi.
This is because the reference to this.marksTip1 is set to null after you load the chart. After load you cannot reference marksTip1 anymore .. that is, unless you reassign the variable as:
or alternatively, in your code reference tChart1.Tools[index] and not the marksTip1:
The same rule applies to chart Series.
This is because the reference to this.marksTip1 is set to null after you load the chart. After load you cannot reference marksTip1 anymore .. that is, unless you reassign the variable as:
Code: Select all
marksTip1 = tChart1.Tools[0] as MarksTip;
Code: Select all
(tChart1.Tools[0] as MarksTip).GetText += new Steema.TeeChart.Tools.MarksTipGetTextEventHandler(marksTip1_GetText_1);
Marjan Slatinek,
http://www.steema.com
http://www.steema.com