Josh,

I was able to make the chart work nicely using a stock LineChart
component and using the cursor from the ICollectionView interface
implementation. I also profiled the code and didn't see any memory
issues (other than what is associated with the ARLabelData class which
is discussed elsewhere). The following are snippets of code that I
used. I hope it helps someone.

// In class definition 
[Bindable]
private var metrics:ArrayCollection;
private var cursor:IViewCursor;
...

// In init function 

// Populate the array with place holder objects
var i:int;
var myArray:Array = new Array(ARRAY_SIZE);
for (i = 0; i < ARRAY_SIZE; i++){
  myArray[i] = new MetricsVO();
}
                        
metrics = new ArrayCollection(myArray);

// Store cursor as an instance variable to minimize memory consumption
cursor = metrics.createCursor();

...

// In callback handler
var msg:AsyncMessage = message.message as AsyncMessage;
var data:MetricsVO = msg.body as MetricsVO;                             

// Update chart data provider, remove the oldest and add
// the newest data point
cursor.seek(CursorBookmark.FIRST);
cursor.remove();
cursor.seek(CursorBookmark.LAST,1);
cursor.insert(data);

--- In [email protected], "Josh McDonald" <[EMAIL PROTECTED]> wrote:
>
> Just implement IList or ICollectionView or whichever interface is
needed,
> and keep a pointer to the actual data and "start" and "length"
variables,
> and all refresh() when any of those things is updated?
> 
> I assume this would work, but somebody a little more familiar with the
> internals of the iterable interfaces and/or charts might be able to
clarify
> :)
> 
> -J
> 
> On Thu, Mar 27, 2008 at 11:10 AM, Jim Boone <[EMAIL PROTECTED]> wrote:
> 
> >   Josh,
> >
> > Yes I actually have. I haven't tried it yet, but I believe if I
> > initialize the list with a fixed number of entries the X axis delta
> > will remain constant which is required by my application. The only
> > thing that I have not figured out is how to efficiently shift the
> > elements of the array without triggering lots of garbage collections.
> > In the Java world I would use a linked list implementation of a
> > collection. I just need to figure out what that same implementation
> > looks like in ActionScript. Thanks for your your response.
> >
> > Jim
> >
> >
> > --- In [email protected] <flexcoders%40yahoogroups.com>,
"Josh
> > McDonald" <dznuts@> wrote:
> > >
> > > Have you considered using some sort of proxy IList that hooks
into your
> > > datastream but only shows the last n rows? That would allow you to
> > use the
> > > various existing chart components.
> > >
> > > -J
> > >
> > > On Fri, Mar 21, 2008 at 10:30 AM, Jim Boone <jim@> wrote:
> > >
> > > > I am attempting to write a dashboard application that shows
> > real-time
> > > > dynamic metrics of one of our production applications. I would
like
> > > > to plot parameters on graphs similar to what you see in the
Windows
> > > > task manager under the performance tab (basically an emulation
of a
> > > > moving strip chart). I have considered using the line chart
component
> > > > but it doesn't seem well-suited for showing historical trends.
Does
> > > > anyone have any ideas on how I should tackle this problem?
Thanks in
> > > > advance for your help.
> > > >
> > > > Jim
> > > >
> > > >
> > > >
> > >
> > >
> > >
> > > --
> > > "Therefore, send not to know For whom the bell tolls, It tolls for
> > thee."
> > >
> > > :: Josh 'G-Funk' McDonald
> > > :: 0437 221 380 :: josh@
> > >
> >
> >  
> >
> 
> 
> 
> -- 
> "Therefore, send not to know For whom the bell tolls, It tolls for
thee."
> 
> :: Josh 'G-Funk' McDonald
> :: 0437 221 380 :: [EMAIL PROTECTED]
>


Reply via email to