Мне очень трудно добавить RadarColumnSeries к моей диаграмме радара с помощью ActionScript. Я так долго возился с этим, что не уверен, что даже на правильном пути. ПОЖАЛУЙСТА, ПОЖАЛУЙСТА, Спасибо -
Вот что я работаю в 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]
XmlDataSource:
<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>
ActionScript:
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;
}