method Clear() on Series does not work

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
bernard
Newbie
Newbie
Posts: 1
Joined: Tue Mar 04, 2003 5:00 am
Contact:

method Clear() on Series does not work

Post by bernard » Thu May 28, 2009 2:04 pm

I am using C++Builder6 and TeeChartPro6 for Builder6.

I have a problem using the Clear() method on a Series : it does not work.
The Series is never cleared.
If I try to add new Values after clearing the Series, I have the old values + the new values.

Delete() does not work either.

There is something wrong but I dont know where.

Thanks for your help.

Following very simple code with a button that clear the Series and Add new Values.

//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop

#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Button1Click(TObject *Sender)
{
Series1->Clear();

for(int i=0;i<8;i++) {
Series1->AddBar(random(20), i ,clBlue);
}

}

Thanks,

Bernard.

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Post by Yeray » Thu May 28, 2009 2:25 pm

Hi Bernard,

I've tested with the following code and everything seems to work as expected. Could you please try it?

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
    series1: TBar3DSeries;
begin
  series1 := TBar3DSeries.Create(self);
  Chart1.AddSeries(series1);

  for i:=1 to 50 do
    Series1.AddBar(random(20),i,clBlue);

  Series1.Clear;

  for i:=1 to 3 do
    Series1.AddBar(random(20),i,clBlue);
end;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply