Challenge: How to efficiently fill data gaps in an sparse Flex ArrayCollection?
I have an ArrayCollection of Objects. Each Object with three attributes: CustomerID, Income and Date My goal is to chart this data for each customer (or a couple together) in a Income by Date LineChart display. Selection of customers is done with ArrayCollection filters. Data is fetched from an SQL database, however, each customer has some data points missing. If there was zero income on August 8, 2010 there will be no entry for that. Charting the ArrayCollection as is, is misleading because there is no indication of the missing data points.
One way to solve this is t开发者_开发知识库o artificially add zero points for the missing dates for each customer. However, this would explode the data set (and impact performance). Can anyone help with correctly charting this sparse ArrayCollection without adding a lot redundant data points?
Thanks for helping!
The compromise I choose is to fill out the gaps specifically for the customers in display. At init() I build an index for each customer entry by the date. When displaying customer data I go through the index, identify missing dates and fill them out in the ArrayCollection. I pay in a bit performance for each rendering of the chart but save a lot of memory.
精彩评论