using google visualization

R

rakata.warrior

Hello. I have a problem with google visualization (http://
code.google.com/intl/ru-RU/apis/visualization/documentation/
using_overview.html). Examples give by google are working fine, but if
I move google.load from scripts body to any function, loaders stops
work. I mean, this code

function load(){
google.load('visualization', '1', {'packages':
['piechart']});
google.setOnLoadCallback(drawChart);
}

doesn't work while this one

<html>
<head>
<script type="text/javascript" src="http://www.google.com/jsapi"></
script>
<script type="text/javascript">
google.load('visualization', '1', {'packages':['piechart']});
google.setOnLoadCallback(drawChart);

does pretty good. But I have a website with many frames and I need to
make various graphs on every frame so the idea was to make a function
in a javascript library file which would draw needed graphs. But I
can't do it because I have no idea what's going on with google.load -
why doesn't it work when calling inside of a function?
Any help would be greatly appreciated.
 
T

Thomas 'PointedEars' Lahn

(e-mail address removed) wrote:
^^^^^^^^^^^^^^^^^^^^^^^^
Who?
Hello. I have a problem with google visualization (http://
code.google.com/intl/ru-RU/apis/visualization/documentation/
using_overview.html).

You are looking for
Examples give by google are working fine,

That is a useless statement. *Which* examples, *where* are they running
fine?
but if I move google.load from scripts body to any function, loaders stops
work. I mean, this code

function load(){
google.load('visualization', '1', {'packages':
['piechart']});
google.setOnLoadCallback(drawChart);
}

doesn't work

That is no error description at all.
while this one

<html>

Not Valid. said:
<head>
<script type="text/javascript" src="http://www.google.com/jsapi"></
script>
<script type="text/javascript">
google.load('visualization', '1', {'packages':['piechart']});
google.setOnLoadCallback(drawChart);

does pretty good. But I have a website with many frames

That is no useful description either.
and I need to make various graphs on every frame so the idea was to make a
function in a javascript library file

There is no "javascript". There is also no "library file" there.
which would draw needed graphs. But I can't do it because I have no idea
what's going on with google.load -

That is the price tag attached to minified, apparently underdocumented,
needlessly dynamically loaded, code. BTW, I have tried
<http://code.google.com/apis/visualization/documentation/examples.html>;
it took 10 seconds before I could scroll the document in Iceweasel 3.6.4
without hassle. The average visitor would have navigated away by then.
This should give you pause.
why doesn't it work when calling inside of a function?

Probably it does, but given overall Google code quality it might not.
Any help would be greatly appreciated.

<http://jibbering.com/faq/#posting>
<http://www.catb.org/~esr/faqs/smart-questions.html>


PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top