TDBChart with boolean fields

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Skaw
Newbie
Newbie
Posts: 5
Joined: Tue Mar 23, 2004 5:00 am
Location: spain
Contact:

TDBChart with boolean fields

Post by Skaw » Sun Mar 11, 2007 1:19 pm

Hello,

i have dataset with datetime,boolean and other float values and i wish to show the dataset using tdbchart.

Is there a way to intercept (via on...) the painting of the boolean values to set my own values?

for example:

if value=true then xvalue := maxvalue
else xvalue := 0

Best regards
ilde

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Mar 12, 2007 9:25 am

Hi ilde,

Yes, you can do something like this:

Code: Select all

  for i:=0 to NumValues - 1 do
   if YourData[i] then
      Series1.Add(maxvalue)
   else
      Series1.Add(0);
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Skaw
Newbie
Newbie
Posts: 5
Joined: Tue Mar 23, 2004 5:00 am
Location: spain
Contact:

Post by Skaw » Mon Mar 12, 2007 12:22 pm

ok, thank you

but, is there a way to intercept the automatic add from the dataset and where could i do that?

i would not like to use add manually every time the dataset changes.

Best regards
ilde

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Mar 12, 2007 2:31 pm

Hi ilde,

To refresh your chart's data when the datasource changes you can call Series.CheckDataSource method. However, TeeChart won't handle boolean fields automatically. So, in that case, you'll have to loop through your dataset and manually process boolean fields.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply