在折线图中创建动态线系列
这是我的
[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
添加到数组集合中?
This is my array collection
[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}]);
line series for line chart:
<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>
how can i create mx:LineSeries
dynamically depending upon array collection values. Now only 4 line series is there but some times i have to show more as per the array collection values change ex: if one more status HoldProject
added to array collection?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在这种情况下,dataProvider 中的每个项目都应具有相同的属性集。
In this case, each item in your dataProvider should have the same property set.