flex - Retrieving Sub-XML Elements to display a Pie Chart -


i have designed application load information xml file pie chart.

first xml looked this

<books>    <stock>      <booktype>novels</booktype>     <amountofbooks>100</amountofbooks>     </stock> </books> 

and code looked

[bindable] private var bookstock:arraycollection = new arraycollection();  var mypieseries:pieseries = new pieseries(); mypieseries.namefield = "booktype"; mypieseries.field = "amountofbooks"; 

in result event this

bookstock = evt.result.books.stock; 

now works , can see generated pie chart.

but let's changed xml in following manner.

<books>    <stock>         <bookinfo>             <booktype>fiction</booktype>             <amountofbooks>150</amountofbooks>         </bookinfo>          </stock>     <stock>         <bookinfo>           <booktype>novels</booktype>           <amountofbooks>100</amountofbooks>         </bookinfo>     </stock>  </books> 

in results event how access it?

bookstock = evt.result.books.stock.bookinfo;

doesn't work. "error: unknown property: 'bookinfo'."

when analysed bookstock object this.

debug image

how access xml element now? needs changed here?

mypieseries.namefield = "booktype"; mypieseries.field = "amountofbooks"; 

update
here project working with.

http://min.us/mvkoxsu

actually xml.books.stock.bookinfo xmllist of xml nodes , think error comes either assigning xmllist arraycollection instance, or treating every item of xmllist array, when in fact xml nodes.

i've never worked arraycollection, think you'll need traverse (for loop) xmllist , put arraycollection manually.


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -