tags:

views:

199

answers:

1

I have a value object something like this

public class Data
{

    public var date:Date;
    public var value:int;

            ...

    public function get formattedDate():String
    {
        return date.getDay()+"."date.getMonth()+"."+date.getYear();
    }

}

When I use the 'date' field for the category axis everything is fine but when I change that to the 'formattedDate' it doesn't work (the axis has no labels). Any ideas why this isn't working?

A: 

Watch types. When you use 'date' you get Number type result. When you use 'formattedDate' you get String type result. You have to return Number type also using 'formattedDate'.

koziy
Actually you don't have to do that. Since it's just a label you can return any type you want (all types in ActionScript have a toString() method)
pablochan