Radar charts


Need help adding dynamic series to Radar Chart


I'm having a real hard time adding RadarColumnSeries to my Radar Chart using ActionScript. I've been messing with this for so long that I'm not sure I'm even on the right track anymore. Help PLEASE, Thank you --
Here's what I'm working with in Flex4:
Chart:
<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>
Months Array:
[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
{ trace(xmlDataSource.toXMLString()); var s:RadarColumnSeries;
for each (var c:XML in xmlDataSource.series)
{
//trace("C \n" + c.item.toXMLString()); s =
new RadarColumnSeries(); s.dataField = c.item.#total; s.displayName = c.#name; s.dataProvider = c; var tmp:Array = newChart.series; tmp.push(s); newChart.series = tmp; newChart.invalidateSeriesStyles();
/* fillStyles[s] = s.getStyle("areaFill"); s.setStyle("areaFill", emptyColor); s.filterData = false; s.setStyle('stroke', new Stroke(0xaaaaaa, 1, 0.7)); RadarColumnSeries(s).columnWidthRatio=0.95; */
//trace("\n");
}
}
I'm getting closer. It's displaying the columns now but only for the last month. So I'm guessing my loops are off, but I'm blurry eyed now so I'd really appreciate a second pair of eyes on this.
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;
}
MarkCP
27000369KJ
‏2011-05-12T18:36:43Z
I'm getting closer. It's displaying the columns now but only for the last month. So I'm guessing my loops are off, but I'm blurry eyed now so I'd really appreciate a second pair of eyes on this.
<pre class="jive-pre">
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;
}
</pre>
More...
Hi,
Sorry for the late reply. Please look at the following sample which solve your issue.
<?xml version=
"1.0" encoding=
"utf-8"?> <s:Application xmlns:fx=
"http://ns.adobe.com/mxml/2009" xmlns:s=
"library://ns.adobe.com/flex/spark" xmlns:mx=
"library://ns.adobe.com/flex/mx" creationComplete=
"application1_creationCompleteHandler(event)" xmlns:ilog=
"http://www.ilog.com/2007/ilog/flex"> <fx:Script> <![CDATA[
import ilog.charts.chartClasses.RadarSeries;
import ilog.charts.series.RadarColumnSeries;
import mx.collections.ArrayCollection;
import mx.events.FlexEvent; [Bindable]
private var xmlDataSource:XML = <root> <series id=
"Americas" name=
"Americas"> <item total=
"2" year=
"2011" month=
"January" fullDate=
"January 2011"/> <item total=
"3" year=
"2011" month=
"February" fullDate=
"February 2011"/> <item total=
"4" year=
"2011" month=
"March" fullDate=
"March 2011"/> <item total=
"5" year=
"2011" month=
"April" fullDate=
"April 2011"/> <item total=
"6" year=
"2011" month=
"May" fullDate=
"May 2011"/> <item total=
"7" year=
"2011" month=
"June" fullDate=
"June 2011"/> </series> <series id=
"Asia-Pacific" name=
"Asia-Pacific"> <item total=
"7" year=
"2011" month=
"January" fullDate=
"January 2011"/> <item total=
"6" year=
"2011" month=
"February" fullDate=
"February 2011"/> <item total=
"5" year=
"2011" month=
"March" fullDate=
"March 2011"/> <item total=
"4" year=
"2011" month=
"April" fullDate=
"April 2011"/> <item total=
"3" year=
"2011" month=
"May" fullDate=
"May 2011"/> <item total=
"2" year=
"2011" month=
"June" fullDate=
"June 2011"/> </series> </root>; [Bindable]
private var months:Array = [
"January",
"February",
"March",
"April",
"May",
"June"];
protected function application1_creationCompleteHandler(event:FlexEvent):
void
{ var s:RadarColumnSeries; var dataSource:ArrayCollection; var columnSeries:Array = [];
for each (var x:XML in xmlDataSource.series)
{ dataSource =
new ArrayCollection(); var o:Object=
new Object(); s =
new RadarColumnSeries(); s.dataField =
"total"; s.categoryField =
"month"; s.displayName = o.name;
for each (var c:XML in x.item)
{ o =
{name:x.#name, total:c.#total.toString(), month:c.#month, year:c.#year, fullDate:c.#fullDate
}; dataSource.addItem(o);
} s.dataProvider = dataSource; columnSeries.push(s);
} newChart.series = columnSeries;
} ]]> </fx:Script> <ilog:RadarChart id=
"newChart" width=
"100%" height=
"100%" showDataTips=
"true" dataProvider=
"{xmlDataSource}" type=
"circular" columnWidthRatio=
"0.8" > <ilog:angularAxis> <ilog:AngularAxis displayName=
"Month" dataProvider=
"{months}"/> </ilog:angularAxis> </ilog:RadarChart> </s:Application>
Hope this helps,
Damien
SystemAdmin
110000D4XK
‏2011-05-18T08:31:09Z
Hi,
Sorry for the late reply. Please look at the following sample which solve your issue.
<pre class="jive-pre">
<?xml version=
"1.0" encoding=
"utf-8"?> <s:Application xmlns:fx=
"http://ns.adobe.com/mxml/2009" xmlns:s=
"library://ns.adobe.com/flex/spark" xmlns:mx=
"library://ns.adobe.com/flex/mx" creationComplete=
"application1_creationCompleteHandler(event)" xmlns:ilog=
"http://www.ilog.com/2007/ilog/flex"> <fx:Script> <![CDATA[
import ilog.charts.chartClasses.RadarSeries;
import ilog.charts.series.RadarColumnSeries;
import mx.collections.ArrayCollection;
import mx.events.FlexEvent; [Bindable]
private var xmlDataSource:XML = <root> <series id=
"Americas" name=
"Americas"> <item total=
"2" year=
"2011" month=
"January" fullDate=
"January 2011"/> <item total=
"3" year=
"2011" month=
"February" fullDate=
"February 2011"/> <item total=
"4" year=
"2011" month=
"March" fullDate=
"March 2011"/> <item total=
"5" year=
"2011" month=
"April" fullDate=
"April 2011"/> <item total=
"6" year=
"2011" month=
"May" fullDate=
"May 2011"/> <item total=
"7" year=
"2011" month=
"June" fullDate=
"June 2011"/> </series> <series id=
"Asia-Pacific" name=
"Asia-Pacific"> <item total=
"7" year=
"2011" month=
"January" fullDate=
"January 2011"/> <item total=
"6" year=
"2011" month=
"February" fullDate=
"February 2011"/> <item total=
"5" year=
"2011" month=
"March" fullDate=
"March 2011"/> <item total=
"4" year=
"2011" month=
"April" fullDate=
"April 2011"/> <item total=
"3" year=
"2011" month=
"May" fullDate=
"May 2011"/> <item total=
"2" year=
"2011" month=
"June" fullDate=
"June 2011"/> </series> </root>; [Bindable]
private var months:Array = [
"January",
"February",
"March",
"April",
"May",
"June"];
protected function application1_creationCompleteHandler(event:FlexEvent):
void
{ var s:RadarColumnSeries; var dataSource:ArrayCollection; var columnSeries:Array = [];
for each (var x:XML in xmlDataSource.series)
{ dataSource =
new ArrayCollection(); var o:Object=
new Object(); s =
new RadarColumnSeries(); s.dataField =
"total"; s.categoryField =
"month"; s.displayName = o.name;
for each (var c:XML in x.item)
{ o =
{name:x.#name, total:c.#total.toString(), month:c.#month, year:c.#year, fullDate:c.#fullDate
}; dataSource.addItem(o);
} s.dataProvider = dataSource; columnSeries.push(s);
} newChart.series = columnSeries;
} ]]> </fx:Script> <ilog:RadarChart id=
"newChart" width=
"100%" height=
"100%" showDataTips=
"true" dataProvider=
"{xmlDataSource}" type=
"circular" columnWidthRatio=
"0.8" > <ilog:angularAxis> <ilog:AngularAxis displayName=
"Month" dataProvider=
"{months}"/> </ilog:angularAxis> </ilog:RadarChart> </s:Application>
</pre>
Hope this helps,
Damien
More...
Thanks again for your help Damien. Once again you came thru for me.
Appreciate it!
-Mark

