Hi,
I'm currently using TeeChart V6.01 with Borland C++ Builder 6 and am trying to change a chart title property during runtime. I have a chart added to my form at design time with a default title which is displayed without problem. However, during runtime the Title property of the chart is NULL so any access to it results in an EAccessViolation exception.
I'm trying to add the title using:
aChart->Title->Text->Add("myTitle");
I should add that I have tried explicitly calling the new operator on the chart (though I assume this is called already since the chart is design-time) without any success.
Also, I have tried to create an instance of a TChartTitle and assign to the chart but the new operator of the TChartTitle expects a TCustomChart object and my chart is a TChart type so it fails at link-time.
Any help much appreciated.
Runtime changes to Chart Title
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi rbarnes,
Have you tried type casting your TChart object to a TCustomChart?I should add that I have tried explicitly calling the new operator on the chart (though I assume this is called already since the chart is design-time) without any success.
Also, I have tried to create an instance of a TChartTitle and assign to the chart but the new operator of the TChartTitle expects a TCustomChart object and my chart is a TChart type so it fails at link-time.
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 |
I have just tried to cast to TCustomChart when instantiating a TChartTitle but still get an unresolved external linker error (it can't resolve the constructor for the TChartTitle). Am I missing a header/library file?
Also, why would the chart title property be NULL at runtime when I specify a default (design-time) title which is then displayed at runtime without problem? According to documentation, all I should need to do to edit the title is something like:
aChart->Title->Text->Clear();
aChart->Title->Text->Add("My Title");
Thanks
Richard
Also, why would the chart title property be NULL at runtime when I specify a default (design-time) title which is then displayed at runtime without problem? According to documentation, all I should need to do to edit the title is something like:
aChart->Title->Text->Clear();
aChart->Title->Text->Add("My Title");
Thanks
Richard
Hi Richard,
to edit/modify the Chart Title you can simply do :
Chart1->Title->Caption="My Chart Title";
Or, if you want to add more title lines, then you'll have to use :
Chart1->Title->Clear();
Chart1->Title->Text->Add("Title1");
Chart1->Title->Text->Add("Title2");
to edit/modify the Chart Title you can simply do :
Chart1->Title->Caption="My Chart Title";
Or, if you want to add more title lines, then you'll have to use :
Chart1->Title->Clear();
Chart1->Title->Text->Add("Title1");
Chart1->Title->Text->Add("Title2");
Pep Jorge
http://support.steema.com
http://support.steema.com
Hi,
Thanks for the response and apologies for the delay in my reply. I have tried what you suggest but it simply raises an EAccessViolation. Further inspection shows that the Title property of my chart is NULL even though it has a design-time value which is shown without problem. The problem is that I need to change the Title at run-time.
Any other ideas?
Many thanks
Richard
Thanks for the response and apologies for the delay in my reply. I have tried what you suggest but it simply raises an EAccessViolation. Further inspection shows that the Title property of my chart is NULL even though it has a design-time value which is shown without problem. The problem is that I need to change the Title at run-time.
Any other ideas?
Many thanks
Richard
Hi Richard,
which TeeChart Pro version are you using ?
Could you please send me a simple app with which I can reproduce as is the problem here ? (you can send me it directly to pep@steema.com).
which TeeChart Pro version are you using ?
Could you please send me a simple app with which I can reproduce as is the problem here ? (you can send me it directly to pep@steema.com).
Pep Jorge
http://support.steema.com
http://support.steema.com
Hi.
Are you by any chance using the "Build with the runtime packages" option ? If yes, then perhaps the problem is your project is referencing old (TeeChart Standard) packages. In this case all you must do is replace references to old TeeChart bpi/lib files wih version you use.
Are you by any chance using the "Build with the runtime packages" option ? If yes, then perhaps the problem is your project is referencing old (TeeChart Standard) packages. In this case all you must do is replace references to old TeeChart bpi/lib files wih version you use.
Marjan Slatinek,
http://www.steema.com
http://www.steema.com