Hey all,

I´m new with google visualization and I´m trying to get some results
but isn´t work for me.
What´s wrong with this code?

On index.html I have this code:
<script type="text/javascript" src="lib/control_main.js"></script>
<script type="text/javascript" src="http://www.google.com/jsapi";></
script>
<script type="text/javascript">
        google.load('visualization', '1', {'packages':['table']});
        google.setOnLoadCallback();
</script>
<a href="javascript:appBDAY();"><button id="bBirthday" >Birthday</
button></a>

On lib/control_main.js:

function appBDAY() {

        var query = new google.visualization.Query("db/search.php");
        query.send(handleQueryResponse);

        var data = response.getDataTable();
        var table = new google.visualization.Table(document.getElementById
('results'));
        table.draw(data, {showRowNumber: true});
}

function handleQueryResponse(response){

        if (response.isError()) {
                alert('Error in query: ' + response.getMessage() + ' ' +
response.getDetailedMessage());
                return response;
        }

}

and on db/search.php I  have:

echo "google.visualization.Query.setResponse
({version:'0.6',reqId:'0',status:'ok',sig:'5982206968295329967',table:
{cols:[{id:'Col1',label:'',type:'number'},
{id:'Col2',label:'',type:'number'},
{id:'Col3',label:'',type:'number'}],rows:[{c:[{v:1.0,f:'1'},{v:
2.0,f:'2'},{v:3.0,f:'3'}]},{c:[{v:2.0,f:'2'},{v:3.0,f:'3'},{v:
4.0,f:'4'}]},{c:[{v:3.0,f:'3'},{v:4.0,f:'4'},{v:5.0,f:'5'}]},{c:[{v:
1.0,f:'1'},{v:2.0,f:'2'},{v:3.0,f:'3'}]}]}});";

I got this example on Google Documentation API.
But it´s not work with me.
I don´t know what´s wrong in this code.
Please, anyone could help me?

Thanks,

Guilherme.

--

You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-visualization-api?hl=en.


Reply via email to