For what it's worth, I do this all the time with charts: call removeItemAt(0), and then call addItem( newDateHere )
It works well. The oldest date is removed from the beginning of the array collection and a newer one is tacked on to the end, the chart updates automatically. No need to call any other methods (like refresh). As suggested a code example would help... Sunil --- In flexcoders@yahoogroups.com, Arun Shankar <[EMAIL PROTECTED]> wrote: > > dataprovider which is an ArrayCollection for the dateTimeAxis is bindable > one. My code looks something like this > > ArrayCollection.removeItemAt(0); > ArrayCollection.addItem(date object); > ArrayCollection.refresh(); > > i believe the first item would get removed and the new date object would get > added to the end of the list and the call to refresh() should ultimately makes the chart to redraw with the new change in the collection. > > i guess flex caches the dateTime axis labels which is ultimately causing this > problem. I tried clearing the cache but I could not do that because there is no straight forward to do that in flex. > > > --- On Mon, 15/9/08, Pan Troglodytes <[EMAIL PROTECTED]> wrote: > > > From: Pan Troglodytes <[EMAIL PROTECTED]> > > Subject: Re: [flexcoders] Issue with runtime adding of axis labels in > > DateTimeAxis > > To: flexcoders@yahoogroups.com > > Date: Monday, 15 September, 2008, 9:25 PM > > This may be caused by a lack of binding in your data > > objects. Can you post > > an short, simple example that replicates your issue? > > > > On Mon, Sep 15, 2008 at 4:21 AM, arajendr > > <[EMAIL PROTECTED]> wrote: > > > > > Hi All, > > > > > > I've been facing this problem for a while. My > > application gets new > > > data every 5 mins and I need to update the DateTime > > axis label at > > > runtime to include the new label data which would > > ultimately shift the > > > axis one item to the left so that the left most axis > > label would be > > > removed from chart and the new axis data would get > > added to the right > > > most part of the axis. > > > > > > I've been able to get the new axis label data on > > the right most part > > > but the left axis label data which i've removed > > from the dataProvider > > > collection is still appearing in the chart. is it a > > bug with DateTime > > > axis? Anyone have come across this problem before? let > > me know if you > > > have seen this kind of problem before and whats the > > workaround. > > > > > > Cheers > > > Arun > > > > > > > > > > > > > > > > > -- > > Jason > > > Connect with friends all over the world. Get Yahoo! India Messenger at http://in.messenger.yahoo.com/?wm=n/ >