Hi,
query.send(function (response) {
var baseData = response.getDataTable();
var data = new google.visualization.DataTable();
data.addColumn('string', baseData.getColumnLabel(0));
data.addColumn('number', 'Value');
for (var i = 1; i < baseData.getNumberOfColumns(); i++) {
data.addRow([baseData.getColumnLabel(i), baseData.getValue(0, i)]);
}
google.visualization.drawChart({
containerId: "visualization",
dataTable: data,
chartType: "PieChart",
options: {
title: Site,
colors: ['#0000CC', '#3399FF','#66CC00', '#FFFF00', '#FF9933', '#FF0033',],
legendTextStyle: {color:'#666666', fontSize: '11'},
titleTextStyle: {color: '#006600',fontSize: '12'},
titlePosition: 'out',
legend:'left',
is3D:true,
height: 150,
width: 350,
backgroundColor: 'none',
tooltip: {textStyle: {color: 'black'}, showColorCode: true},
pieSliceText: 'percentage',
pieSliceTextStyle: {color: 'white', fontSize: '11'},
chartArea: {top:'30', left:'5', height:"80%", width:"70%"}
}
I don't really want to include a second pie chart (which is in the example); I'd just like it to reference the above pie I'm already using. Please see the code below for the toolbar that I am trying to use. Perhaps I'm missing the "FROM id number"?
function draw() {
drawToolbar();
}
function queryCallback(response) {
visualization.draw(response.getDataTable(),
{is3D: true});
}
function drawToolbar() {
var components = [
{type: 'igoogle', datasource: '
http://www.google.com/fusiontables/gvizdata?tq=',
gadget: '
https://www.google.com/ig/modules/pie-chart.xml',
userprefs: {'3d': 1}},
{type: 'html', datasource: '
http://www.google.com/fusiontables/gvizdata?tq='},
{type: 'csv', datasource: '
http://www.google.com/fusiontables/gvizdata?tq='},
{type: 'htmlcode', datasource: '
http://www.google.com/fusiontables/gvizdata?tq=',
gadget: '
https://www.google.com/ig/modules/pie-chart.xml',
userprefs: {'3d': 1},
style: 'width: 800px; height: 700px; border: 3px solid purple;'}
];
var container = document.getElementById('toolbar_div');
google.visualization.drawToolbar(container, components);
};
google.setOnLoadCallback(draw);
//above this line ends the download data tool