0
我有這樣的事情的XML數據問題的顯示從XML數據線圖表
<data>
<result month="Jan-04">
<employee id="1">
<a>81768</a>
<b>60310</b>
<c>43357</c>
</employee>
<employee id="2">
<a>81768</a>
<b>60310</b>
<te>43357</c>
</employee>
</result>
<result month="Feb-04">
<employee id="1">
<a>81156</a>
<b>58883</b>
<c>49280</c>
</employee>
<employee id="2">
<a>81768</a>
<b>60310</b>
<c>43357</c>
</employee>
</result>
我想和月顯示它線圖上,水平軸和A,B,C作爲系列id = 1的員工。以下代碼不會在圖表上顯示任何數據。有人能指出這個錯誤嗎?
<mx:HTTPService id="srv" url="D:/data.xml" useProxy="false" result="myData=ArrayCollection(srv.lastResult.data.result)"/>
<mx:Panel title="Line Chart">
<mx:LineChart id="myChart"
showDataTips="true"
enabled="true" dataProvider="{myData}">
<mx:horizontalAxis>
<mx:CategoryAxis categoryField="month"/>
</mx:horizontalAxis>
<mx:series>
<mx:LineSeries yField="employee[0].a" displayName="A" name="a"/>
<mx:LineSeries yField="employee[0].b" displayName="B" name="b"/>
<mx:LineSeries yField="employee[0].c" displayName="C" name="c"/>
</mx:series>
</mx:LineChart>
<mx:Legend dataProvider="{myChart}"/>
我想你忘記了「結果」功能上的「新」關鍵字。 另外,「myData」是否設置爲Bindable? – 2010-01-06 13:37:32
我添加了「新」關鍵字..它沒有任何區別..是的「myData」設置爲Bindable – arunp 2010-01-06 14:24:53