Jump to content
Software FX Community

Error: "Floating Point division by zero" when adding arrays with all zero values


User (Legacy)

Recommended Posts

The error occurs on

CfxFASDisArray : CfxDataArray;

ChartInst : TChartFXCS;

ChartFXCS4.GetExternalData(CfxFundArray.InterfacePtr,0);

How can I check the max and min of the values if the values are not known to

the ChartFXCS4 until after the GetExternalData call which cause the error?

If I set the max scale to 100 before the GetExternalDate call does the call

then reset the max to the max in the arrays?

I entered this code but the error still occurs:

(the conditions for the if statements are never true)

if (ChartInst.Axis[AXIS_Y].Min = ChartInst.Axis[AXIS_Y].Max) then

ChartInst.Axis[AXIS_Y].Max := 100;

if (ChartInst.Axis[AXIS_X].Min = ChartInst.Axis[AXIS_X].Max) then

ChartInst.Axis[AXIS_X].Max := 10;

ChartInst.GetExternalData(CfxFASDisArray.InterfacePtr,0);

Thanks for you help,

Stacy

"SoftwareFX Support" <noreply@softwarefx.com> wrote in message

news:<5c$2wXmMFHA.1660@webserver3.softwarefx.com>...

> Yes you can but you have to give Chart FX a scale (Min and Max), otherwise

> you end up with no scale (from 0 to 0). After setting your data you can

do:

>

> if (chart.Min = chart.Max) Then

> chart.Max := 100; // Or any arbitrary value you want to display when

> this condition happens.

>

> --

> FP

> Software FX

Link to comment
Share on other sites

You must have this code:

if (ChartInst.Axis[AXIS_Y].Min = ChartInst.Axis[AXIS_Y].Max) then

ChartInst.Axis[AXIS_Y].Max := 100;

if (ChartInst.Axis[AXIS_X].Min = ChartInst.Axis[AXIS_X].Max) then

ChartInst.Axis[AXIS_X].Max := 10;

AFTER you read the data, not before, the values of Min and Max are

overridden by GetExternalData so these lines before GetExternal data have no

effect whatsoever.

--

FP

Software FX

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...