Base de Datos
Código MySQL:
Chart.htmlVer original
(1, 'Factory 1'), (2, 'Factory 2'), (3, 'Factory 3'); (1, '2003-01-01 17:53:26', 21), (1, '2003-01-02 17:54:13', 23), (1, '2003-01-03 17:54:14', 22), (1, '2003-01-04 17:54:21', 24), (1, '2003-01-05 17:54:45', 32), (1, '2003-01-06 17:54:53', 21), (1, '2003-01-07 17:54:58', 34), (1, '2003-01-08 17:55:04', 32), (1, '2003-01-09 17:55:15', 32), (1, '2003-01-10 17:55:20', 23), (1, '2003-01-11 17:55:26', 23), (1, '2003-01-12 17:55:35', 32), (1, '2003-01-13 17:55:40', 53), (1, '2003-01-14 17:55:44', 23), (1, '2003-01-15 17:55:51', 26), (1, '2003-01-16 17:55:58', 43), (1, '2003-01-17 17:56:04', 16), (1, '2003-01-18 17:56:09', 45), (1, '2003-01-19 17:56:15', 65), (1, '2003-01-20 17:56:22', 54), (2, '2003-01-01 17:53:26', 121), (2, '2003-01-02 17:54:13', 123), (2, '2003-01-03 17:54:14', 122), (2, '2003-01-04 17:54:21', 124), (2, '2003-01-05 17:54:45', 132), (2, '2003-01-06 17:54:53', 121), (2, '2003-01-07 17:54:58', 134), (2, '2003-01-08 17:55:04', 132), (2, '2003-01-09 17:55:15', 132), (2, '2003-01-10 17:55:20', 123), (2, '2003-01-11 17:55:26', 123), (2, '2003-01-12 17:55:35', 132), (2, '2003-01-13 17:55:40', 153), (2, '2003-01-14 17:55:44', 123), (2, '2003-01-15 17:55:51', 126), (2, '2003-01-16 17:55:58', 143), (2, '2003-01-17 17:56:04', 116), (2, '2003-01-18 17:56:09', 145), (2, '2003-01-19 17:56:15', 165), (2, '2003-01-20 17:56:22', 154), (3, '2003-01-01 17:53:26', 54), (3, '2003-01-02 17:54:13', 56), (3, '2003-01-03 17:54:14', 89), (3, '2003-01-04 17:54:21', 56), (3, '2003-01-05 17:54:45', 98), (3, '2003-01-06 17:54:53', 76), (3, '2003-01-07 17:54:58', 65), (3, '2003-01-08 17:55:04', 45), (3, '2003-01-09 17:55:15', 75), (3, '2003-01-10 17:55:20', 54), (3, '2003-01-11 17:55:26', 75), (3, '2003-01-12 17:55:35', 76), (3, '2003-01-13 17:55:40', 34), (3, '2003-01-14 17:55:44', 97), (3, '2003-01-15 17:55:51', 55), (3, '2003-01-16 17:55:58', 43), (3, '2003-01-17 17:56:04', 16), (3, '2003-01-18 17:56:09', 35), (3, '2003-01-19 17:56:15', 78), (3, '2003-01-20 17:56:22', 75);
Código HTML:
Ver original
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <body bgcolor="#ffffff"> <!-- Start Code for FusionCharts chart --> <script type="text/javascript"> var myChart = new FusionCharts("MSLine.swf", "FusionCharts_1", "450", "300", "0", "0"); myChart.setDataURL("Data.xml"); myChart.render("chartdiv"); </script> <!-- End Code for FusionCharts chart --> </body> </html>
Data.xml
Código XML:
Ver original
<chart caption="Vibraciones de la Unidad" subcaption="(Del 8/6/2010 to 8/12/2010)" linethickness="1" showvalues="1" formatnumberscale="0" anchorradius="2" divlinealpha="20" divlinecolor="CC3300" divlineisdashed="1" showalternatehgridcolor="1" alternatehgridalpha="5" alternatehgridcolor="CC3300" shadowalpha="40" labelstep="2" numvdivlines="5" chartrightmargin="35" bgcolor="FFFFFF,CC3300" bgangle="270" bgalpha="10,10" decimalprecision="2" palette="1" xaxisname="Fecha de registro Monitoreo de novedades" yaxisname="Variaciones de Cojinetes"> <categories> <category label="8/6/2010" /> <category label="8/7/2010" /> <category label="8/8/2010" /> <category label="8/9/2010" /> <category label="8/10/2010" /> <category label="8/11/2010" /> <category label="8/12/2010" /> </categories> - <dataset seriesname="Vibr 1 Cojinete" color="1D8BD1" anchorbordercolor="1D8BD1" anchorbgcolor="1D8BD1"> <set value="1.32" /> <set value="1.26" /> <set value="16.9" /> <set value="15.1" /> <set value="19.4" /> <set value="19.7" /> <set value="1.29" /> </dataset> - <dataset seriesname="Vibr 2 Cojinete" color="F1683C" anchorbordercolor="F1683C" anchorbgcolor="F1683C"> <set value="2.04" /> <set value="3.21" /> <set value="2.99" /> <set value="3.11" /> <set value="2.84" /> <set value="3.57" /> <set value="1.86" /> </dataset> - <dataset seriesname="Vibr 3 Cojinete" color="2AD62A" anchorbordercolor="2AD62A" anchorbgcolor="2AD62A"> <set value="8.50" /> <set value="1.01" /> <set value="11.16" /> <set value="12.34" /> <set value="1.21" /> <set value="1.05" /> <set value="8.20" /> </dataset> - <dataset seriesname="Vibr 4 Cojinete" color="DBDC25" anchorbordercolor="DBDC25" anchorbgcolor="DBDC25"> <set value="5.41" /> <set value="7.81" /> <set value="9.20" /> <set value="7.54" /> <set value="8.40" /> <set value="8.93" /> <set value="4.51" /> </dataset> - <styles> - <definition> <style name="CaptionFont" type="font" size="12" /> </definition> - <application> <apply toObject="CAPTION" styles="CaptionFont" /> <apply toObject="SUBCAPTION" styles="CaptionFont" /> </application> </styles> </chart>
Muy bien para los que tengan fusioncharts v3 sabran que esto funciona correctamente y si tienen dudas probar sin embargo, creo que me ahogo en un baso de agua con esta posible solucion que intento funcione pero no ha sido posible y espero que me ayuden...
Código PHP:
Ver original
<?php require_once('Connections/Graficos.php'); ?> <?php include("Includes/FusionCharts.php"); ?> <?php $strXML .="<chart caption='Vibraciones de la Unidad' subcaption='(Del 8/6/2010 to 8/12/2010)' linethickness='1' showvalues='1' formatnumberscale='0' anchorradius='2' divlinealpha='20' divlinecolor='CC3300' divlineisdashed='1' showalternatehgridcolor='1' alternatehgridalpha='5' alternatehgridcolor='CC3300' shadowalpha='40' labelstep='2' numvdivlines='5' chartrightmargin='35' bgcolor='FFFFFF,CC3300' bgangle='270' bgalpha='10,10' decimalprecision='2' palette='1' xaxisname='Fecha de registro Monitoreo de novedades' yaxisname='Variaciones de Cojinetes'>"; $strXML .="<categories>"; $strXML .="<category value='".$row_query_1['fecha']."'/>"; } $strXML .="</categories>"; $strXML .=" <dataset seriesname='Vibr 1 Cojinete' color='1D8BD1' anchorbordercolor='1D8BD1' anchorbgcolor='1D8BD1'>"; $strXML .= "<set label='" .$row_query2['vrbr1']. "' />"; $strXML .="</dataset>"; $strXML .=" <dataset seriesname='Vibr 2 Cojinete' color='1D8BD1' anchorbordercolor='1D8BD1' anchorbgcolor='1D8BD1'>"; $strXML .= "<set label='" . $row_query3['vrbr2']. "' />"; $strXML .="</dataset>"; $strXML .=" <dataset seriesname='Vibr 3 Cojinete' color='1D8BD1' anchorbordercolor='1D8BD1' anchorbgcolor='1D8BD1'>"; $strXML .= "<set label='" . $row_query4['vrbr3']. "' />"; $strXML .="</dataset>"; $strXML .=" <dataset seriesname='Vibr 4 Cojinete' color='1D8BD1' anchorbordercolor='1D8BD1' anchorbgcolor='1D8BD1'>"; $strXML .= "<set label='" . $row_query5['vrbr2']. "' />"; $strXML .="</dataset>"; $strXML .= "<styles>"; $strXML .=" <definition>"; $strXML .=" <style name='CaptionFont' type='font' size='12' />"; $strXML .=" </definition>"; $strXML .=" <application>"; $strXML .=" <apply toObject='CAPTION' styles='CaptionFont' />"; $strXML .=" <apply toObject='SUBCAPTION' styles='CaptionFont' />"; $strXML .="</application>"; $strXML .="</styles>"; $strXML .="</chart>"; echo $strXML; echo renderChart("MSLine.swf", "", $strXML, "Vibraciones", 450, 300, 0, 0); //"MSLine.swf", "FusionCharts_1", "450", "300", "0", "0" ?>
Este ultimo es mi dolor de cabesa si me pueden ayudar seria genial y les agradeceria un monton, exito a todos y hasta pronto ................
Ayuden Me....