vis.js is a dynamic, browser-based visualization library
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.6 KiB

  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <title>Timeline | Basic demo</title>
  5. <style type="text/css">
  6. body, html {
  7. font-family: sans-serif;
  8. }
  9. </style>
  10. <script src="../../dist/vis.js"></script>
  11. <link href="../../dist/vis.css" rel="stylesheet" type="text/css"/>
  12. </head>
  13. <body>
  14. <div id="visualization"></div>
  15. <script type="text/javascript">
  16. // DOM element where the Timeline will be attached
  17. var container = document.getElementById('visualization');
  18. // Create a DataSet (allows two way data-binding)
  19. var items = new vis.DataSet([
  20. {id: 1, content: 'item 1', start: '2014-04-20'},
  21. {id: 2, content: 'item 2', start: '2014-04-14'},
  22. {id: 3, content: 'item 3', start: '2014-04-18'},
  23. {id: 4, content: 'item 4', start: '2014-04-16', end: '2014-04-19'},
  24. {id: 5, content: 'item 5', start: '2014-04-26 12:00:00'},
  25. {id: 6, content: 'item 6', start: '2014-04-27', type: 'point'}
  26. ]);
  27. // Configuration for the Timeline
  28. var options = {
  29. hide:{
  30. start: '2014-04-20 00:00:00',
  31. end: '2014-04-26 00:00:00'},
  32. // } [
  33. // {
  34. // start: '2014-04-20 00:00:00',
  35. // end: '2014-04-26 00:00:00'
  36. // },
  37. // {
  38. // start: '2014-05-20 00:00:00',
  39. // end: '2014-05-26 00:00:00'
  40. // }
  41. // ],
  42. start: '2014-04-01',
  43. end: '2014-05-10',
  44. height: '200px'
  45. };
  46. // Create a Timeline
  47. var timeline = new vis.Timeline(container, items, options);
  48. </script>
  49. </body>
  50. </html>