Related Links

Run Time Radar Data
Rotating the angular axis
Set the chart.type="Cloumn" default
pls help me
How could I change RadarLinesSeries using Action Script?
Radar Chart - Custom Labels
Trouble with AngularAxisRenderer.labelRenderer on RadarChart
Multiple Stroke Colors for Radial Lines
could not find source for resource bundle ilogradarchart
using datafunction for RadarLineSeries
Modifying the Radar Chart
How to change thickness/color of radar chart border
Clickable points on radar line series?
how to work with the radar control
Changing the order of the radial axis
LinearGradient as areaFill

Categories

DW
IBM Blockchain
IBM Security
Jazz for Service Manag...
Rational Cafe
Germany
AIX and Linux
Globalization
Information Management
WebSphere
IBM Web Mail Cloud
IBM CMIS for ECM
IBM Case Manager Client
IBM Kenexa Hot Lava Mo...
IBM Kenexa CompAnalyst...
Application Security
Application Performanc...
eMessage8
Optimize
eMessage7
Cloud resilience
IBM SmartCloud Applica...
IBM TRIRIGA UX Framework
Facilities Maintenance...
Environmental and Ener...
Jazz for Service Manag...
Software Asset Management
Patch Management
Integration Products
Cast Iron Runtime Appl...
Cast Iron Web Manageme...
The SPSS Community web...
IBM SPSS Accessibility
Rational Developer for...
RDz - Rational Develop...
HATS HotSpot
Cognos Enterprise BI
Cognos Planning 10
BI Strategies
IBM developerWorks Россия
Java
db2
rational
Insurance
IBM Web Server Plug-in...
RSDC
dW Questions and Answers
IBM Toolbox for Java a...
hrdf
WebSphere Message Broker
WebSphere Commerce
IBM Integration Design...
IBM Support Assistant ...
WebSphere Virtual Ente...
AppScan Standard
Network Intrusion Prev...
IBM Security Identity ...
HA - High Availability
Documentation
VA & Scanners / Assets...
Gentran Integration Su...
Gentran Integration Su...
**NEW** Sterling Commu...
Managed File Transfer
Release Bulletins
Connect:Direct (Educat...
Customer Order Managem...
Gentran Server for Win...
IBM Control Center
Connect:Direct for iSe...
Connect:Enterprise Mai...
Driving Usage
Dealing With Your ERP ...
System Performance
Web Services, Messagin...
Comergent Security
Back End Integation
Zee Miscellaneous
Outbound planning
Delivery and Service S...
Store Order Management
Console Framework (HTM...
SQLserver
Weblogic Misc
RPG Cafe
Mathematical Programming
BRMS Trial Support
IBM ILOG Elixir Enterp...
Constraint Programming...
JRules Trial Support -...
IBM MapReduce Tools fo...
Replication Monitoring...
Programming Contest Ce...
IBM Spectrum Control
IBM SmartCloud Control...
IBM Workload Automatio...
Tivoli Decision Suppor...
Tivoli Netcool Configu...
IBM Enterprise Asset M...
IBM SmartCloud Cost Ma...
iPhone
PowerVM Forum
IBM WebSphere Portal a...
ibmpub.java.vmesa
Web Services Technical
Linux scripting

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile