divide by zero error

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
David Novo
Newbie
Newbie
Posts: 71
Joined: Fri Jul 02, 2004 4:00 am
Location: Culver City
Contact:

divide by zero error

Post by David Novo » Fri Jun 24, 2005 9:35 pm

Hello,

We allow our users to resize the charts. One of them went ahead and resized the chart to 0 width.

This causes a divide by zero error in:

TTeeCanvas3D.CalcPerspective

because chartRect.right-chartRect.left=0

you may want to fix this.

David Novo
Newbie
Newbie
Posts: 71
Joined: Fri Jul 02, 2004 4:00 am
Location: Culver City
Contact:

Post by David Novo » Fri Jun 24, 2005 9:56 pm

To solve this becomes part of a bigger issue. The way you have implemented the code, there does not seem to be a way to ask

"What size will the chartRect be given the current plot options, size etc."

The draw method gets called
then InternalCanvas.initWindow
then adjustChartBounds

So, before the chart is drawn for the first time, the chartRect is 0 width, but the draw method resizes it.

However, if the chartREct is really supposed to be 0, (lets say I have a really long legend, or make a really small plot) then the chartRect is still zero and does not get resized.

It would be great if you could break the resizing code and make a method called:

getNewChartRect which will return what the chartrect wil be when it is eventually recalculated.

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

Post by Narcís » Thu Jun 30, 2005 3:48 pm

Hi David,

Thanks for your suggestion. I've already added it to our wish-list to be considered for future releases.
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