1
我很难得到水平网格线显示在我的谷歌图表。谷歌图表水平网格线与日期时间格式
这是我的hAxis设置。我怀疑它与日期时间格式有关,所以我写了一个格式化程序。
hAxis: {
title: 'DateTime (UTC)',
slantedText: true,
gridlines: {
count: 30
}
}
var formatter = new google.visualization.DateFormat({pattern: 'yyyy-MM-dd HH:mm:ss'});
formatter.format(data, 0);
Anytbody知道我在做什么错?
网站: http://redditsnaps.com/r/dataisbeautiful/top-posts-chart
为我工作,但还需要一段时间 – juvian 2014-09-28 17:05:31
你的意思是垂直网格线?你没有看到这些,因为你的日期实际上不是Date对象 - 它们是字符串。垂直网格线仅在连续轴上受支持,并且字符串会创建离散轴。您应该将日期字符串转换为Date对象以获取要显示的网格线。 – asgallant 2014-09-30 23:54:16