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.

53 lines
1.6 KiB

  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <title>Timeline | Hiding times 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. <div id="debug"></div>
  16. <div id="debug2"></div>
  17. <script type="text/javascript">
  18. // DOM element where the Timeline will be attached
  19. var container = document.getElementById('visualization');
  20. // Create a DataSet (allows two way data-binding)
  21. var items = new vis.DataSet([
  22. {id: 1, content: 'item 1', start: '2014-04-19'},
  23. {id: 2, content: 'item 2', start: '2014-04-21'},
  24. {id: 3, content: 'item 3', start: '2014-04-18'},
  25. {id: 4, content: 'item 4', start: '2014-04-16', end: '2014-04-24'},
  26. {id: 5, content: 'item 5', start: '2014-04-26 12:00:00'},
  27. {id: 6, content: 'item 6', start: '2014-04-27', type: 'point'}
  28. ]);
  29. // Configuration for the Timeline
  30. var options = {
  31. hiddenDates: {
  32. specific:[
  33. {start: '2014-03-21 00:00:00', end: '2014-03-28 00:00:00'},
  34. {start: '2014-03-05 00:00:00', end: '2014-03-10 00:00:00'}
  35. ],
  36. periodic: {
  37. times: [{start:'20:00:00', end:'09:00:00'}],
  38. days: [{start: 6, end:1}] // 1 - 7 : Monday - Sunday
  39. }
  40. },
  41. start: '2014-04-17',
  42. end: '2014-05-01',
  43. height: '200px'
  44. };
  45. // Create a Timeline
  46. var timeline = new vis.Timeline(container, items, options);
  47. </script>
  48. </body>
  49. </html>