New to google charts and exploring sample code to check I can replicate functionality.
I am unable to get my column chart to animate from within a dashboard wrapper.
<html>
<head>
<!--Load the AJAX API-->
<script type="text/javascript">
// Load the Visualization API and the controls package.
google.charts.load('current', {'packages':['bar', 'controls']});
// Set a callback to run when the Google Visualization API is loaded.
google.charts.setOnLoadCallback(drawDashboard);
// Callback that creates and populates a data table,
// instantiates a dashboard, a range slider and a pie chart,
// passes in the data and draws it.
function drawDashboard() {
var data = google.visualization.arrayToDataTable([
['Date Sort', 'Date','Act_No', 'Activity','sub_no', 'Subject','Duration', 'Location_no','Location', 'Day','Colleague', 'Phase'],
[20160608,new Date(2016,06,08),3,'Class Teaching',2,'Reading',60,1,'In-School','Saturday','Colleague A','Key Stage One'],
[20160608,new Date(2016,06,08),3,'Class Teaching',3,'Writing',60,1,'In-School','Saturday','Colleague A','Key Stage One'],
[20160608,new Date(2016,06,08),3,'Class Teaching',4,'Mathematics',60,1,'In-School','Saturday','Colleague A','Key Stage One'],
[20160608,new Date(2016,06,08),3,'Class Teaching',5,'Science',60,1,'In-School','Saturday','Colleague A','Key Stage One'],
[20160609,new Date(2016,06,09),3,'Class Teaching',2,'Reading',60,1,'In-School','Tuesday','Colleague A','Key Stage One'],
[20160609,new Date(2016,06,09),3,'Class Teaching',3,'Writing',60,1,'In-School','Tuesday','Colleague A','Key Stage One'],
[20160609,new Date(2016,06,09),3,'Class Teaching',4,'Mathematics',60,1,'In-School','Tuesday','Colleague A','Key Stage One']
]); // 'false' means that the first row contains labels, not data.
// Create a dashboard.
var dashboard = new google.visualization.Dashboard(
document.getElementById('dashboard_div'));
var control = new google.visualization.ControlWrapper({
'controlType': 'CategoryFilter',
'containerId': 'filter_div',
'options': {
'filterColumnIndex': 5,
'ui': {
'allowTyping': false,
'allowMultiple': true,
'selectedValuesLayout': 'aside'
}
},
'state': {'selectedValues': []}
});
// Create a pie chart, passing some options
var pieChart = new google.visualization.ChartWrapper({
'chartType': 'Bar',
'containerId': 'chart_div',
'options': {
'chart': { 'title': 'Density of Precious Metals, in g/cm'},
'width': 600,
'height': 300,
'bar': {'groupWidth': '85%'},
'legend': { 'position': 'left' },
'animation':{ 'duration': 6000, 'easing': 'linear','startup': 'true'}
},
'view': {'columns': [5, 4]}
});
dashboard.bind(control, pieChart);
// Draw the dashboard.
dashboard.draw(data);
}
</script>
</head>
<body>
<!--Div that will hold the dashboard-->
<div id="dashboard_div">
<!--Divs that will hold each control and chart-->
<div id="filter_div"></div>
<div id="chart_div"></div>
</div>
</body>
</html>