XML/SWF Charts para graficar, sin embargo no logro pasarle datos a la gráfica.
Mi código para enviar datos es:
Código:
Aunque logro imprimir el valor del xml que debe cargar, por alguna razón no logro cargarlo, ¿alguien sabe que está pasando? <h1>Grafica</h1> <script language="javascript">AC_FL_RunContent = 0;</script> <script language="javascript"> DetectFlashVer = 0; </script> <script src="components/com_usuarios/views/reportes/tmpl/AC_RunActiveContent.js" language="javascript"></script> <script language="JavaScript" type="text/javascript"> <!-- var requiredMajorVersion = 10; var requiredMinorVersion = 0; var requiredRevision = 45; --> </script> <script language="JavaScript" type="text/javascript"> <!-- if (AC_FL_RunContent == 0 || DetectFlashVer == 0) { alert("This page requires AC_RunActiveContent.js."); } else { var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision); if(hasRightVersion) { AC_FL_RunContent( 'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,45,2', 'width', '500', 'height', '350', 'scale', 'noscale', 'salign', 'TL', 'bgcolor', '#777788', 'wmode', 'opaque', 'movie', 'charts', 'src', 'http://localhost/demo/administrator/components/com_usuarios/flash/charts', 'FlashVars', 'library_path=charts_library&xml_source=http://localhost/demo/administrator/index.php?option=com_usuarios&controller=reporte&task=edit', 'id', 'my_chart', 'name', 'my_chart', 'menu', 'true', 'allowFullScreen', 'true', 'allowScriptAccess','sameDomain', 'quality', 'high', 'align', 'middle', 'pluginspage', 'http://www.macromedia.com/go/getflashplayer', 'play', 'true', 'devicefont', 'false' ); } else { var alternateContent = 'This content requires the Adobe Flash Player. ' + '<u><a href=http://www.macromedia.com/go/getflash/>Get Flash</a></u>.'; document.write(alternateContent); } } // --> </script> <?php defined('_JEXEC') or die('Restricted access'); $currentSession = JSession::getInstance('none',array()); //$GG = $currentSession->get("GG"); $GG = array(0 => "GG1", 1 => "GG2"); $promedios = array(0 => 74.5, 1 => 60); //start the XML output echo "<chart>"; echo "<axis_category shadow='low' size='12' color='88bb77' alpha='100' />"; echo "<axis_ticks value_ticks='true' category_ticks='true' major_thickness='2' minor_thickness='1' minor_count='1' major_color='222222' minor_color='222222' position='centered' />"; echo "<axis_value shadow='low' size='10' color='ffffff' alpha='50' steps='6' prefix='' suffix='' decimals='0' separator='' show_min='true' />"; echo "<series bar_gap='-50' set_gap='50' />"; echo "<chart_border color='000000' top_thickness='0' bottom_thickness='0' left_thickness='4' right_thickness='0' />"; echo "<chart_transition type='drop' delay='0' duration='3' order='all' />"; echo "<chart_data>"; //output the first row that contains the years echo "<row>"; echo "<null/>"; for ($i=0; $i < count($GG); $i++ ) { echo "<string>".$GG[$i]."</string>"; } echo "</row>"; //output row 2 to 4. Each row contains a region name and its data echo "<row>"; echo "<string>regionA</string>"; for ($j=0; $j < count($promedios); $j++) { echo "<number bevel='data'>".$promedios[$j]."</number>"; } echo "</row>"; //finish the XML output echo "</chart_data>"; echo " <chart_grid_h alpha='5' color='000000' thickness='30' />"; echo " <chart_label shadow='low' color='ffffff' alpha='75' size='12' position='center' suffix='%' />"; echo " <chart_rect shadow='high' x='70' y='105' width='340' height='160' positive_color='dba34c' negative_color='ff0000' positive_alpha='65' negative_alpha='25' corner_tl='0' corner_tr='30' corner_br='30' corner_bl='0' />"; echo " <chart_type>bar</chart_type>"; echo " <draw>"; echo " <text shadow='low' color='ff8800' alpha='100' size='20' x='55' y='55' width='400' height='200' h_align='left' v_align='top'>Resumen Alumno Calificaciones: Ciclo Escolar 2009-2010</text>"; echo " </draw>"; echo " <filter>"; echo " <bevel id='data' angle='90' blurX='10' blurY='10' distance='5' highlightAlpha='10' shadowAlpha='20' type='full' />"; echo " <bevel id='small' angle='45' blurX='2' blurY='2' distance='1' highlightAlpha='35' highlightColor='ffffff' shadowColor='000000' shadowAlpha='35' type='inner' />"; echo " <shadow id='high' distance='5' angle='45' alpha='35' blurX='15' blurY='15' />"; echo " <shadow id='low' distance='2' angle='45' alpha='50' blurX='5' blurY='5' />"; echo " </filter>"; echo " <legend layout='hide' />"; echo " <series_color>"; echo " <color>5a4b6e</color>"; echo " </series_color>"; echo "</chart>"; ?>