I am new to Google Charts. I have taken the code for a Google line chart and placed it in an external javascript file.
I've linked the js file to the html file, but the chart will not appear on the page. What am I doing wrong.
<script type="text/javascript">
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Year', 'Number Commissioned'],
['1989',1],
['1991',2],
['1992',1],
['1993',3],
['1995',3],
['1996',1],
['1997',2],
['1998',3],
['1999',1],
['2000',5],
['2002',5],
['2003',1],
['2004',9],
['2005',1],
['2006',8],
['2007',11],
['2008',18],
['2009',13],
['2010',31],
['2011',12],
['2012',18],
['2013',13],
['2014',6]
]);
var options = {
title: 'Number of Art Commissioned Each Year'
};
var chart = new google.visualization.LineChart(document.getElementById('linechartbyyear'));
chart.draw(data, options);
}
</script>
Thank you in advance for the help.
Delinda