With Delphi 7 and Teechart Pro 7.12.
I have a Teechart with TPieSeries in my application and I get an access violation on the application exit.
my serie creation:
Chart1.SeriesList.Clear;
tmpSeries := TPieSeries.Create(Chart1);
TPieSeries(tmpSeries).Circled := true;
tmpSeries.ParentChart := Chart1;
tmpSeries.Add(10,'bob', clBlue);
tmpSeries.Add(25,'brico', clOlive);
I think it lacks a simple initialization or else but I'm unable to find what is it. Can someone help me?
problem with TPieSeries
Seems like I must use Chart1.FreeAllSeries instead of Chart1.serieList.clear because TChartSeriesList doesn't override the TList Clear procedure (so it just free the list's Items but FreeAllSeries set every series parentChart attribute to nil).
I try to add :
procedure TChartSeriesList.Clear;
var t : Integer;
begin
for t:=0 to Count-1 do Items[t].ParentChart:=nil;
inherited;
end;
in TeEngine.pas and it seems I have no longer AVs...
It would be nice if someone could check this. Thanks.
I try to add :
procedure TChartSeriesList.Clear;
var t : Integer;
begin
for t:=0 to Count-1 do Items[t].ParentChart:=nil;
inherited;
end;
in TeEngine.pas and it seems I have no longer AVs...
It would be nice if someone could check this. Thanks.
Hi,
yes, the best way would be to do :
Using it I don't get AV's here.
yes, the best way would be to do :
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
var tmpSeries: TPieSeries;
begin
Chart1.FreeAllSeries(nill);
tmpSeries := TPieSeries.Create(Chart1);
TPieSeries(tmpSeries).Circled := true;
tmpSeries.ParentChart := Chart1;
tmpSeries.Add(10,'bob', clBlue);
tmpSeries.Add(25,'brico', clOlive);
end;
Pep Jorge
http://support.steema.com
http://support.steema.com