Assuming that you have assigned an id to each series ("baseline","2009-8"), you could use something like this:
private function dtFunction( o:HitData ):String { var index:int = ( LineSeries( o.element ).id == "baseline" ) ? 0 : 1; var s:String = "<b>Book rate:</b> " + o.item.session[ index ].bookrate; return s; } -TH --- In flexcoders@yahoogroups.com, "Monette" <monett...@...> wrote: > > Tim, > Your recommendation sounds so simple and logical but I am not getting it > to work. My problem is parsing the XML and returning the correct info > for the datapoints. Following, is a sample of my XML file: > > <items> > <week name="1"> > <session> > <sessionname>Baseline</sessionname> > <books>0</books> > <bookrate>2</bookrate> > <status>red</status> > </session> > <session> > <sessionname>2009-8</sessionname> > <books>0</books> > <bookrate>6</bookrate> > <status>red</status> > </session> > </week> > <week name="2"> > <session> > <sessionname>Baseline</sessionname> > <books>0</books> > <bookrate>3</bookrate> > <status>red</status> > </session> > <session> > <sessionname>2009-8</sessionname> > <books>0</books> > <bookrate>1</bookrate> > <status>red</status> > </session> > </week> > </items> > > What are your thoughts? > Thanks. > Monette > > --- In flexcoders@yahoogroups.com, "turbo_vb" TimHoff@ wrote: > > > > Yeah, you're very close. Now it's just a matter of xml. I'd start by > tracing o. If the children are still in o, then drill down. Otherwise, > you'll have to go and find the nodes; like you're trying below. Some > things that you can start with: > > > > trace( o.toXMLString() ); > > > > var myXMLChildren:XMLList = o.children(); > > > > o.child("myProperty")[0].valueOf(); > > > > -TH > > > > --- In flexcoders@yahoogroups.com, "Monette" monettemm@ wrote: > > > > > > Below is my DataTipFunction. The commented part on top works fine. > > > However, there is additional information that I need to include from > the > > > XML file into the data tip. > > > When I mouse over the datapoint I would like to retrieve from the > XML > > > file the additional child nodes that correspond with that datapoint. > I > > > feel that I am very close and missing one piece. How can I > accomplish > > > this dynamically by displaying the correct data for the series? > Note, I > > > can have more than 1 series in the XML data file. > > > > > > private function DTPFunction(o:HitData):String > > > { > > > //WORKS for data that is used on the chart x and y > > > values > > > //var s:String; > > > //s = "<b>" + LineSeries(o.element).displayName + > "</b> > > > \n"; > > > //s += "<b>Books:</b> " + > > > LineSeriesItem(o.chartItem).yValue + "\n" + "<b>Book rate:</b> " + > > > series. o.item.session.bookrate + "\n" ; > > > //s += "<b>Status:</b> " + o.item.session.status + > "\n" > > > ; > > > //END WORKS > > > > > > var s:String; > > > var a:int=0; > > > var fNode:XML = chart.dataProvider[0]; > > > if ((LineSeries(o.element).displayName) == > > > fNode.child('sessionname')) > > > { > > > s = "<b>" + o.item.session.sessionname[a] + "</b> > \n"; > > > s += "<b>Books:</b> " + o.item.session.books[a] + > "\n" + > > > "<b>Book rate:</b> " + o.item.session.bookrate[a] + "\n" ; > > > s += "<b>Status:</b> " + o.item.session.status[a] + > > > "</size>\n" ; > > > a++ > > > } > > > return s; > > > } > > > > > > Thanks. > > > Monette > > > > > > --- In flexcoders@yahoogroups.com, "turbo_vb" <TimHoff@> wrote: > > > > > > > > If the dataTipFunction doesn't give you enough flexibility, you > could > > > try a dataTipRenderer. In either case, you can drill down to the > child > > > nodes there. > > > > > > > > -TH > > > > > > > > --- In flexcoders@yahoogroups.com, "Monette" monettemm@ wrote: > > > > > > > > > > The line chart displays multiple series created with the > > > seriesDataFunction (assigning the x and y points). The XML file > > > includes additional child nodes per item that I would like to > include in > > > the datatip. How do I include those items? When I use o.item.rate, > it > > > lists all the rates for each series in the datatip. > > > > > Thanks. > > > > > Monette > > > > > > > > > > > > > > >