Jump to content
Software FX Community

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


User (Legacy)
 Share

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...