Oh jeeze, I must be missing something here. 

I've made a couple of simple charts and dashboards and I'm trying to put 
them on a Google Site. But when I put in my HTML, nothing shows up and 
there's an error that says "failed to load external url jsapi" within the 
HMTL box properties. It highlights "https://www.google.com/jsapi";.

The only article that talks about adding a chart to the site says to do it 
through a spreadsheet. EH? 
https://support.google.com/sites/answer/1680639?hl=en

Very confused. Can anyone help?

My code for one of the dashboard components is here: 

<html>
<head>
<script type="text/javascript" src="https://www.google.com/jsapi";></script>
<script type="text/javascript">
function drawVisualization () {
    var query = new 
google.visualization.Query('https://docs.google.com/a/google.com/spreadsheets/d/1HLEVLFjr9eMQE2fSANiHDHc-qqSf4hjuDwlonQncdiQ/edit#gid=0',
 
'A:D');
    
    query.send(function (response) {        
        if (response.isError()) {
            alert('Error in query: ' + response.getMessage() + ' ' + 
response.getDetailedMessage());
            return;
        }
        var data = response.getDataTable();
        
        // create a Category control
        var filter = new google.visualization.ControlWrapper({
            controlType: 'CategoryFilter',
            containerId: 'control_div',
            options: {
                filterColumnIndex: 2
            }
        });
        
        // create a Table visualization
        var table = new google.visualization.ChartWrapper({
            chartType: 'ColumnChart',
            containerId: 'table_div',
            options: {'height': '13em', 'width': '20em', 
            hAxis: {title: 'Ldap', titleTextStyle: {color: 'red'}}, 
            vAxis: {format: '#'}},
          view: {columns:[0,1]}
          });
        
        // Create the dashboard.
        var dashboard = new 
google.visualization.Dashboard(document.getElementById('dashboard')).
        // Configure the string filter to affect the table contents
        bind([filter], [table]).
        // Draw the dashboard
        draw(data);
    });
}

google.load('visualization', '1', {'packages':['controls']});
google.setOnLoadCallback(drawVisualization);
</script>
</head>

<body>
<div id="dashboard">
    <div id="control_div"></div>    
    <div id="table_div"></div>    
</div>
</body>
</html>

-- 
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