Remove Series from chart without freeing that same series
Posted: Thu Oct 30, 2008 7:17 pm
Hi
I have some objetcs that have Series in it. Because i need to used them on multiple charts. When i delete them from a chart, it free it at the same time but i need to keep it. So how can i bypass that. Maybe im not doing it right to add/delete them so this is my simple code.
Adding
Deleting
When i use Clear, it clear all series but free them too.
I have some objetcs that have Series in it. Because i need to used them on multiple charts. When i delete them from a chart, it free it at the same time but i need to keep it. So how can i bypass that. Maybe im not doing it right to add/delete them so this is my simple code.
Adding
Code: Select all
MyObject.MySerie := TLineSeries.Create(Nil); //Nil as Owner should mean -> i will free it Myself.
//Populate my serie
Chart.AddSeries(MyObject.MySerie);
Code: Select all
Chart.SeriesList.Clear;