Sha256: b422e35aae3ef14e86ef0f1e62b3c2ce9cf7265fcb52e1ccba1420e4f9c36fb3

Contents?: true

Size: 897 Bytes

Versions: 15

Compression:

Stored size: 897 Bytes

Contents

var API_KEY = "<%= Preference.getCached(_sid, 'google_api_browser_key') %>";
var CLIENT_ID = "<%= Preference.getCached(_sid, 'google_api_client_id') %>";
var TABLE_ID = "<%= Preference.getCached(_sid, 'google_analytics_profile_id') %>";

gadash.configKeys({
  'apiKey': API_KEY,
  'clientId': CLIENT_ID
});

var chart = new gadash.Chart({
    'type': 'LineChart',
    'divContainer': 'chart_container',
    'last-n-days':30,
    'query': {
      'ids': TABLE_ID,
      'metrics': 'ga:pageViews',
      'dimensions': 'ga:date'
    },
    'chartOptions': {
      height: 400,
      hAxis: {title:'Date'},
      curveType: 'function'
    }
});

$(document).ready(function() {
  chart.render();
});

function update_chart_options() {
  chart.set({
    'last-n-days' : $('#days').val(),
    'query' : { 
      'metrics' : 'ga:' + $('#metric').val()
    },
    'chartOptions' : {
    }
  }).render();
}

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
kit_cms-2.3.22 app/views/admin/analytics/_charts.js.erb
kit_cms-2.3.20 app/views/admin/analytics/_charts.js.erb
kit_cms-2.3.19 app/views/admin/analytics/_charts.js.erb
kit_cms-2.3.18 app/views/admin/analytics/_charts.js.erb
kit_cms-2.3.17 app/views/admin/analytics/_charts.js.erb
kit_cms-2.3.16 app/views/admin/analytics/_charts.js.erb
kit_cms-2.3.15 app/views/admin/analytics/_charts.js.erb
kit_cms-2.3.14 app/views/admin/analytics/_charts.js.erb
kit_cms-2.3.13 app/views/admin/analytics/_charts.js.erb
kit_cms-2.3.11 app/views/admin/analytics/_charts.js.erb
kit_cms-2.3.10 app/views/admin/analytics/_charts.js.erb
kit_cms-2.3.9 app/views/admin/analytics/_charts.js.erb
kit_cms-2.3.8 app/views/admin/analytics/_charts.js.erb
kit_cms-2.3.7 app/views/admin/analytics/_charts.js.erb
kit_cms-2.3.6 app/views/admin/analytics/_charts.js.erb