Hi Daniel,

Thank you for the reply.
I had tried setOnLoadCallback, but then nothing happens. As per the program
logic, it is the response of the ajax call that is to be passed to the
callback function. So inside a js function,

function test() {
   new Ajax.Request(
'index.php',
{queue: {position: 'end', scope: 'command'},
method: 'post',
postBody:url,
    onComplete: function(response){
                           google.setOnLoadCallback(function()
                 drawChart(arg1, arg2);
                    }
   }
}

But nothing happens. When setOnLoadCallback is not called, I reach inside
drawchart(), but with it, there is no result. Is it that the library is
taking time to load? The script cannot have a timeout period > 30 secs. Is
there any thing wrong with the code?

Best Regards,
Rashmy

On Fri, Jan 2, 2015 at 8:59 AM, 'Daniel LaLiberte' via Google Visualization
API <[email protected]> wrote:

> Hi Rashmy,
>
> Since you say you are not calling google.setOnloadCallback(), how do you
> guarantee that the code that is loaded by your google.load() call is done?
> That is the job of the setOnloadCallback.  I suggest you try that, and
> inside the function that gets called by that callback, then you can make
> your ajax call to get data and call drawChart.
>
> Hope that helps.
>
> On Thu, Jan 1, 2015 at 12:21 PM, <[email protected]> wrote:
>
>> Hi
>>
>> I want to embed the chart within a php page to which headers have already
>> been sent.
>> I have a template that calls a number of js files, to one of which I have
>> added the drawchart function.
>>
>> In the template file, I have the line of code,
>> <script type="text/javascript" src="http://www.google.com/jsapi
>> "></script>
>>
>> In another js file, I have
>> google.load("visualization", "1", {packages:["corechart"]});
>> and this js file has been called in the template file.
>>
>> I want the drawchart function to be called within another js function and
>> need to pass arguments to drawChart().
>>
>> Within a js function, I am making an ajax call, which onComplete, I need
>> to call drawChart with some arguments.
>>
>> I do not call, google.setOnloadCallback. OnComplete of the ajax request,
>> I am calling drawChart with the args,
>> but the chart is not getting drawn. It is giving the 'undefined is not a
>> function' error.
>>
>> Any suggestions on how to get the chart done?
>>
>> Thanks & Regards,
>> Rashmy
>>
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google Visualization API" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To post to this group, send email to
>> [email protected].
>> Visit this group at
>> http://groups.google.com/group/google-visualization-api.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2>
>  - 978-394-1058
> [email protected] <[email protected]>   5CC, Cambridge MA
> [email protected] <[email protected]> 9 Juniper Ridge
> Road, Acton MA
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Google Visualization API" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/google-visualization-api/7qwdvah5-8c/unsubscribe
> .
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To post to this group, send email to
> [email protected].
> Visit this group at
> http://groups.google.com/group/google-visualization-api.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.

Reply via email to