Vaxis

5 views
Skip to first unread message

vince

unread,
Aug 19, 2011, 4:49:33 PM8/19/11
to Axiis
when max value for Vaxis is a small number such as 1, the label on y-
axis will be repeated in this pattern, 1, 1, 1, ... 0, 0, 0. Pattern
such as 1, 0.9, 0.8 etc. should be shown instead.

jwk

unread,
Aug 19, 2011, 5:58:51 PM8/19/11
to Axiis
Use a label function on your axis and a number formatter, like so:

private function yAxisLabel(obj:Object):String
{
return yAxisFormatter.format(obj);
}

<mx:NumberFormatter id="yAxisFormatter" precision="1"
useThousandsSeparator="true" />
<axis:VAxis id="yAxis" labelFunction="{yAxisLabel}"/>

vince

unread,
Aug 19, 2011, 9:49:09 PM8/19/11
to Axiis
Thanks for the quick feedback!

With your code, I still see two issues.
1. some labels appear twice with certain size of the chart
2. With smaller size of the chart (when resized), with the same
distance on y-axis, the label will show 1.0, 0.6, 0.3, 0.0. In other
words, the gap will be 0.4 or 0.3 with the same distance. I hope you
know what I am talking about.

vince

unread,
Aug 19, 2011, 10:33:55 PM8/19/11
to Axiis
I think I need to set the precision higher to avoid the numbers
repetition issue. Thanks!
Reply all
Reply to author
Forward
0 new messages