This: [(<?=$jsonTable?>),'CSSR CS 2G'], [(<?=$jsonTable1?>),'CSSR CS 3G'], [(<?=$jsonTable2?>),'CSSR PS 2G'], [(<?=$jsonTable3?>),'CSSR PS 3G']
is your problem. Regardless of what is output by the $jsonTable variables, this structure will never be correct. The data has to be in the form [start time, CSSR CS 2G, CSSR CS 3G, CSSR PS 2G, CSSR PS 3G] for each row of data. I can help you get this set up correctly if you post the rest of your PHP code (the parts relevant to creating the dataTable variables). On Friday, April 26, 2013 12:52:07 PM UTC-4, Alex wrote: > > Hello > A need a help . > My Code don't work. I don't now why. > > <!--Load the AJAX API--> > <script type="text/javascript" src="https://www.google.com/jsapi > "></script> > <script type="text/javascript" src=" > http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> > <script type="text/javascript"> > > > google.load('visualization', '1', {'packages':['coreChart']}); > > // Set a callback to run when the Google Visualization API is loaded. > google.setOnLoadCallback(drawChart); > > function drawChart() { > > // Create our data table out of JSON data loaded from server. > var data = new google.visualization.DataTable(); > data.addColumn('string', 'start_time'); > data.addColumn('number', 'CSSR CS 2G'); > data.addColumn('number', 'CSSR CS 3G'); > data.addColumn('number', 'CSSR PS 2G'); > data.addColumn('number', 'CSSR PS 3G'); > data.addRows([ > [(<?=$jsonTable?>),'CSSR CS 2G'], > [(<?=$jsonTable1?>),'CSSR CS 3G'], > [(<?=$jsonTable2?>),'CSSR PS 2G'], > [(<?=$jsonTable3?>),'CSSR PS 3G'] > ]); > > var options = { > title: 'Acessibility', > //chartArea: {width: 0, top: 30, left: 140, width: "50%", > height: "50%"}, > //backgroundColor: 'yellow', //cor do fundo do grafico > //axisTitlesPosition: 'out', > //vAxis: {title: "Valor"}, //legenda horizontal > //hAxis: {title: "Data"}, //legenda vertical > //colors: ['#AA00CC'], // cor da linha do gráfico > //is3D: 'True', > width: 1500, //largura > height: 400, //Altura > }; > > // Instantiate and draw our chart, passing in some options. > var chart = new > google.visualization.LineChart(document.getElementById('graf31')); > > chart.draw(data,options); > > } > > > -- You received this message because you are subscribed to the Google Groups "Google Visualization API" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/google-visualization-api?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
