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.

61 lines
1.4 KiB

11 years ago
11 years ago
11 years ago
  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <title>Timeline | Interactive example</title>
  5. <style>
  6. body, html {
  7. font-family: arial, sans-serif;
  8. font-size: 11pt;
  9. }
  10. </style>
  11. <script src="../../dist/vis.js"></script>
  12. <link href="../../dist/vis.css" rel="stylesheet" type="text/css" />
  13. </head>
  14. <body>
  15. <p>Drag items around, create new items, and remove items.</p>
  16. <div id="visualization"></div>
  17. <script>
  18. // create a dataset with items
  19. var items = new vis.DataSet({
  20. type: { start: 'ISODate', end: 'ISODate' }
  21. });
  22. items.add([
  23. {id: 1, content: 'item 1<br>start', start: '2014-01-23'},
  24. {id: 2, content: 'item 2', start: '2014-01-18'},
  25. {id: 3, content: 'item 3', start: '2014-01-21'},
  26. {id: 4, content: 'item 4', start: '2014-01-19', end: '2014-01-24'},
  27. {id: 5, content: 'item 5', start: '2014-01-28', type:'point'},
  28. {id: 6, content: 'item 6', start: '2014-01-26'}
  29. ]);
  30. var container = document.getElementById('visualization');
  31. var options = {
  32. start: '2014-01-10',
  33. end: '2014-02-10',
  34. orientation: 'top',
  35. height: '300px',
  36. editable: true,
  37. /* alternatively, enable/disable individual actions:
  38. editable: {
  39. add: true,
  40. updateTime: true,
  41. updateGroup: true,
  42. remove: true
  43. },
  44. */
  45. showCurrentTime: true
  46. };
  47. var timeline = new vis.Timeline(container, items, options);
  48. </script>
  49. </body>
  50. </html>