Flex fusioncharts 中对象的 VO 问题
当我在 fusionCharts 加载器函数中使用 VO 而不是 Object 时,我得到“set”
() 属性为空。
我的代码:
[Bindable]
private var chartColl:ArrayCollection;
private function chartDetails():void
{
var chartColl:ArrayCollection=new ArrayCollection();
for (var j:int =0;j<uniqueData.length;j++)
{
var obj:ChartVO=new ChartVO();
obj.label=String(uniqueData.getItemAt(j));
var count:int=0;
for(var i:int=0;i<getPopulation.length;i++)
{
if(String(uniqueData.getItemAt(j))== getPopulation.getItemAt(i).country)
{
count=count+getPopulation.getItemAt(i).count;
}
}
obj.value=count;
chartColl.addItem(obj);
}
fc.FCData(chartColl);
fc.FCRender();
}
when I use VO instead of Object in the fusionCharts loader function I get the "set"
()attribute empty.
MY CODE:
[Bindable]
private var chartColl:ArrayCollection;
private function chartDetails():void
{
var chartColl:ArrayCollection=new ArrayCollection();
for (var j:int =0;j<uniqueData.length;j++)
{
var obj:ChartVO=new ChartVO();
obj.label=String(uniqueData.getItemAt(j));
var count:int=0;
for(var i:int=0;i<getPopulation.length;i++)
{
if(String(uniqueData.getItemAt(j))== getPopulation.getItemAt(i).country)
{
count=count+getPopulation.getItemAt(i).count;
}
}
obj.value=count;
chartColl.addItem(obj);
}
fc.FCData(chartColl);
fc.FCRender();
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您还需要设置“value”属性和“label”属性。
请检查设置调试模式生成的 XML。
还要确保您根据图表类型构建正确的 ArrayCollection 格式。
以下链接列出了每种类型/图表组的数据格式:
http ://www.fusioncharts.com/flex/docs/charts/Contents/create_single_array.html
http://www.fusioncharts.com/flex/docs/charts/Contents /create_multi_array.html
http://www.fusioncharts.com/flex/docs/charts/Contents /create_stacked_array.html
http://www.fusioncharts.com/flex/docs/charts/Contents /create_combi_array.html
http://www.fusioncharts.com/flex/docs/charts/Contents /create_plot_array.html
图表类型/组列表位于此处:
http://www.fusioncharts.com/flex/docs/charts/Contents/introduction_chartTypes .html
有关将数据从 FusionCharts 本机 XML 格式映射到 ArrayCollection 的更多信息,请阅读:
http://www.fusioncharts.com/flex/docs/charts/Contents/xml_mapping_singleSeries .html
http://www.fusioncharts.com/flex/docs/charts/Contents /xml_mapping_multiSeries.html
http://www.fusioncharts.com/flex/docs/charts/Contents /xml_mapping_plot.html
You would need to set 'value' property too along with 'label' property.
Please check setting debug mode the resultant XML.
Also make sure you are building proper ArrayCollection format as per chart type.
The data format for each type/group of chart is listed in these links:
http://www.fusioncharts.com/flex/docs/charts/Contents/create_single_array.html
http://www.fusioncharts.com/flex/docs/charts/Contents/create_multi_array.html
http://www.fusioncharts.com/flex/docs/charts/Contents/create_stacked_array.html
http://www.fusioncharts.com/flex/docs/charts/Contents/create_combi_array.html
http://www.fusioncharts.com/flex/docs/charts/Contents/create_plot_array.html
List of chart types/groups are here:
http://www.fusioncharts.com/flex/docs/charts/Contents/introduction_chartTypes.html
For further information on mapping of data from FusionCharts native XML format to ArrayCollection read:
http://www.fusioncharts.com/flex/docs/charts/Contents/xml_mapping_singleSeries.html
http://www.fusioncharts.com/flex/docs/charts/Contents/xml_mapping_multiSeries.html
http://www.fusioncharts.com/flex/docs/charts/Contents/xml_mapping_plot.html