Comunidad de diseño web y desarrollo en internet online

conectar a amcharts con xml

Citar            
MensajeEscrito el 10 Feb 2010 09:50 pm
<?xml version="1.0" encoding="utf-8" ?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:amcharts="http://www.amcharts.com/com_internal" layout="absolute" backgroundColor="#FFFFFF" width="100%" height="100%" creationComplete="personas.send()">
<mx:HTTPService id="personas" url="http://localhost:8080/DashBoard/xml/conection.php" resultFormat="e4x" fault="Alert.show(event.fault.faultString), 'Error'"/>
<mx:Script>
<![CDATA[ import mx.collections.ArrayCollection;

[Bindable]
private var chartData:ArrayCollection = new ArrayCollection([
{Nodos:"Nodo 1 \n Santiago",validacion:100,requerimiento:100,tendido:100,equipamiento:100,oocc:100,empalme:100,fo:100,hub:100,activacion:100,auditoria:100,revision:100,hub:1},
{Nodos:"Nodo 2 \n Maipu",validacion:100,requerimiento:55,tendido:13,equipamiento:30,oocc:20,empalme:100,fo:20,hub:20,activacion:20,auditoria:20,revision:20,hub:2},
{Nodos:"Nodo 3 \n Valdivia",validacion:100,requerimiento:70,tendido:13,equipamiento:0,oocc:90,empalme:5,fo:20,hub:20,activacion:20,auditoria:20,revision:20,hub:3},
{Nodos:"Nodo 4 \n Arica",validacion:100,requerimiento:15,tendido:13,equipamiento:16,oocc:20,empalme:10,fo:20,hub:20,activacion:20,auditoria:20,revision:20,hub:2},
{Nodos:"Nodo 5 \n Pudahuel",validacion:100,requerimiento:50,tendido:13,equipamiento:0,oocc:70,empalme:20,fo:20,hub:20,activacion:20,auditoria:20,revision:20,hub:1},
{Nodos:"Nodo 6 \n Con-Con",validacion:100,requerimiento:30,tendido:0,equipamiento:0,oocc:0,empalme:0,fo:0,hub:0,activacion:0,auditoria:0,revision:0,hub:1}
]);


private function makeRounded():void{
if(chbox.selected){
chart.setStyle("angle", 0);
chart.setStyle("depth3D", 0);

}
else{
chart.setStyle("angle", 30);
chart.setStyle("depth3D", 20);
}

for(var i:uint = 0; i < chart.graphs.length; i++){
var graph:AmGraph = chart.graphs[i];
if(chbox.selected){
graph.setStyle("cornerRadiusTop", 8);
graph.setStyle("cornerRadiusBottom", 8);
}
else{
graph.setStyle("cornerRadiusTop", 0);
graph.setStyle("cornerRadiusBottom", 0);
}
}
}



import flash.utils.Timer;
import flash.events.TimerEvent;
import flash.events.Event;
import mx.controls.Alert;


public function Animar():void {
var test:Timer = new Timer(10000);
test.addEventListener(TimerEvent.TIMER, prueba);
test.start();
}

public function prueba(event:TimerEvent):void {
personas.send();

Alert.show("Text Copied!"+ personas.lastResult.nodo.nombre_requerimiento, "Alert Box", Alert.OK);

}


]]>
</mx:Script>
<mx:VBox width="100%" height="100%" >
<mx:ApplicationControlBar x="4" y="10" width="94%" >
<mx:Image source="file:///C|/Users/Arkano/Desktop/dashboard.gif"/>
<mx:Label text="Sistema de Monitoreo de instalacion HFC (Semana 24 de Enero al 30 de Enero )" fontSize="14" fontWeight="bold"/>
</mx:ApplicationControlBar>
<mx:HBox width="100%" height="100%" >

<amcharts:AmCartesianChart width="100%" height="100%" id="chart" marginTop="25" marginLeft="20" marginRight="20" marginBottom="40" textAlign="center" dataProvider="{personas.lastResult.nodo}" categoryField="nombre_requerimiento" startDuration="1" angle="30" depth3D="20" plotAreaFillAlphas="[0]" >
<amcharts:graphs>
<amcharts:AmGraph balloonText="En el porcentaje de avance es:% en actividad Validacion de Datos de Diseno" color="#FFFFFF" labelText="[[ConfecciondePoligomo]]%" title="ConfecciondePoligomo" valueField="{personas.lastResult.nodo.nombre_requerimiento}" type="column" lineAlpha="0" fillAlphas="[0.8]" />
</amcharts:graphs>
<amcharts:valueAxes>
<amcharts:ValueAxis stackType="100%" gridAlpha="0" axisAlpha="0" labelsEnabled="false" />
</amcharts:valueAxes>
<amcharts:categoryAxis>
<amcharts:CategoryAxis gridAlpha="0" axisAlpha="0" fontWeight="bold" />
</amcharts:categoryAxis>
</amcharts:AmCartesianChart>
<mx:VBox>
<amcharts:AmLegend fontWeight="bold" textClickEnabled="false" reversedOrder="true" dataProvider="{chart}" width="155" valueWidth="0" marginTop="25" marginLeft="0" marginRight="15" marginBottom="15" />
<mx:CheckBox id="chbox" label="rounded corners" click="{makeRounded()}" />
</mx:VBox>
</mx:HBox>
</mx:VBox>
</mx:Application>

Por Arkano

19 de clabLevel



 

el infierno

firefox
Citar            
MensajeEscrito el 10 Feb 2010 09:52 pm
sorry pero no puedo editar el post =/


estimados tengo un problema ya que hice un grafico con amcharts todo bien ya lo hice con ArrayCollection pero ahora necesito que vaya a buscar datos de un httpservice pero nada


aca dejo el codigo por si alguien me ve el error

Por Arkano

19 de clabLevel



 

el infierno

firefox
Citar            
MensajeEscrito el 10 Feb 2010 10:43 pm
estas usando el trial o tienes la licencia completa ¿la compraste?????

Por xcom

Claber

530 de clabLevel



 

firefox
Citar            
MensajeEscrito el 11 Feb 2010 12:24 am
full en la empresa lo tienen porque?

Por Arkano

19 de clabLevel



 

el infierno

msie8

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.