// Specify the DOM element where the Timeline will be displayed
var container = document.getElementById("visualization");
// Establish a DataSet to facilitate data-binding
var items = new vis.DataSet([
{ id: 1, content: "item 1", start: "2021-12-20" },
{ id: 2, content: "item 2", start: "2021-12-14" },
{ id: 3, content: "item 3", start: "2021-12-18" },
{ id: 4, content: "item 4", start: "2021-12-16", end: "2021-12-19" },
{ id: 5, content: "item 5", start: "2021-12-25" },
{ id: 6, content: "item 6", start: "2021-12-27", type: "point" },
]);
// Define configuration settings for the Timeline
var options = {
margin : {
item: {horizontal:0, vertical:0},
axis: 5
}
};
// Create the Timeline
var timeline = new vis.Timeline(container, items, options);
body,
html {
font-family: sans-serif;
}
.vis-box {
height: 20px;
}
.vis-range {
height: 20px;
}
.vis-item {
font-size: 12px;
}
<script src="https://visjs.github.io/vis-timeline/standalone/umd/vis-timeline-graph2d.min.js"></script>
<link href="https://visjs.github.io/vis-timeline/styles/vis-timeline-graph2d.min.css" rel="stylesheet"/>
<div id="visualization"></div>