Jump to content
Software FX Community

Inconsistent axis rescaling


User (Legacy)

Recommended Posts

Hi

I have encountered a strange problem and any points to its resolution will

be gratefully appreciated.

I have auto scale of chart fx client server on

for one chart I set data to the chart and get the following max and min just

before and after the closedata method:

Before:

Max: 179155.827392191

Min: -8887.94238969404

After:

Max: 200000

Min: -100000

For another set of data I get

Before:

Max: 162577.227222706

Min: -5637.20400744025

After:

Max: 170000

Min: -10000

Why doesn't the first min round to -10 000 but to -100 000 unlike the second

chart?

thanks

--

____________________________________

Paul Nailand

Visual Risk Pty Ltd

www.visualrisk.com

+61 (2) 9388 1370

+61 (0) 413 002 802

This email and any attachments is intended only for the person to whom

it is addressed. It may contain confidential information. If you receive

this document in error, please immediately delete it from your system

and notify the sender. You must not disclose, copy, use or rely on any

part of this document if you are not the intended recipient.

Link to comment
Share on other sites

I took me some time to realize what was happening here, I first though it

was a bug but this turned out to be false. Here is what's happening:

To determine de magnitude of your scale we take

log(Max-Min)

This us the number of digits of your range, we then round your Min and Max

to a multiple of this power of ten.

However, we have a limit, if the change represents more than 10% of the

scale, we round to the immediately lower power of 10.

For the data you are mentioning:

log(Max-Min) = 5

Therefore Chart FX is going to try to round to a multiple of 100,000,

however, for the second set of data (-5637.20400744025 to 162577.227222706),

since it is smaller, the 10% condition kicks in and therefore the Min and

Max are now rounded to 10,000.

So although it looks weird, it is doing it right, the reason for the 10%

condition is to prevent the scale from growing to a point where there is too

much unused space.

--

FP

Software FX, Inc.

Link to comment
Share on other sites

Hi

what does 10% of the scale mean. is there a default number of steps that

chartfx tries to create if step has not been set

thanks

Paul

> I took me some time to realize what was happening here, I first though it

> was a bug but this turned out to be false. Here is what's happening:

>

> To determine de magnitude of your scale we take

>

> log(Max-Min)

>

> This us the number of digits of your range, we then round your Min and Max

> to a multiple of this power of ten.

>

> However, we have a limit, if the change represents more than 10% of the

> scale, we round to the immediately lower power of 10.

>

> For the data you are mentioning:

>

> log(Max-Min) = 5

>

> Therefore Chart FX is going to try to round to a multiple of 100,000,

> however, for the second set of data (-5637.20400744025 to

162577.227222706),

> since it is smaller, the 10% condition kicks in and therefore the Min and

> Max are now rounded to 10,000.

>

> So although it looks weird, it is doing it right, the reason for the 10%

> condition is to prevent the scale from growing to a point where there is

too

> much unused space.

>

> --

> FP

> Software FX, Inc.

>

>

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...