Personnally, i use SQLServer2008 with php and the google chart things work
fine
PHP side with PDO :
if(!$result=$stats->query($sql))
{
echo $sql;
}
$json='{"cols": [
{"id":"a","label":"Code,"type":"string"},
{"id":"b","label":"'Country","type":"string"},
{"id":"c","label":"Volume","type":"number"}
],
"rows": [';
while($val=$result->fetch())
{
$json
.='{"c":[{"v":"'.$val['CodeISO'].'"},{"v":"'.$val['Description'].'"},{"v":'.$val['nb'].'}]},';
}
$json=substr($json,0,-1);
$json .=']
}';
echo $json;
JScript side :
function drawChart() {
$.ajax({
url: "ajax/get-php.php",
dataType:"json",
async: true,
beforeSend: function()
{
$("#map").html('<div style=\"text-align:center\"><img
src=\'img/ajax-loader.gif\' /></div>');
},
success: function(json)
{
var datamap = new google.visualization.DataTable(json);
var map = new google.visualization.GeoChart(document.getElementById('map'));
map.draw(datamap,{
region: 'fr',
resolution:'provinces',
legend:'none',
colorAxis: {colors:['#1D71B8']}
});
}
});
}
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-visualization-api/-/5xrUpq0HCTkJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-visualization-api?hl=en.