Saving & Loading TeeChart defaults
Saving & Loading TeeChart defaults
I would like for the end user to define the look of there chart using the build in Edit Chart functions. I can save and load OK but when I try to added data after loading the Series1 is no longer defind ie the pointer to Series1 is Null. How do I redefine this so that it will works as it did before loading.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi bing,
You have 2 options here:
1. Using series index in the chart's series collection, for example:
2. Assigning each series to the variable you want after loading the chart, eg.:
You have 2 options here:
1. Using series index in the chart's series collection, for example:
Code: Select all
Chart1[0].Color:=clRed;
Code: Select all
Series1:=Chart1[0];
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 |
Hi Narcís
I don't think you have understood if I load a previously save chart series into a current chart the series defined by the loaded graph has a NULL pointer. I can't add new data to the graph.
I added the following lines into the demo progam in the Export SVG to test this as part of your demo software
the line Series1->FillSampleValues(); Cause a violation error why???
if i put a watch variable onto Series1 than before load it has a valid pointer after load it has a NULL pointer
Barry
I don't think you have understood if I load a previously save chart series into a current chart the series defined by the loaded graph has a NULL pointer. I can't add new data to the graph.
I added the following lines into the demo progam in the Export SVG to test this as part of your demo software
Code: Select all
//---------------------------------------------------------------------------
void __fastcall TSVGExportForm::Button3Click(TObject *Sender)
{
SaveChartDialog(Chart1);
if (OpenDialog1->Execute())
LoadChartFromFile(dynamic_cast<TCustomChart*>(Chart1),OpenDialog1->FileName);
Series1->FillSampleValues();
}
if i put a watch variable onto Series1 than before load it has a valid pointer after load it has a NULL pointer
Barry
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Barry,
Yes, that's the problem I tried to explain you. In that case, before calling FillSampleValues you need to do this:
or alternativelly use this:
Hope this helps!
Yes, that's the problem I tried to explain you. In that case, before calling FillSampleValues you need to do this:
Code: Select all
Series1=Chart1->Series[0];
Code: Select all
Chart1->Series[0]->FillSampleValues();
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 |