Thursday, December 31, 2009

Flex: DateTimeAxis and ColumnChart components

I love flex. It is a framework where you can do great things, however there are a number of "gotchas" as with every framework. Not necessarily a bad thing, so long as it is documented properly. This is what I found when using the ColumnChart component within the data-visualization framework of flex in combination with the DateTimeAxis for the xField. I had an object using the following structure:
public class MyChartItem {
    public var time:Number;
    public var amount:int;
Notice that one of the properties represents the current time. It's represented by a numeric field (Number type). This model should allow for an exact representations of time when serializing a remote object back to its counterpart in ActionScript.