BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

RemoveAllSeries doesn't dispose Series... why not?

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Reporting-Charting
View previous topic :: View next topic  
Author Message
Jan-Willem Bats
Guest





PostPosted: Wed May 16, 2007 3:24 pm    Post subject: RemoveAllSeries doesn't dispose Series... why not? Reply with quote



Dear Support,

I am using RemoveAllSeries() to remove all the series from my chart.

Right after doing so, I reload the same data again and give them the same
Series names.

Then I get an EComponentError saying there's already a component with the
name Series25 (this is the name of the first Series in the data I'm
reading).

I have to manually remove the chart components before it will work the way I
want it to.

I wrote this in order to realize the desired functionality:

void __fastcall TfrmChart::removeAndDisposeAllSeries(){
vector<TChartSeries*> series;

// fill vector with all series
for (int i = 0; i < chart->SeriesCount(); i++){
series.push_back(chart->Series[i]);
}

chart->RemoveAllSeries();

// remove components manually using the series vector
for (int i = 0; i < series.size(); i++){
chart->RemoveComponent(series.at(i));
}
}


The docs say that RemoveAllSeries removes them but doesn't free them up.

Why not? Why does it work this way?

Why isn't there a RemoveAllSeries(bool dispose) method for the cases where
you *really* want to get rid of your Series?

Sincerely,

Jay
Back to top
Narcís Calvet
Guest





PostPosted: Wed May 16, 2007 3:39 pm    Post subject: Re: RemoveAllSeries doesn't dispose Series... why not? Reply with quote



Hi Jay

Jan-Willem Bats wrote:
Quote:
Dear Support,

I am using RemoveAllSeries() to remove all the series from my chart.

Right after doing so, I reload the same data again and give them the
same Series names.

Then I get an EComponentError saying there's already a component with
the name Series25 (this is the name of the first Series in the data
I'm reading).

I have to manually remove the chart components before it will work
the way I want it to.

I wrote this in order to realize the desired functionality:

void __fastcall TfrmChart::removeAndDisposeAllSeries(){
vector<TChartSeries*> series;

// fill vector with all series
for (int i = 0; i < chart->SeriesCount(); i++){
series.push_back(chart->Series[i]);
}

chart->RemoveAllSeries();

// remove components manually using the series vector
for (int i = 0; i < series.size(); i++){
chart->RemoveComponent(series.at(i));
}
}


The docs say that RemoveAllSeries removes them but doesn't free them
up.
Why not? Why does it work this way?

Why isn't there a RemoveAllSeries(bool dispose) method for the cases
where you *really* want to get rid of your Series?

In that case try using:

Chart1->FreeAllSeries();


--
Best Regards,

Narcis Calvet
Steema Support Central
http://support.steema.com

"Important note: If you are a TeeChart registered customer, please post your
support questions at Steema's Support monitored Forums for customers:
http://support.steema.com for a prompter reply."
Back to top
Marjan Slatinek
Guest





PostPosted: Thu May 17, 2007 8:13 am    Post subject: Re: RemoveAllSeries doesn't dispose Series... why not? Reply with quote



Hi, Jan-Willem Bats.

The RemoveAllSeries() only "disconnects" series from chart (sets series
ParentChart property to NULL) and does not actually free series. To free all
series connected to specific chart, use the following code:

tChart1->FreeAllSeries();

Regards,
Marjan Slatinek
www.steema.com

"Jan-Willem Bats" <jwbats (AT) observator (DOT) com> wrote in message
news:464adbfc (AT) newsgroups (DOT) borland.com...
Quote:
Dear Support,

I am using RemoveAllSeries() to remove all the series from my chart.

Right after doing so, I reload the same data again and give them the same
Series names.

Then I get an EComponentError saying there's already a component with the
name Series25 (this is the name of the first Series in the data I'm
reading).

I have to manually remove the chart components before it will work the way
I want it to.

I wrote this in order to realize the desired functionality:

void __fastcall TfrmChart::removeAndDisposeAllSeries(){
vector<TChartSeries*> series;

// fill vector with all series
for (int i = 0; i < chart->SeriesCount(); i++){
series.push_back(chart->Series[i]);
}

chart->RemoveAllSeries();

// remove components manually using the series vector
for (int i = 0; i < series.size(); i++){
chart->RemoveComponent(series.at(i));
}
}


The docs say that RemoveAllSeries removes them but doesn't free them up.

Why not? Why does it work this way?

Why isn't there a RemoveAllSeries(bool dispose) method for the cases where
you *really* want to get rid of your Series?

Sincerely,

Jay
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Reporting-Charting All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.