6 Replies Latest reply on Jul 10, 2008 3:20 PM by spacehog

# Using Abs on y-axis

I am trying to remove the "-" sign on my y-axis, but it doesn't seem to be working. This is the function:

private function absValue(value:Number):Number{
var absValue:Number = Math.abs(value);
return absValue;
}

And I am calling it from my linearaxis tag:

<mx:verticalAxis>
</mx:verticalAxis>
• ###### 1. Re: Using Abs on y-axis
How about using a NumberFormatter with the useNegativeSign="false" property?
• ###### 2. Re: Using Abs on y-axis
The issue with useNegativeSign is that when it is set to false negative numbers appear in parens.
• ###### 3. Re: Using Abs on y-axis
This may help:
• ###### 4. Re: Using Abs on y-axis
Brilliant!!!

Unfortunately, it did what I expected (at least in my chart). All my data is negative. I have inverted the y-axis on my chart so that the lowest numbers are the highest points (i.e. a value of 1 is the highest peak on the chart). I am doing this to show rankings. I achieve this by using negative numbers.

What I would like to do is mask the y-axis so that the minus sign disappears, but the numbers stay in an inverted order. I am trying to think if there is a way to do a string manipulation on the y-axis and strip the "-" sign.

So far every tutorial I have read has the same results; once the "-" is removed Flex looks at the numbers as positive and re-orders them.

• ###### 5. Re: Using Abs on y-axis
Hmmm... my chart retains its negative value. Can you possibly post simplified yet complete code including your data so I can see what you see?
• ###### 6. Re: Using Abs on y-axis
OK, I'm dyslexic. I have been looking at this chart for so long I think I flipped the y-axis back in my brain.