8 Replies Latest reply on Jun 4, 2009 10:14 AM by _Natasha_

Finding LinearAxis max when using autoAdjust

I am using a LinearAxis with autoAdjust set to true so that the min and max are calculated.  But how do I get those values?  After I create the chart, the axes still report a 0 for both min and max values.  How do I find that calculated ones?

• 1. Re: Finding LinearAxis max when using autoAdjust

Hi,

minimum and maximum values should be available. Check that you've added data to your chart and all calculations ended before you try to get values.

• 2. Re: Finding LinearAxis max when using autoAdjust

You're right, I was mistaken about the minimum and maximum getting set, however, I am still having a problem.  The axis I am querying runs from 0 to 2800 on the chart, but when I check the values I get:

minimum = -12.189

maxiumum = 2800

So max is correct, but min should be zero.  Why is that not correct?

• 3. Re: Finding LinearAxis max when using autoAdjust

And what minimum value have you seen?

May be there is a free space between begining and first point.

You should understand that min and max is only a min and max of visible axis. It's not a lowest and greatest value in your data. If you need precise values of min and max in your data you should calculate it yourself.

• 4. Re: Finding LinearAxis max when using autoAdjust

I printed out all the values and the minimum is actually 0.06.

I actually only want to find the min and max of the axis, not of my data.  So for instance 2800 is good for the max even though my max data isn't that high.  The min should be 0 since that's what it shows on the chart.  I just want to allow the user to set the min and max as overrides, via text fields, but when I initialize the fields, the min is coming out to that odd negative value.

I also have another graph were the max is 0.0000134 on the chart, but the axis.maximum value comes back as 0.000013399999999999999.  So even the max is not always the same.

• 5. Re: Finding LinearAxis max when using autoAdjust

I also tried computedMinimum and computedMaximum but neither of these had the right value either...

• 6. Re: Finding LinearAxis max when using autoAdjust

This seems like it shouldn't be a very difficult problem.  Does anyone know what would be causing max and min to return the wrong values?

• 7. Re: Finding LinearAxis max when using autoAdjust

Simply I cann't understand why do you think that it's wrong value.

If you don't like format with many digits you can round value and show it to the user.

If you whant to get to a user ability to change minimum and maximum values of axis you can't use auto detecting max and min. So for the first values you can get computed values.

• 8. Re: Finding LinearAxis max when using autoAdjust

The values from maxiumum and minimum are different from what is displayed visually on the chart.  I just want to get the values flex is using on the chart, i.e. 0 for min and 2800 for max.  How do I get what flex is displaying?  I'm not using a labelfunction or anything special to truncate the axis numbers so I would hope that the axis could return the same value it is using to display.