I almost finished my project but there's small problem. I'm using three pie chart and I need each to query specific column from my sheet but they all just query from my first and second column in that sheet. here's my code:
var pie1 = new google.visualization.PieChart(document.getElementById('pie1'));
pie1.draw(data, {
backgroundColor: 'whiteSmoke',
width: 280,
height: 200,
legend: 'none',
colors:['#29abe2','#81d5f2','#d3e9f2'],
chartArea:{left:20,top:10,width:"90%",height:"90%"},
view: {
columns: [4, 5]
}
});
var pie2 = new google.visualization.PieChart(document.getElementById('pie2'));
pie2.draw(data, {
backgroundColor: 'whiteSmoke',
width: 280,
height: 200,
legend: 'bottom',
colors:['#f9e208','#f2e77c','#f7f6eb'],
chartArea:{left:20,top:10,width:"90%",height:"90%"},
view: {
columns: [8, 9]
}
});
var pie3 = new google.visualization.PieChart(document.getElementById('pie3'));
pie3.draw(data, {
backgroundColor: 'whiteSmoke',
width: 280,
height: 200,
legend: 'none',
colors:['#8cc63f','#caef8f','#eff9e1'],
chartArea:{left:20,top:10,width:"90%",height:"90%"},
view: {
columns: [12, 13]
}
});
var element = document.getElementById('foo');
element.innerHTML = data.getValue(0, 1);
var element = document.getElementById('foo1');
element.innerHTML = data.getValue(1, 1);
var element = document.getElementById('foo2');
element.innerHTML = data.getValue(2, 1);
var element = document.getElementById('foo3');
element.innerHTML = data.getValue(0, 3);
var element = document.getElementById('foo4');
element.innerHTML = data.getValue(1, 3);
var element = document.getElementById('foo5');
element.innerHTML = data.getValue(2, 3);
}
</script>