开发者

Flex chart...update date range

I am using Flex 4 开发者_如何学编程& zend to create a simple areaseries chart. Currently, I am pulling 20 yrs of data from the database & displaying it by default. I then want to let the user choose the dates he wants, but without going back to the server....how can I do that?

<mx:AreaChart id="Areachart" dataProvider="{employeesResult.lastResult}">

<mx:series>

<mx:AreaSeries yField="numberOfEmployees" xField="date" id="areaSeries"/> </mx:series>

</mx:AreaChart>

<mx:LinkButton click="dateChange()" label="1 year" />

private function dateChange():void{

what goes here????

}


rather than sticking the result of the service call straight into the graph. Keep it on a model somewhere.

If you add it into an ArrayCollection (or really anything that implements ICollectionView) you can then use the filter functions exposed by that to filter your dataset before it's fed into the graph.

You also get the advantage of being able to re-filter the results. By slicing up the array, you are altering your base data set.


add another one array and fill it like this:

for(startDate;less then endDate;iterate) { fill with data from employeesResult.lastResult }

or explain what do you want in details?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