animate the google chart on the first time it draws

Google has updated chart options and added the option to animate the chart on the first time it draws http://stackoverflow.com/questions/9714254/google-visualization-animation-when-chart-loads-for-the-first-time?rq=1

by Damith Nuwan Sampath

HTML

<div id="chart_div" style="width: 500px; height: 500px;"></div>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>

JavaScript

google.load("visualization", "1.1", {
        packages: ["corechart"]
    });  
google.setOnLoadCallback(drawChart);


    function drawChart() {

        var data = google.visualization.arrayToDataTable([
            ['Year', 'Sales', 'Expenses', 'Profit'],
            ['2014', 1000, 400, 200],
            ['2015', 1170, 460, 250],
            ['2016', 660, 1120, 300],
            ['2017', 1030, 540, 350]
        ]);

        var options = {
            animation: {
                duration: 1500,
                startup: true
            }
        };


        chart = new google.visualization.ColumnChart(document.getElementById('chart_div'));
        chart.draw(data, options);
    }