3
votes

I am working with Google Analytics Embed API. Basic line chart is created (rendered in days). However I would like to switch display of the chart into week display. Like you do in GA this way: enter image description here Here is my piece of code:

var longTermVisits = new gapi.analytics.googleCharts.DataChart({
  query: {
    ids: 'ga:XXXXXXXX',
    metrics: 'ga:sessions',
    dimensions: 'ga:date',
    'start-date': '30daysAgo',
    'end-date': 'yesterday'
  },
  chart: {
    container: 'long-term-visits',
    type: 'LINE',
    options: {
      width: '100%',
      height: '200px'
    }
  }
});
1

1 Answers

0
votes

Change your dimensions from ga:date to ga:week