DBChart doesn't handle NaN values?

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
davealaw
Newbie
Newbie
Posts: 1
Joined: Tue May 14, 2013 12:00 am

DBChart doesn't handle NaN values?

Post by davealaw » Thu Sep 26, 2013 9:13 pm

I have a fairly complex chart with multi-series linked off a database and while it generally works as intended, when a value in the database is NaN I get an 'Invalid floating point operation' error when I try to show the chart and I cannot seem to find a way around it. I have a similar application that just uses a TChart and manually populates the series with AddXY and AddNullXY, which that works fine with NaN values. It would be a major rewrite and perhaps performance hit to have to use TChart rather than TDBChart. Looking at the DBChart source all the values appear to be entered in without any checks for nulls. Is this a flaw with the source? Is there a work-around?

Dave

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

Re: DBChart doesn't handle NaN values?

Post by Yeray » Fri Sep 27, 2013 11:13 am

Hi Dave,
davealaw wrote:Looking at the DBChart source all the values appear to be entered in without any checks for nulls. Is this a flaw with the source? Is there a work-around?
Right, we don't want to manipulate the sources or the numbers that are entered into the series. Note some customers may consider a NaN should be considered as a null, but others may want to consider them as a zero, skip adding them or any other behaviour. So we prefer to keep it open.
Then, the only way is to handle the NaNs yourself. I can think on two ways to do this:
- Modify the TeeChart sources so the NaNs are handled as you wish.
- Loop into the DataBase and add the values manually. Note TeeChart also loops the dataset to add the values to the series.
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