Skip to content

Instantly share code, notes, and snippets.

@jpero
Created August 7, 2019 15:45
Show Gist options
  • Save jpero/845833fb70a30774b39c94ea6198cb10 to your computer and use it in GitHub Desktop.
Save jpero/845833fb70a30774b39c94ea6198cb10 to your computer and use it in GitHub Desktop.
timeline
<!DOCTYPE HTML>
<html>
<head>
<title>Timeline | Basic demo</title>
<style type="text/css">
body, html {
font-family: sans-serif;
}
</style>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vis/4.21.0/vis.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/vis/4.21.0/vis-timeline-graph2d.min.css" rel="stylesheet" type="text/css" />
</head>
<body>
<p>
A basic timeline. You can move and zoom the timeline, and select items.
</p>
<div id="visualization"></div>
<script type="text/javascript">
// DOM element where the Timeline will be attached
var container = document.getElementById('visualization');
// Create a DataSet (allows two way data-binding)
var items = new vis.DataSet(
[{"id":3119547,"start":"2019-07-15T07:00","end":"2019-07-15T07:00","content":"0"},{"id":3124453,"start":"2019-07-15T21:53","end":"2019-07-15T21:53","content":"2"},{"id":3152097,"start":"2019-07-15T10:05","end":"2019-07-15T10:35","content":"3"},{"id":3152098,"start":"2019-07-15T11:30","end":"2019-07-15T11:31","content":"3"},{"id":3152099,"start":"2019-07-15T11:45","end":"2019-07-15T11:45","content":"3"},{"id":3157672,"start":"2019-07-15T11:45","end":"2019-07-15T11:45","content":"3"},{"id":3157673,"start":"2019-07-15T11:55","end":"2019-07-15T12:07","content":"3"},{"id":3157674,"start":"2019-07-15T12:29","end":"2019-07-15T12:33","content":"3"},{"id":3157675,"start":"2019-07-15T13:35","end":"2019-07-15T13:35","content":"3"},{"id":3157700,"start":"2019-07-15T15:20","end":"2019-07-15T15:20","content":"3"},{"id":3157701,"start":"2019-07-15T15:35","end":"2019-07-15T15:50","content":"3"},{"id":3157702,"start":"2019-07-15T17:36","end":"2019-07-15T19:01","content":"3"},{"id":3157703,"start":"2019-07-15T20:48","end":"2019-07-15T20:48","content":"3"}]
);
// Configuration for the Timeline
var options = {};
// Create a Timeline
var timeline = new vis.Timeline(container, items, options);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment