Chronoline.js
依賴其他庫 jQuery qTip2 Raphael
使用它的時候,大概需要這樣的配置
var timeline = new Chronoline($("#timeline")[0], events, {
animated: true,
defaultStartDate: new Date(1589, 0, 1),
draggable: true,
hashInterval: function(date) {
return date.getDate() === 1;
},
labelInterval: function(date) {
return date.getMonth() === 0 && date.getDate() === 1;
},
labelFormat: "%Y",
markToday: true,
scrollLeft: function(date) {
return new Date(date.getFullYear() - 1, date.getMonth(), date.getDate());
},
scrollRight: function(date) {
return new Date(date.getFullYear() + 1, date.getMonth(), date.getDate());
},
subLabel: null,
subSubLabel: null,
timelinePadding: DAY_IN_MILLISECONDS * 366 / 4,
tooltips: true,
visibleSpan: DAY_IN_MILLISECONDS * 366 * 5
});
配置項的這些參數(shù)描述了我們使用這個時間軸時,它的顯示外觀,包擴顯示的具體時間格式,刻度的顯示,刻度標(biāo)簽的格式,時間軸的時間跨度,滾動一次的時間跨度,可以說配置說明書要看的非常多了,可以試下修改配置項,你會驚呆的,簡直不要太強大。

image.png
叮叮叮...附上github源碼
學(xué)習(xí)可視化案例,認識可視化庫,小白不斷更新中