我从服务器获取一些谷歌分析数据并将其作为 JSON 传递给谷歌图表。我无法弄清楚如何让图表呈现为带有线条的日期轴。我现在看起来像这样http://screencast.com/t/VdPNzW6JDlPQ我需要它看起来像这样http://screencast.com/t/yCzUdurhB。
这是代码
var Simple_data = new google.visualization.DataTable(Simple_setData(), 0.5);
visualization = new google.visualization.LineChart(document.getElementById('report_Simple'));
visualization.draw(Simple_data, Simple_options);
var Simple_options = { "title": "Test" };
function Simple_setData() {
var Simple_JsonTable = { cols: [{id: 'ga:date', label: 'date', type: 'string'}, {id: 'ga:visits', label: 'visits', type: 'number'}, {id: 'ga:newVisits', label: 'new visits', type: 'number'}], rows: [{c:[{v: '10/14/2013'}, {v: 333}, {v: 266}]}, {c:[{v: '10/18/2013'}, {v: 161}, {v: 109}]}, {c:[{v: '10/24/2013'}, {v: 224}, {v: 163}]}]};
return Simple_JsonTable;
}
提前致谢