0 Replies Latest reply on Dec 27, 2009 10:18 PM by wing328

    Question on Column/AreaChart

    wing328

      Hi all,

       

      I've a question about data source (ArrayCollection) for Column/Area Chart.

       

      I went through the examples on http://livedocs.adobe.com/flex/3/html/charts_types_06.html#164059. In the example, the data source is as follows:

       

      [Bindable]
           public var expenses:ArrayCollection = new ArrayCollection([
              {Month:"Jan", Profit:2000, Expenses:1500},
              {Month:"Feb", Profit:1000, Expenses:200},
              {Month:"Mar", Profit:1500, Expenses:500}
           ]);

       

       

      If the ArrayCollection contains duplicated "Month" like the following

       

      [Bindable]
           public var expenses:ArrayCollection = new ArrayCollection([
              {Month:"Jan", Profit:2000, Expenses:1500},
              {Month:"Feb", Profit:1000, Expenses:200},
              {Month:"Feb", Profit:500, Expenses:300},
              {Month:"Mar", Profit:1500, Expenses:500}
           ]);

       

       

      is there a way to instruct the Column/Area chart to automatically aggregate the values (of Profit and Expenses) based on "Month"? Currently, the chart would show "Jan", "Feb", "Feb", "Mar" in the X axis.

       

      Thanks in advance,

       

      W