How would I make this Google Analytic Embed API chart responsive? I noticed 
that the demo on this page is reponsive: 
https://ga-dev-tools.appspot.com/embed-api/basic-dashboard/

I have also seen various ways of doing this with Google Charts here 
https://code.google.com/p/google-visualization-api-issues/issues/detail?id=1056

<!doctype html><html lang="en"><head><title>Google Charts</title>


    <script>
    (function(w,d,s,g,js,fs){
        
g=w.gapi||(w.gapi={});g.analytics={q:[],ready:function(f){this.q.push(f);}};
        js=d.createElement(s);fs=d.getElementsByTagName(s)[0];
        js.src='https://apis.google.com/js/platform.js';
        
fs.parentNode.insertBefore(js,fs);js.onload=function(){g.load('analytics');};
    }(window,document,'script'));
    </script>

    <script>

    gapi.analytics.ready(function() {
    var ACCESS_TOKEN = 'XXX'; // obtained from your service account

    gapi.analytics.auth.authorize({
        serverAuth: {
        access_token: ACCESS_TOKEN
        }
    });

    var linechart = new gapi.analytics.googleCharts.DataChart({
    query: {
    ids: 'ga:XXXXXX',
    metrics: 'ga:users',
    dimensions: 'ga:date',
    'start-date': '30daysAgo',
    'end-date': 'yesterday'
      },
    chart: {
    type: 'LINE',
    container: 'line-chart',
    options: {
        width: '100%',
        title: 'Test.com: Visitors over the past 30 days.',
        fontSize: 12
        }
    }
    });

    linechart.on('success', function(response) {
    // response.chart : the Google Chart instance.
    // response.data : the Google Chart data object.
    });

    linechart.execute();        

    });

    </script>
</head>
<body>
                <div>
                    <div id="embed-api-auth-container"></div>
                    <div id="line-chart" style='width:100%;height:300px;'></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