有没有办法让 Google 的注释时间线图表将不在其数据表中的日期归零?
https://developers.google.com/chart/interactive/docs/gallery/annotatedtimeline
我愿意
var data = new google.visualization.DataTable();
data.addColumn('date', 'Date');
data.addColumn('number', 'My Number');
data.addRows([
[new Date(2008, 1 ,1), 1,
[new Date(2008, 1 ,2), 2],
[new Date(2008, 1 ,4), 4],
[new Date(2008, 1 ,5), 5],
]);
与
相同 var data = new google.visualization.DataTable();
data.addColumn('date', 'Date');
data.addColumn('number', 'My Number');
data.addRows([
[new Date(2008, 1 ,1), 1,
[new Date(2008, 1 ,2), 2],
[new Date(2008, 1 ,3), 0],
[new Date(2008, 1 ,4), 4],
[new Date(2008, 1 ,5), 5],
]);
最佳答案
看起来现在没有办法做到这一点(除非你自己修改数据)——这个功能请求自 2009 年以来一直开放:http://code.google.com/p/google-visualization-api-issues/issues/detail?id=25
关于javascript - 使 Google Annotated Timeline 为缺失日期填充零,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11217810/