HelloA 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, //larguraheight: 400, //Altura};// Instantiate and draw our chart, passing in some options.var chart = new google.visualization.LineChart(document.getElementById('graf31'));chart.draw(data,options);}
thanks my code:<?php// Aceder a base de dados$host = "...";$user= "...";$pass = "....";$db="....";$acessoDB = pg_connect("host=$host dbname=$db user=$user password=$pass");if (!$acessoDB){die ("Não foi possível aceder à base de dados.");}$queryData =pg_query("SELECT start_time, media_cssr_cs_2g_quinzenalFROM huawei.quinzenal_cssr_cs_2gORDER BY start_time");$queryData1 =pg_query("SELECT start_time, media_cssr_cs_3g_quinzenalFROM huawei.quinzenal_cssr_cs_3gORDER BY start_time");$queryData2 =pg_query("SELECT start_time, media_cssr_ps_2g_quinzenalFROM huawei.quinzenal_cssr_ps_2gORDER BY start_time");$queryData3 =pg_query("SELECT start_time, media_cssr_ps_3g_quinzenalFROM huawei.quinzenal_cssr_ps_3gORDER BY start_time");$table = array();$table['cols'] = array(array('label' => 'start_time', 'type' => 'string'),array('label' => 'CSSR CS 2G', 'type' => 'number'),array('label' => 'CSSR CS 3G', 'type' => 'number'),array('label' => 'CSSR PS 2G', 'type' => 'number'),array('label' => 'CSSR PS 3G', 'type' => 'number'));//1 Series$rows = array();while($r = pg_fetch_assoc($queryData)) {$temp = array();// the following line will used to slice the Pie chart$temp[] = array('v' => (string) $r['start_time']);//Values of the each slice$temp[] = array('v' => (float) $r['media_cssr_cs_2g_quinzenal']);$rows[] = array('c' => $temp);}$table['rows'] = $rows;$jsonTable = json_encode($table);//echo $jsonTable;//2 Series$rows = array();while($r = pg_fetch_assoc($queryData1)) {$temp = array();// the following line will used to slice the Pie chart$temp[] = array('v' => (string) $r['start_time']);//Values of the each slice$temp[] = array('v' => (float) $r['media_cssr_cs_3g_quinzenal']);$rows[] = array('c' => $temp);}$table['rows'] = $rows;$jsonTable1 = json_encode($table);//echo $jsonTable1;//3 Series$rows = array();while($r = pg_fetch_assoc($queryData2)) {$temp = array();// the following line will used to slice the Pie chart$temp[] = array('v' => (string) $r['start_time']);//Values of the each slice$temp[] = array('v' => (float) $r['media_cssr_ps_2g_quinzenal']);$rows[] = array('c' => $temp);}$table['rows'] = $rows;$jsonTable2 = json_encode($table);//echo $jsonTable2;//4 Series$rows = array();while($r = pg_fetch_assoc($queryData3)) {$temp = array();// the following line will used to slice the Pie chart$temp[] = array('v' => (string) $r['start_time']);//Values of the each slice$temp[] = array('v' => (float) $r['media_cssr_ps_3g_quinzenal']);$rows[] = array('c' => $temp);}$table['rows'] = $rows;$jsonTable3 = json_encode($table);//echo $jsonTable3;?><html><head>
</script></head><body><!--Div that will hold the chart--><div id="graf31"></div></body></html>
HiThanks, but the code did not work.In axeno i send you the error.
Thank you very much, now it's ok :):):):)I modified the code to:$queryData =pg_query("SELECT a.start_time, a.media_cssr_cs_2g_quinzenal, b.media_cssr_cs_3g_quinzenal, c.media_cssr_ps_2g_quinzenal, d.media_cssr_ps_3g_quinzenalFROM huawei.quinzenal_cssr_cs_2g AS aFULL JOIN huawei.quinzenal_cssr_cs_3g AS b ON (a.start_time = b.start_time)FULL JOIN huawei.quinzenal_cssr_ps_2g AS c ON (a.start_time = c.start_time)FULL JOIN huawei.quinzenal_cssr_ps_3g AS d ON (a.start_time = d.start_time)ORDER BY a.start_time,b.start_time,c.start_time,d.start_time");but still have a problem with the X axis.
I will analyze the problem and I will tel you something.
knows how to work with MACRO excel?
thanks again :D :D
--
You received this message because you are subscribed to a topic in the Google Groups "Google Visualization API" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-visualization-api/gQU4-GDivoE/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
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.
--
Cumprimentos.
Irina Lima
Also if I wanted to change the X-Axis as I do. Do I use names with or without values ?
To unsubscribe from this group and all its topics, send an email to google-visualization-api+unsubscr...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
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.
--
Cumprimentos.
Irina Lima
--
You received this message because you are subscribed to a topic in the Google Groups "Google Visualization API" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-visualization-api/gQU4-GDivoE/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
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.
--
Cumprimentos.
Irina Lima
Attached please find what I want.
From the table with the data base, I want to make the graphs above with the codes I have sent to you earlier”
SELECT COALESCE(a.lac, b.ilha) as lac, a.max_subscriber_per_lac_semanal FROM siemens.semanal_subscriber_per_lac AS a
FULL JOIN geral.lac AS b ON (a.lac = 'b.ilha')
ORDER BY a.lac,b.ilha;
ERROR: invalid input syntax for integer: "b.ilha"
ilha is varchar and lac is integer
--
Cumprimentos.
Irina Lima
Yes, I have 2 tables in database.1 table = geral.lac2 table= siemens.semanal.....Attached please
Attached please find what I want.
From the table with the data base, I want to make the graphs above with the codes I have sent to you earlier”
SELECT COALESCE(a.lac, b.ilha) as lac, a.max_subscriber_per_lac_semanal FROM siemens.semanal_subscriber_per_lac AS a
FULL JOIN geral.lac AS b ON (a.lac = 'b.ilha')
ORDER BY a.lac,b.ilha;
ERROR: invalid input syntax for integer: "b.ilha"
ilha is varchar and lac is integer
2013/4/29 asgallant <drew_g...@abtassoc.com>What is it you would like to have for the x-axis values?
--
Cumprimentos.
Irina Lima--
Cumprimentos.
Irina Lima
--
You received this message because you are subscribed to a topic in the Google Groups "Google Visualization API" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-visualization-api/gQU4-GDivoE/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
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.
Hello good morningI have a question and would like to know if I can clarify.I have a chart with dates and amounts, dates exchanges wanted by name.how to do it?thanks
Can you describe exactly what it is you want here?
On Friday, May 10, 2013 8:32:44 AM UTC-4, Alex wrote:--
Hello ASGLLANT,I need your help again.I need to do checkbox with value in database and show graphs.My difficulty is with queries.
You received this message because you are subscribed to a topic in the Google Groups "Google Visualization API" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-visualization-api/gQU4-GDivoE/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
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.
--
Cumprimentos.
Irina Lima