Draw simple timeline with D3

不问归期 提交于 2019-11-28 21:03:46

问题


This is what I'm trying to accomplish:

In this example, I have a starting date (1º Jun 2011), an ending date (1º Jul 2012) and multiple events between this range.

Each event is related to one day of the calendar (although it is possible to have many events on a single day).

This data is fetched from a MySQL DB.

Any help or suggestion will be highly appreciated.


回答1:


I recently had to do something similar. I ended up writing a d3 plugin that could handle this case among a few others. https://github.com/jiahuang/d3-timeline

I'm pretty new to D3 as well, but I hope it's useful.




回答2:


You should be able to accomplish this with a time scale and an axis

Scott Murray has a really good set of tutorials that culminates in one for axes

Just think of your time line as a 1-dimensional scatterplot with a time scale.




回答3:


I am going to develop similar visualization and found on Github timeknots component based on d3.js.



来源:https://stackoverflow.com/questions/13201749/draw-simple-timeline-with-d3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!