0
動態檢測LineSeries這是我的數組集合創造線型圖
[Bindable]private var Projects:ArrayCollection = new ArrayCollection([
{ Department: "Software", TotalProjects: 73,Completed:30,Inprogress:30,Approved:13},
{ Department: "XML",TotalProjects: 50,Completed:20,Inprogress:20,Approved:10},
{ Department: "Publishing",TotalProjects: 25,Completed:5,Inprogress:10,Approved:10},
{ Department: "Indesign", TotalProjects: 70,Completed:30,Inprogress:30,Approved:10},
{ Department: "Imaging", TotalProjects: 42,Completed:30,Inprogress:10,Approved:2}]);
折線圖線系列:
<mx:series>
<mx:LineSeries id="cs1"
yField="TotalProjects"
xField="Department"
displayName="TotalProjects">
</mx:LineSeries>
<mx:LineSeries id="cs2"
yField="Inprogress"
xField="Department"
displayName="Inprogress">
</mx:LineSeries>
<mx:LineSeries id="cs3"
yField="Completed"
xField="Department"
displayName="Completed">
</mx:LineSeries>
<mx:LineSeries id="cs4"
yField="Approved"
xField="Department"
displayName="Approved">
</mx:LineSeries>
</mx:series>
如何創建mx:LineSeries
動態取決於陣列收藏價值。現在只有4行系列在那裏,但有時我必須顯示更多按照數組集合值更改前:如果多一個狀態HoldProject
添加到數組集合?
OK.if我收到具有不同屬性的數組集合對象,每次如何遍歷數組集合項並創建線條系列? –
您能否提供更多詳細信息?因爲,我們怎麼知道,每個項目應該使用哪個字段作爲yField? –
@ Timofei Davydik在給出'Department'的數組集合中是很常見的,但剩下的字段有時只有3個狀態發生變化:'Completed','hold',''approved'和一些更多的'Completed','hold','approved', '刪除','初始','延期'等。 –