I am trying to copy this example.
The example has this definition:
var data = google.visualization.arrayToDataTable([
['a', 14],
['b', 47],
['c', 80],
['d', 55],
['e', 16],
['f', 90],
['g', 29],
['h', 23],
['i', 58],
['j', 48]
// Treat first row as data as well.
], true);
I have replaced the first parameter with my variable buckets
which is also an array of length-2 arrays. I'm getting the following error which makes no sense:
TypeError: google.visualization.arrayToDataTable is not a function
Even if buckets
is malformed(which I don't think it is) how could that change the identity of arrayToDataTable? It's still a function!
I understand that this is a very late answer, but just in case anybody else comes across this question I'll post this here. I had the same error, but then I checked out how Google Developers did it on their jsfiddle.
Replace this:
<script src="//www.google.com/jsapi"></script>
With this:
<script type="text/javascript" src="https://www.google.com/jsapi?autoload=
{'modules':[{'name':'visualization','version':'1.1','packages':
['corechart']}]}"></script>
And then delete this line:
google.load("visualization", "1", {packages:["corechart"]});
And of course, make sure that you run it on a server.
Looks like you haven't loaded the Google Visualization API. Have you got this somewhere?
<script src="//www.google.com/jsapi"></script>
<script>
google.load('visualization', '1', {packages: ['imagechart']});
</script>
FYI - I got this by clicking the Edit HTML button on the example page
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With