Index

From: Narcís Calvet  Steema Software
Subject: Re: TChart at runtime questions?
Date: Tue, 13 Jun 2006 11:32:22 +0200
Newsgroups: steema.public.teechart7.cppbuilder  public.teechart5.cppbuilder  

Hi Cenk,

You can do something like the code snippet below. Every time you click
Button1 a new line series will be added to DBChart1 with 124 points and a
different color from the other series. You can also remove one series or all
of them using the code in Button2 and Button3.

void __fastcall TForm1::Button1Click(TObject *Sender)
{
//Add one line series to the DBChart and populate it with 124 points
DBChart1->AddSeries(new TLineSeries(this));
DBChart1->Series[DBChart1->SeriesCount()-1]->FillSampleValues(124);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button2Click(TObject *Sender)
{
//Remove all series in the chart
DBChart1->RemoveAllSeries();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button3Click(TObject *Sender)
{
//Remove one specific series in the chart
DBChart1->RemoveSeries(0);
}


--
Best Regards,

Narcís 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."



Cenk wrote:
> Hi,
>
> I wrote a financial application (with borland c++) and i wanna use
> TChart in my application. Lets say i have a DB of 124 datas and in the
> applicaiton, i use some financial function to calculate those datas
> and at the end i wanna, show those datas on a chart. What i wanna do
> is,
> 1- add series on runtime ( one at a time)
> 2- Those series have to be on the same chart
> 3- they should be in different colors
> 4- they can be erased from the chart
>
> Would you please help me?
>
> thanks in advance