0
我想创建一个堆积条形图,但不是系列中常见的堆叠方式。d3带有不寻常数据的堆叠酒吧
确切的数据例如:
[
{"issue":19,"created_at":"2017-01-06T14:24:04.247Z","time":"00:30:00"},
{"issue":18,"created_at":"2017-01-06T14:24:04.247Z","time":"02:00:00"},
{"issue":18,"created_at":"2017-01-07T14:24:04.247Z","time":"00:10:00"},
{"issue":19,"created_at":"2017-01-07T14:24:04.247Z","time":"00:10:00"},
{"issue":17,"created_at":"2017-01-07T14:24:04.247Z","time":"02:00:00"},
{"issue":17,"created_at":"2017-01-07T14:24:04.247Z","time":"06:00:00"},
{"issue":17,"created_at":"2017-01-08T14:24:04.247Z","time":"06:00:00"},
{"issue":17,"created_at":"2017-01-09T14:24:04.247Z","time":"06:00:00"},
{"issue":17,"created_at":"2017-01-09T14:24:04.247Z","time":"00:30:00"},
{"issue":18,"created_at":"2017-01-10T14:24:04.247Z","time":"00:10:00"},
{"issue":19,"created_at":"2017-01-10T14:24:04.247Z","time":"02:00:00"},
{"issue":17,"created_at":"2017-01-10T14:24:04.247Z","time":"06:00:00"},
{"issue":19,"created_at":"2017-01-10T14:24:04.247Z","time":"02:00:00"},
{"issue":19,"created_at":"2017-01-11T14:24:04.247Z","time":"00:10:00"}
]
我现在要创建一个堆叠条形图过去七天,其中值(时间字段)堆叠的每一天,并通过ID(问题)着色。
的问题是所有实施例中,我发现正在做一系列堆叠
我具有不同量每天值之一:0 < = #values(天)
有人可以告诉我一个简短的例子(http://jsfiddle.net/qbmy76on/3/)使用d3(这个值也可以是一个简单的整数值,如下面的例子)获得一个堆栈的酒吧
与Charts.js我意识到一个原型(与分钟),但我想切换到d3为未来的功能。
http://i.imgur.com/LdtsusH.png
只是提示:使用':',而不是'=',使这个有效的对象,并包装对象到一个数组。 –
是的,只是一些示例数据,这不是问题..我只是不知道如何在d3中实现这种优雅的情况。 –
这是我现在在我的js文件中的数据结构:http://i.imgur.com/tljd89p.png –