0

我很难使用 ActionScript 将 RadarColumnSeries 添加到我的雷达图表中。我已经搞砸了很长时间,以至于我不确定我是否已经走在正确的轨道上了。请帮忙,谢谢——

这是我在 Flex4 中使用的内容:

图表:

<ilog:RadarChart id="newChart" width="100%" height="100%"
            showDataTips="true" dataProvider="{xmlDataSource}"
            type="circular"
            columnWidthRatio="0.8" >
    <ilog:angularAxis>
        <ilog:AngularAxis dataProvider="{months}" displayName="Month" categoryField="fullDate" />
    </ilog:angularAxis>
</ilog:RadarChart>

月份数组:

[January 2011, February 2011, March 2011, April 2011]

xml数据源:

<root>
  <series id="Americas" name="Americas">
    <item total="2" year="2011" month="April" fullDate="April 2011"/>
    <item total="3" year="2011" month="February" fullDate="February 2011"/>
    <item total="2" year="2011" month="March" fullDate="March 2011"/>
  </series>
  <series id="Asia-Pacific" name="Asia-Pacific">
    <item total="2" year="2011" month="April" fullDate="April 2011"/>
    <item total="1" year="2011" month="January" fullDate="January 2011"/>
    <item total="1" year="2011" month="March" fullDate="March 2011"/>
  </series>
  <series id="EMEIA" name="EMEIA">
    <item total="1" year="2011" month="April" fullDate="April 2011"/>
    <item total="1" year="2011" month="February" fullDate="February 2011"/>
    <item total="3" year="2011" month="March" fullDate="March 2011"/>
  </series>
  <series id="Global" name="Global">
    <item total="3" year="2011" month="April" fullDate="April 2011"/>
    <item total="3" year="2011" month="March" fullDate="March 2011"/>
  </series>
</root>

动作脚本:

private function createSeries():void {
                var s:RadarSeries;
                for each (var x:XML in xmlDataSource.series) {
                    var o:Object=new Object();
                    s = new RadarColumnSeries();
                    for each (var c:XML in x.item) {
                        s = new RadarColumnSeries();
                        //trace(x.@name + ": " + c.@total + " - " + c.@month + " - " + c.@year + " - " + c.@fullDate);
                        o = {name:x.@name, total:c.@total.toString(), month:c.@month, year:c.@year, fullDate:c.@fullDate};
                        dataSource.addItem(o);
                        s.dataProvider = o;
                        s.dataField = "total";
                        s.displayName = o.name;
                    }

                    columnSeries.push(s);
                    RadarColumnSeries(s).columnWidthRatio=0.80;
                }

                newChart.series = columnSeries;
            }
4

1 回答 1

0

这是解决方案的链接

于 2011-05-18T17:48:53.910 回答