比较Google Analytics API中的日期范围 [英] Comparing Date Ranges in Google Analytics API
问题描述
我目前正在使用JqPlot处理来自Google Analytics(分析)的实时数据仪表板 我可以按小时返回当前的每日流量,但是我还想做的是创建一个包含今天的流量和上周的同一天数据的图表.
I'm currently working on a live dashboard of data from Google Analytics using JqPlot I can return the current days traffic by hour which is great, but what I also want to do is to create a graph that has today's traffic and the same day last week's data.
基本上,我想在比较GA中的日期范围时返回与我相同的数据.
Basically I want to return the same data as I can when I compare date ranges in GA.
任何人都可以帮忙吗?
谢谢 阿迪
推荐答案
我已经解决了这个问题
var line1 = [[00,4],[01,3],[02,3],[03,1],[04,1],[05,1],[06,8],[ 07,11],[08,41],[09,54],[10,71],[11,72],[12,0],[13,0],[14,0],[15, 0],[16,0],[17,0],[18,0],[19,0],[20,0],[21,0],[22,0],[23,0] ];
var line1 = [[00,4],[01,3],[02,3],[03,1],[04,1],[05,1],[06,8],[07,11],[08,41],[09,54],[10,71],[11,72],[12,0],[13,0],[14,0],[15,0],[16,0],[17,0],[18,0],[19,0],[20,0],[21,0],[22,0],[23,0]];
var line2 = [[00,7],[01,3],[02,3],[03,1],[04,0],[05,3],[06,11],[ 07,21],[08,40],[09,54],[10,69],[11,91],[12,76],[13,45],[14,63],[15, 52],[16,38],[17,33],[18,26],[19,28],[20,26],[21,31],[22,9],[23,9] ];
var line2 = [[00,7],[01,3],[02,3],[03,1],[04,0],[05,3],[06,11],[07,21],[08,40],[09,54],[10,69],[11,91],[12,76],[13,45],[14,63],[15,52],[16,38],[17,33],[18,26],[19,28],[20,26],[21,31],[22,9],[23,9]];
var plot1 = $.jqplot('chartdiv', [line1, line2],
{
axes: {xaxis: {pad: 0},
yaxis: {pad: 0, max: 100}
}
}
);
谢谢
这篇关于比较Google Analytics API中的日期范围的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!