views:

17

answers:

1

Is there anyway where I can pass the Array values (not the array collection values) to the Bar charts or column charts using flex 3.5...

here is the thing i want:::

I have array values like this,,

array1 = [23, 49, 40, 239, 20, 80, 39,49,120, 24, 31,41];

and i want to show these values on the Yaxis and months on Xaxis....

--

I have two Qns,

1) how can I pass this array to Bar chart or column chart.

2) how do I need to show months on Xaxis. beacuse I'm asking this regarding, I have kept a filters that even if we want to see some months or a particular months or perticalar span of months... there on Xaxis it need to change the months dynamically depending on the filters..... (for ex, on Xaxis the values should be (Jan, Apr, Jun,Oct) if i select the 3 months period filter....)

I have written a logic to collect the values of those particular months into an array, but not understading how to pass this array to Bar chart,, beacuse there I don't know what Xfield and Yfield to be given....

A: 

1) how can I pass this array to Bar chart or column chart.

The dataProvider property of the charts is an object. So you can send anything you want in there. I would expect it to handle an array just as well as it would handle an ArrayCollection.

That said, I believe you're going to have to send in objects with data properties that represent the xField and yField values. An array of simple values doesn't give the component enough information to know what to do.

2) how do I need to show months on Xaxis. beacuse I'm asking this regarding, I have kept a filters that even if we want to see some months or a particular months or perticalar span of months... there on Xaxis it need to change the months dynamically depending on the filters..... (for ex, on Xaxis the values should be (Jan, Apr, Jun,Oct) if i select the 3 months period filter....)

I believe if you create objects, as I stated before with the Xfield value being a string representing the month and a y field value representing your data point, the graph should know how to display the values.

If you were using an ArrayCollection you could easily use the collection's filtering abilities to change the dataProvider, which I would expect would change the graph.

More docs on this

www.Flextras.com
Thanks for reply. I got it what you mean, I can use the Array Collections, but here I'm concatnating the filtered values... I know that by using array...