我的 webApp 图表中有自动生成的来自 Google 分析的数据,但它对所有设备都没有响应
JavaScript 代码:
var dataChart1 = new gapi.analytics.googleCharts.DataChart({
query: {
'ids': 'ga:789456123', // <-- Replace with the ids value for your view.
'start-date': '30daysAgo',
'end-date': 'yesterday',
'metrics': 'ga:pageviews',
'filters': 'ga:pagePath==<?php echo $page; ?>',
'dimensions': 'ga:date'
},
chart: {
'container': 'chart-1-container',
'type': 'LINE',
'options': {
'width': '40%'
}
}
});
dataChart1.execute();
在 HTML div 标签中生成:
<div id="chart-1-container" style="width:100%l height:100%;"></div>