I have a 2 divs created from as google visualization pie chart that I need to overlay and set to a specific points on a map, but I can't figure out for the life of me how to do it. I know it's going to be some sort of custom overlay...
any ideas?
<html>
<head>
<script type="text/javascript" src="
https://www.google.com/jsapi"></script>
<script type="text/javascript" src="
http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
var center = new google.maps.LatLng(39, -120);
var zoom = 10;
var map;
function initialize() {
map = new google.maps.Map(document.getElementById('map_canvas'), {
center: center,
zoom: zoom,
mapTypeId: 'roadmap'
});
}
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChart);
function drawChart() {
var countText1 = encodeURIComponent("SELECT 'Fruit', 'Pieces' FROM 1008011 WHERE 'Pieces'>2");
var countFruit1 = '
http://www.google.com/fusiontables/gvizdata?tq=' + countText1;
google.visualization.drawChart({
"containerId": "chart_div",
"dataSourceUrl": countFruit1,
"chartType": "PieChart",
"options": {
"width": 400,
"height" : 400,
"backgroundColor" : 'transparent',
"colors" : ['red','yellow','green','orange']
}
});
var countText2 = encodeURIComponent("SELECT 'Fruit', 'Pieces' FROM 1008011 WHERE 'Pieces'<8");
var countFruit2 = '
http://www.google.com/fusiontables/gvizdata?tq=' + countText2;
google.visualization.drawChart({
"containerId": "chart_div2",
"dataSourceUrl": countFruit2,
"chartType": "PieChart",
"options": {
"width": 400,
"height" : 400,
"backgroundColor" : 'transparent',
"colors" : ['red','yellow','green','orange']
}
});
}
</script>
</head>
<body onload="initialize();">
<div id="map_canvas" style="width: 600; height:600;"></div>
<div id="chart_div"></div>
<div id="chart_div2"></div>
</body>
</html>