是否可以每小时堆叠数据?我只有两列:来自触发器的时间和信号" trig = 1"。所以我需要每小时堆叠所有触发信号。所以在Y轴上应该是每小时所有触发信号的数量和。您可以使用此示例JSFiddle。 数据如下所示:
$(".OffersContainer > div:gt(0)").hide();
$(".OffersContainer > span").click(function() {
$(this).siblings($(this).hasClass('click') ? "div:gt(0)" : "div:lt(3)").slideDown();
$(this).addClass('click');
});
我的JS:
[{"time":"15:15:00","trig":"1"},{"time":"15:45:00","trig":"1"},
{"time":"16:10:18","trig":"1"},{"time":"16:20:00","trig":"1"},
{"time":"17:30:00","trig":"1"},{"time":"17:50:00","trig":"1"},
{"time":"18:25:00","trig":"1"},{"time":"18:45:00","trig":"1"},
{"time":"19:05:00","trig":"1"},{"time":"19:40:00","trig":"1"},
{"time":"21:15:00","trig":"1"},{"time":"21:50:00","trig":"1"}]