[英]dc.js Bubble Chart, plotting bubbles along the x-axis timeline
I am building a bubble chart in dc.js but am having problems with plotting along the X-axis. 我正在dc.js中构建气泡图,但在沿X轴绘图时遇到问题。
The link to the graphs is: http://junklogic.com/dcjs/creatures/creatures.html 图形的链接是: http : //junklogic.com/dcjs/creatures/creatures.html
The design of this chart is as follows, using a dataset of "Mythical Creature Sightings" for fun. 该图表的设计如下,使用“神话生物目击事件”数据集进行娱乐。
Each line of JSON is like this: JSON的每一行都是这样的:
{
"creature_name": "Dragon",
"seenby": "Ann",
"date": "2014-01-25T22:10:58",
"danger": 3,
"location": "FL"
},
Each bubble is grouped based on the date and time of the creature sightings. 每个气泡根据发现生物的日期和时间进行分组。
All the bubbles are pinned at pixel 0 and dont plot across. 所有气泡都固定在像素0处,并且不会划过。 I would like these to reflect their point across the timeline.
我希望这些能够反映他们在整个时间表中的观点。 Ideally, I'd like to group them into, say, 1-hour groups.
理想情况下,我想将它们分为1小时的小组。 But just getting them to plot will make a big difference in my progression of learning these libraries.
但是,仅让他们绘图将对我学习这些库的过程产生很大的影响。
The script is at: http://junklogic.com/dcjs/creatures/js/creatures.js 该脚本位于: http : //junklogic.com/dcjs/creatures/js/creatures.js
The JSON file is at: http://junklogic.com/dcjs/creatures/data/dashdata.json JSON文件位于: http : //junklogic.com/dcjs/creatures/data/dashdata.json
Thanks in advance for any help. 在此先感谢您的帮助。 If I need to provide any other info to help solve this question, I'm happy to provide what I can
如果我需要提供任何其他信息来帮助解决此问题,我很乐意提供
Well, I found it. 好吧,我找到了。
p.datetime += v.date;
and 和
p.datetime -= v.date;
should just be: 应该只是:
p.datetime = v.date;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.