[visualization-api] Display chart via function

2014-09-10 Thread isaachorrocks
This is probably so simple it's an insult to your intelligence, but what's wrong with this code. I want the chart to display when clicking the button - it just hangs. If I take away the definition of the dspChart function the chart draws fine. html head !--Load the AJAX API-- script

Re: [visualization-api] Display chart via function

2014-09-10 Thread 'Jon Orwant' via Google Visualization API
Why not move the google.load call above dspChart(), remove dspChart(), and use onclick=drawChart(); ? Jon On Wed, Sep 10, 2014 at 10:21 AM, isaachorro...@gmail.com wrote: This is probably so simple it's an insult to your intelligence, but what's wrong with this code. I want the chart to

Re: [visualization-api] Display chart via function

2014-09-10 Thread Isaac Horrocks
Agreed that works. Many thanks. Do you know why the google.load doesn't work within the function. Is it to do with scope in Javascript? On 10 September 2014 16:22, 'Jon Orwant' via Google Visualization API google-visualization-api@googlegroups.com wrote: Why not move the google.load call above

Re: [visualization-api] Display chart via function

2014-09-10 Thread Andrew Gallant
The reason it doesn't work has to do with some quirky behavior of the google loader. If you had used an inline callback, it would have worked, eg; function dspChart() { google.load('visualization', '1', {'packages':['corechart'], callback: drawChart}); } But I don't recommend calling