Page 1 of 1

TDBChart with boolean fields

Posted: Sun Mar 11, 2007 1:19 pm
by 9336589
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

Posted: Mon Mar 12, 2007 9:25 am
by narcis
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);

Posted: Mon Mar 12, 2007 12:22 pm
by 9336589
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

Posted: Mon Mar 12, 2007 2:31 pm
by narcis
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.