Ok so we have 3 category pickers that are binded with the chart, so if
only 2 sets of valuess are selected from the pickers it will display
the chart, but if none or 1 is selected the chart will not display.
I am also getting an a is null error on the first 2 category pickers
although they are still working fine.?
<script type="text/javascript" src="
http://www.google.com/jsapi"></
script><script type="text/javascript">
google.load('visualization', '1.1', {packages:
['corechart','controls']});
function drawVisualization() {
var categoryPicker = new google.visualization.ControlWrapper({
controlType: 'CategoryFilter',
dataSourceUrl: 'GOOGLE SPREADSHEET',
containerId: 'control1',
options: {
'filterColumnIndex': '2',
'ui': {
'labelStacking': 'vertical',
'allowTyping': false,
'allowMultiple': false
}
}
});
var categoryPicker1 = new
google.visualization.ControlWrapper({
controlType: 'CategoryFilter',
dataSourceUrl: 'GOOGLE SPREADSHEET',
containerId: 'control2',
options: {
'filterColumnLabel': 'Region',
'ui': {
'labelStacking': 'vertical',
'allowTyping': false,
'allowMultiple': false
}
}
});
var categoryPicker2 = new google.visualization.ControlWrapper({
controlType: 'CategoryFilter',
dataSourceUrl:'GOOGLE SPREADSHEET',
containerId: 'control3',
options: {
'filterColumnLabel': 'Gender',
'ui': {
'labelStacking': 'vertical',
'allowTyping': false,
'allowMultiple': false
}
}
});
var barChart = new google.visualization.ChartWrapper({
'chartType': 'BarChart',
dataSourceUrl:'GOOGLE SPREADSHEET',
'containerId': 'chart1',
'options': {
'width': 400,
'height': 300,
tooltipTextStyle : {color: 'black'} ,
'hAxis': {minValue: 0, maxnValue: 3200},
'vAxis': {textPosition: 'none'},
'chartArea': {top: 0, right: 0, bottom: 0}
},
// Configure the barchart to use columns 2 (City) and 3
(Population)
'view': {'columns': [ 26, 5, 6, 7, 8, 9]}
});
var barChart1 = new google.visualization.ChartWrapper({
'chartType': 'BarChart',
dataSourceUrl:'GOOGLE SPREADSHEET',
'containerId': 'chart2',
'options': {
'width': 400,
'height': 300,
'chartArea': {top: 0, right: 0, bottom: 0}
},
// Configure the barchart to use columns 2 (City) and 3
(Population)
'view': {'columns': [ 25, 10, 11, 12, 13, 14]}
});
var barChart2 = new google.visualization.ChartWrapper({
'chartType': 'BarChart',
dataSourceUrl:'GOOGLE SPREADSHEET',
'containerId': 'chart3',
'options': {
'width': 400,
'height': 300,
'chartArea': {top: 0, right: 0, bottom: 0}
},
'view': {'columns': [ 25, 15, 16, 17, 18, 19]}
});
var barChart3 = new google.visualization.ChartWrapper({
'chartType': 'BarChart',
dataSourceUrl:'GOOGLE SPREADSHEET',
'containerId': 'chart4',
'options': {
'width': 400,
'height': 300,
'chartArea': {top: 0, right: 0, bottom: 0}
},
'view': {'columns': [ 25, 20, 21, 22, 23, 24]}
});
new
google.visualization.Dashboard(document.getElementById('dashboard')).
bind([categoryPicker, categoryPicker1, categoryPicker2],
[barChart, barChart1, barChart2, barChart3])
categoryPicker.draw();
categoryPicker1.draw();
categoryPicker2.draw();
barChart.draw();
barChart1.draw();
barChart2.draw();
barChart3.draw();
}
google.setOnLoadCallback(drawVisualization);
</script>
<div id="dashboard">
<table border="0" cellpadding="0" cellspacing="0" class="table2"
style="width: 762px; height: 687px">
<tbody>
<tr>
<td colspan="3">
<h3>
Select your category:</h3>
</td>
</tr>
<tr>
<td>
<div id="control1" style="width: 100px; height:
100px">
</div>
</td>
<td>
<div id="control2" style="width: 250px; height:
300px">
</div>
</td>
<td>
<div id="control3" style="width: 250px; height:
300px">
</div>
</td>
</tr>
<tr>
<td colspan="3">
</td>
</tr>
<tr>
<td>
<div id="chart1" style="width: 250px; height:
300px">
</div>
</td>
</tr>
<tr>
<td colspan="3">
</td>
</tr>
<tr>
<td>
<div id="chart2" style="width: 250px; height:
300px">
</div>
</td>
</tr>
<tr>
<tr>
<td colspan="3">
</td>
</tr>
<td>
<div id="chart3" style="width: 250px; height:
300px">
</div>
</td>
</tr>
<tr>
<td colspan="3">
</td>
</tr>
<tr>
<td>
<div id="chart4" style="width: 250px; height:
300px">
</div>
</td>
</tr>
</tbody>
</table>
</div>
<p>
</p>
On Aug 1, 11:53 am, Viz Kid <
viz...@google.com> wrote:
> Hi
>
> I'm not sure what you meant by "categories" and "selected".
>
> Viz Kid
>