Page 1 of 1

divide by zero error

Posted: Fri Jun 24, 2005 9:35 pm
by 9338026
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.

Posted: Fri Jun 24, 2005 9:56 pm
by 9338026
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.

Posted: Thu Jun 30, 2005 3:48 pm
by narcis
Hi David,

Thanks for your suggestion. I've already added it to our wish-list to be considered for future releases.