function renderTopBrowsersChart(ids) {

    query({
      'ids': ids,
      'dimensions': 'ga:browser',
      'end-date': 'today',
      'metrics': 'ga:pageviews',
      'sort': '-ga:pageviews',
      'max-results': 5
    })
      .then(function (response) {


        console.log(response.totalResults);
        var data = [];
        var colors = ['#4D5360', '#949FB1', '#D4CCC5', '#E2EAE9', '#F7464A'];

        if(response.totalResults>0){
          response.rows.forEach(function (row, i) {
            data.push({ value: +row[1], color: colors[i], label: row[0] });
          });

          new Chart(makeCanvas('chart-3-container')).Doughnut(data);
          generateLegend('legend-3-container', data);
        }
        else{
          $('#chartbyview').hide();
        }

      });
  }
/**
   * Draw the a chart.js doughnut chart with data from the specified view that
   * show the top 5 browsers over the past seven days.
   */
Draw the a chart.js doughnut chart with data from the specified view that
show the top 5 browsers over the past seven days.
Draw the a chart . js doughnut chart with data from the specified view that show the top 5 browsers over the past seven days .
function renderTopBrowsersChart(ids) {
    query({
      'ids': ids,
      'dimensions': 'ga:browser',
      'end-date': 'today',
      'metrics': 'ga:pageviews',
      'sort': '-ga:pageviews',
      'max-results': 5
    })
      .then(function (response) {
        console.log(response.totalResults);
        var data = [];
        var colors = ['#4D5360', '#949FB1', '#D4CCC5', '#E2EAE9', '#F7464A'];
        if(response.totalResults>0){
          response.rows.forEach(function (row, i) {
            data.push({ value: +row[1], color: colors[i], label: row[0] });
          });
          new Chart(makeCanvas('chart-3-container')).Doughnut(data);
          generateLegend('legend-3-container', data);
        }
        else{
          $('#chartbyview').hide();
        }
      });
  }
function renderTopBrowsersChart ( ids ) { query ( { 'ids' : ids , 'dimensions' : 'ga:browser' , 'end-date' : 'today' , 'metrics' : 'ga:pageviews' , 'sort' : '-ga:pageviews' , 'max-results' : 5 } ) . then ( function ( response ) { console . log ( response . totalResults ) ; var data = [ ] ; var colors = [ '#4D5360' , '#949FB1' , '#D4CCC5' , '#E2EAE9' , '#F7464A' ] ; if ( response . totalResults > 0 ) { response . rows . forEach ( function ( row , i ) { data . push ( { value : + row [ 1 ] , color : colors [ i ] , label : row [ 0 ] } ) ; } ) ; new Chart ( makeCanvas ( 'chart-3-container' ) ) . Doughnut ( data ) ; generateLegend ( 'legend-3-container' , data ) ; } else { $ ( '#chartbyview' ) . hide ( ) ; } } ) ; }
Draw the a chart.js doughnut chart with data from the specified view that
 show the top 5 browsers over the past seven days.
Draw the a chart . js doughnut chart with data from the specified view that show the top 5 browsers over the past seven days .