Radar charts


Run Time Radar Data


[ritsrivastava said:]
Hi, i have gentated Xml at run time from my slection window, at first when i have not made any selctions(countries, Indicators) then it(Radar) load default values and it is working fine, but when i will do some selection(countries and indicators) from my 'selction window' and hit on apply btn then i will send the fresh XML Data to Radar chart, but it will give the error, but if i have saved the same XML dand load it is wokring fine. I dont know why Radar chart is not genrated when i passed the XML at second time , and it will genrate the Radar chart if i passed the same XML at first time( first Loaded time)???? My code is given below ::::
// ActionScript file
//import Controls.userSelectionCntrl.userSelection;
import flash.events.MouseEvent;
import flash.net.SharedObject;
import ilog.charts.chartClasses.RadarSeries;
import ilog.charts.series.RadarColumnSeries;
import ilog.charts.series.RadarLineSeries;
import mx.charts.renderers.CircleItemRenderer;
import mx.collections.ArrayCollection;
import mx.containers.ControlBar;
import mx.containers.TitleWindow;
import mx.containers.VBox;
import mx.controls.Alert;
import mx.controls.Button;
import mx.controls.Menu;
import mx.core.IFlexDisplayObject;
import mx.events.CloseEvent;
import mx.events.MenuEvent;
import mx.graphics.IStroke;
import mx.graphics.Stroke;
import mx.managers.PopUpManager;
import mx.rpc.events.ResultEvent;
private var uStroke:IStroke;
private var usStroke:Stroke;
// Variable Declaration
[Bindable] public var defaultSettingsXML:XML =new XML();
[Bindable] public var appSettingsXML:XML;
[Bindable] private var dataSource:ArrayCollection= new ArrayCollection();
[Bindable] private var categories:Array;
[Bindable] private var countries:Array=[];// new Array(["india","pakistan","china"]);
[Bindable] private var numVisibleSeries:int = 0;
[Bindable] public var numSelectedSeries:int = 0;
public var temp:int;
public var Area_Nid:String;
public var SelIndicators:String;
public var RadarOS:SharedObject;
public var src:Array = [];
[Bindable] private var NomValue:Array=[];
public var activeVs:int=0;
//public var defaultXMLPath:String="default.xml";
public var defaultXMLPath:String="stock/Users/public/default.xml";
public var configXMLPath:String="config.xml";
public var webserviceWsdl:String="" ;
public var wsForSelection:String="" ;
private var lineSeries:Array = [];
private var columnSeries:Array = [];
private var fillStyles:Dictionary = new Dictionary();
private var visibleSeries:Object = new Object();
private var seriesMapping:Object = new Object();
private var SelectionWindow:TitleWindow=new TitleWindow;
//private var RadarSel:userSelection=new userSelection;
private var legendWindow:TitleWindow=new TitleWindow();
private var vboxProp:VBox;
private var pp:PropertiesPanel;
private var vbox:VBox= new VBox
private var BoolCalledFirstTime:Boolean=true;
public var seriesType:String="";
public var axes:String="";
public var lineForm:String="";
public var fill:String="";
public var strDatabaseName:String='';
[Bindable] public var defaultXML:XML =new XML();
public var defaultXMLValuePath:String="stock/Visualizers/diRadar/defaultdata.xml";
///////////passed the Source XML from my selection window, at first time it will work, but secont time same XML creates problem
public function setChartData(source:XML):void
{
//Alert.show(source.toString());
NomValue=[];
var xml:XML;
categories = [];
lineSeries=[];
columnSeries=[];
for each (xml in source.indicators.indicator)
{
categories.push(xml.toString());
}
countries = [];
dataSource = new ArrayCollection();
var i:int = 0;
var j:int = 0;
for each (var s:Object in source.country)
{
countries.push(s.#name.toString());
}
for each (var cat:String in categories)
{
var o:Object = new Object();
o["Category"] = cat;
dataSource.addItem(o);
}
i = 0;
for each (s in source.country)
{
j = 0;
for each (var value:Number in s.value)
{
NomValue.push(Number(Math.floor(Number(value)*1000)/1000))
dataSource.getItemAt(j)[countries[i]] = Number(Math.floor(Number(value)*1000)/1000);
j++;
}
i++;
}
createSeries(lineSeries,RadarLineSeries);
createSeries(columnSeries, RadarColumnSeries);
initSeriesMapping();
chart.series=lineSeries;
initLegend();
liner.maximum=Math.max.apply(null, NomValue)
////////Properties set at run time
if (lineForm=='1')
{
switchToSegment();
}
else
{
switchToCurve();
}
switch (axes)
{
case ('1'):
hAxis.visible=true;
vAxis.visible=false;
hAxis.includeInLayout=true;
vAxis.includeInLayout=false;
break;
case ('2'):
hAxis.visible=false;
vAxis.visible=true;
hAxis.includeInLayout=false;
vAxis.includeInLayout=true;
break;
case ('3'):
hAxis.visible=true;
vAxis.visible=true;
hAxis.includeInLayout=true;
vAxis.includeInLayout=true;
break;
case ('4'):
hAxis.visible=false;
vAxis.visible=false;
hAxis.includeInLayout=false;
vAxis.includeInLayout=false;
break;
}
if (seriesType=='1')
{
switchToLineSeries()
}
else
{
switchToLineSeries()
}
}
private function createSeries(array:Array, type:Class):void
{
var s:RadarSeries;
for each (var c:String in countries)
{
s = new type();
s.dataField = c;
s.displayName = c;
fillStyles[s] = s.getStyle("areaFill");
if (fill=='1')
{
s.setStyle("areaFill",fillStyles[s]);
}
else
{
s.setStyle("areaFill",emptyColor);
}
s.filterData = false;
s.setStyle('stroke', new Stroke(0xaaaaaa,1,0.7));
if (s is RadarLineSeries)
{
RadarLineSeries(s).setStyle('itemRenderer',new ClassFactory(CircleItemRenderer));
RadarLineSeries(s).setStyle('radius', 5);
}
if (s is RadarColumnSeries)
{
RadarColumnSeries(s).columnWidthRatio=0.6;
}
array.push(s);
}
}
private function initSeriesMapping():void
{
for each (var ls:RadarLineSeries in lineSeries)
{
for each (var cs:RadarColumnSeries in columnSeries)
{
if (ls.displayName == cs.displayName)
{
seriesMapping[ls.uid] = cs;
seriesMapping[cs.uid] = ls;
}
}
}
}
public function showSeries(key:String, value:Boolean = true):void
{
var s:RadarSeries;
if (visibleSeries[key] != value)
numVisibleSeries += value?1:-1;
visibleSeries[key] = value;
for each(s in chart.series)
{
s.visible = numVisibleSeries == 0 || visibleSeries[s.displayName];
seriesMapping[s.uid].visible = s.visible;
}
}
private function initListeners():void
{
}
private function SetDefaultProperties(pp:PropertiesPanel):void
{
pp.seriesType.selectedValue=seriesType;
pp.axes.selectedValue=axes;
pp.lineForm.selectedValue=lineForm;
pp.fill.selectedValue=fill;
}
private function switchToCurve(e:Event = null):void
{
for each (var s:RadarLineSeries in lineSeries)
s.setStyle("form", "curve");
}
private function switchToSegment(e:Event = null):void
{
for each (var s:RadarLineSeries in lineSeries)
s.setStyle("form", "segment");
}
private function switchToFillYes(e:Event = null):void
{
for each (var s:RadarLineSeries in lineSeries)
s.setStyle("areaFill", fillStyles[s]);
}
private function switchToFillNo(e:Event = null):void
{
for each (var s:RadarLineSeries in lineSeries)
s.setStyle("areaFill", emptyColor);
}
private function switchToColumnSeries(e:Event= null):void
{
chart.series = columnSeries;
chart.type = "circular";
}
private function switchToLineSeries(e:Event= null):void
{
chart.series = lineSeries;
chart.type = "polygonal";
}
private function initLegend():void
{
src = [];
for each (var s:RadarSeries in lineSeries)
{
src.push(s.legendData);
}
legend.dataProvider = src;
}
public function resetSeries(evt:MouseEvent):void
{
var s:RadarSeries;
for each(var li:DisplayObject in legend.getChildren())
{
if (li is CustomLegendItem)
(li as CustomLegendItem).selected = false;
}
for each(s in chart.series)
{
s.visible = true;
seriesMapping[s.uid].visible = true;
}
numVisibleSeries = 0;
numSelectedSeries = 0;
visibleSeries = new Object();
}
/***************Legend.as*************************/
public function showThePopUpLegend():void
{
//chart.series=columnSeries;
legendWindow=new TitleWindow();
legendWindow.showCloseButton=true;
legendWindow.height=260;
legendWindow.width=260;
legendWindow.title="Legend";
legendWindow.alpha=2.5;
legendWindow.addEventListener(CloseEvent.CLOSE,closeLegendPopup);
var appcnrl:ControlBar=new ControlBar();
appcnrl.setStyle("horizontalAlign","center");
appcnrl.setStyle("bottom","2");
appcnrl.setStyle("verticalGap","1");
appcnrl.height=40;
var btnok:Button=new Button;
btnok.label="Ok";
btnok.height=20;
btnok.width=70;
btnok.addEventListener(MouseEvent.CLICK,closelegendwindow);
appcnrl.addChild(btnok);
legendWindow.addChild(legend);
legendWindow.addChild(appcnrl);
PopUpManager.addPopUp(legendWindow,this,true);
PopUpManager.centerPopUp(legendWindow);
}
public function closeLegendPopup(e:Event):void
{
PopUpManager.removePopUp(e.currentTarget as IFlexDisplayObject);
}
public function closeLegend(e:MouseEvent):void
{
PopUpManager.removePopUp(PnlLegend);
}
public function showPropWindow():void
{
SelectionWindow=new TitleWindow;
SelectionWindow.title="Properties"
SelectionWindow.showCloseButton=true;
SelectionWindow.alpha=2.5;
SelectionWindow.height=270;
SelectionWindow.width=270;
SelectionWindow.addEventListener(CloseEvent.CLOSE,closePopup);
var appcnrl:ControlBar=new ControlBar()
pp=new PropertiesPanel;
SetDefaultProperties(pp);
pp.addEventListener("lineSeriesEvent", switchToLineSeries)
pp.addEventListener("columnSeriesEvent", switchToColumnSeries)
pp.addEventListener("nAxisEvent", function():void{hAxis.visible=false;vAxis.visible=false;});
pp.addEventListener("hAxisEvent", function():void{hAxis.visible=true;vAxis.visible=false;});
pp.addEventListener("vAxisEvent", function():void{hAxis.visible=false;vAxis.visible=true;});
pp.addEventListener("bAxisEvent", function():void{hAxis.visible=true;vAxis.visible=true;});
pp.addEventListener("curveFormEvent", switchToCurve);
pp.addEventListener("segmentFormEvent", switchToSegment);
pp.addEventListener("fillYesEvent", switchToFillYes);
pp.addEventListener("fillNoEvent", switchToFillNo);
var btnok:Button=new Button;
btnok.label="Ok";
btnok.width=50
btnok.addEventListener(MouseEvent.CLICK,closePropWindow);
appcnrl.percentWidth=100;
appcnrl.height=40;
appcnrl.setStyle("horizontalAlign","center");
appcnrl.setStyle("verticalAlign","bottom");
appcnrl.setStyle("verticalGap","1");
appcnrl.addChild(btnok);
SelectionWindow.addChild(pp);
SelectionWindow.addChild(appcnrl);
PopUpManager.addPopUp(SelectionWindow,this,true);
PopUpManager.centerPopUp(SelectionWindow);
}
public function closePropWindow(e:MouseEvent):void
{
setvalue();
PopUpManager.removePopUp(SelectionWindow);
}
private function setvalue():void
{
seriesType=pp.seriesType.selectedValue.toString();
axes=pp.axes.selectedValue.toString();
lineForm=pp.lineForm.selectedValue.toString();
fill=pp.fill.selectedValue.toString();
}
/************FUnction is USed to Handle the popUps***********/
private var conn:LocalConnection;
public function showThePopUpComponent(passedValue:String):void {
conn = new LocalConnection();
conn.addEventListener(StatusEvent.STATUS, onStatus);
conn.send("RadarConnection", "OpenSelectionWindiow",passedValue);
}
private function onStatus(event:StatusEvent):void {
switch (event.level)
{
case "status":
trace("LocalConnection.send() succeeded");
break;
case "error":
trace("LocalConnection.send() failed");
break;
}
}
public function closePopup(e:Event):void
{
setvalue();
PopUpManager.removePopUp(e.currentTarget as IFlexDisplayObject);
}
public function closelegendwindow(e:MouseEvent):void
{
PopUpManager.removePopUp(legendWindow);
}
private function CancelSelection():void
{
PopUpManager.removePopUp(this)
}
private var point1:Point = new Point();
private var myMenu:Menu;
// Create and display the Menu control.
private function showMenu():void {
myMenu= Menu.createMenu(DisplayObjectContainer(hbMenu), MenuData,false);
myMenu.labelField="#label"
myMenu.addEventListener("itemClick", menuHandler);
// Calculate position of Menu in Application's coordinates.
point1.x=mybutton.x-10;
point1.y=mybutton.y;
point1=mybutton.localToGlobal(point1);
myMenu.show(point1.x, point1.y+20);
}
// Event handler for the Menu control's change event.
private function menuHandler(event:MenuEvent):void {
OpenPopUp(event.item.#value)
//Alert.show("Label: " + event.item.#value, "Clicked menu item");
}
private function OpenPopUp(ItemSelected:String):void
{
switch(ItemSelected)
{
case "0":
break;
case "1":
showThePopUpComponent(App_Type)
break;
case "2":
showThePopUpLegend()
break;
case "3":
showPropWindow()
break;
}
}
pls help me????
[dgarbari said:]
Hi,
Could you provide a [u]minimal[/u] and [u]runnable[/u] sample that reproduces your issue?
Thanks,
Damien

Related Links

Linear Gradient as fill for RadarColumnSerie
Dragging Radar Line Series
How to change angular axis minimum and maximum?
RadarColumnSeries Remove Column Tapering on Large Values
Need to create radar chart without writing code
Radar Labels don\'t update
Radarchart gradient background
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

Categories

DW
IBM messaging
Tivoli Netcool/Impact
Cloud management integ...
IBM SmartCloud Applica...
Brazil
IBM Connections Docs C...
IBM Web Mail Cloud
IBM CMIS for ECM
IBM Kenexa LMS
IBM Kenexa CompAnalyst...
IBM Kenexa Onboard on ...
Marketing Operations
Cloud DevOps
IBM TRIRIGA UX Framework
IBM TRIRIGA CAD Integr...
Environmental and Ener...
Jazz for Service Manag...
Multi-Channel Selling
Cast Iron Studio
SPSS Community News
Rational Developer for...
ERP
Cognos BI 10
Cognos SDK and Diagnos...
Cognos Mobile 10
Rational Team Concert
Build and Release Mana...
xml
Test tivoli forum
Test for satish
Lotus Brasil
Brazil - Java`s Forum
Telecommunications
Government
aW
Pattern Modeling and A...
OpenCL Development Kit...
Tivoli
Web development
Architecture
Linux
APL2 Programming Language
Report abuse
IBM InfoSphere Data Ar...
WebSphere DataStage
IBM Content Integrator
Part 3 - Challenge #08...
For All Type Post
Công ty thiết kế website
WAPL and SOE - Workloa...
WebSphere Portal
IBM Support Assistant ...
CICS Explorer
IBM Monitoring and Dia...
IBM WebSphere Applicat...
AppScan Standard
API
QRadar Incident Forens...
Mobile Store Channel
iPhone Mobile Apps
Web Services
Performance / Scaling
Gentran Basic, RTE, Co...
Gentran Director
**NEW** Sterling Commu...
**NEW** Sterling File ...
IBM Control Center
Applications Q & A
System Architecture
Sterling Commerce Stuff
Distributed Order Mana...
Comments on the OMS Co...
OM Mobile Framework
Gentran Director
JSP Webpages in GIS
Gentran Server for Win...
Connect:Direct for Ope...
Connect:Enterprise UNIX
Feature Request
Application Best Pract...
How Are You Using Sell...
Distance Education Sup...
Platform Issues
Commerce/Order Management
Release 6.4
Gentran Integration Su...
Value added services/L...
Performance Tuning
Usability
Interoperability
WebSphere-MQ
WebSphere-Default Mess...
HATS HotSpot
.NET Visualization Pro...
Gauges, Indicators and...
3D Charts
OPL using CP Optimizer
Questions and Best Pra...
JRules - General
JRules Trial Support -...
Форум System x
QEDWiki
Scripting Tools for SA...
IBM Spectrum Control
IBM Cloud Application ...
Tivoli Decision Suppor...
IBM Enterprise Asset M...
AIX Open Source Software
IT architecture forum
IBM System Storage
Cell Broadband Engine ...
developerWorks XML zon...
Client-side Java progr...
ibmpub.java.vmesa
Best Practices for SOA...

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile