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.

64 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. convert: {
  21. start: 'Date',
  22. end: 'Date'
  23. }
  24. });
  25. items.add([
  26. {id: 1, content: 'item 1<br>start', start: '2014-01-23'},
  27. {id: 2, content: 'item 2', start: '2014-01-18'},
  28. {id: 3, content: 'item 3', start: '2014-01-21'},
  29. {id: 4, content: 'item 4', start: '2014-01-19', end: '2014-01-24'},
  30. {id: 5, content: 'item 5', start: '2014-01-28', type:'point'},
  31. {id: 6, content: 'item 6', start: '2014-01-26'}
  32. ]);
  33. var container = document.getElementById('visualization');
  34. var options = {
  35. start: '2014-01-10',
  36. end: '2014-02-10',
  37. orientation: 'top',
  38. height: '300px',
  39. editable: true,
  40. /* alternatively, enable/disable individual actions:
  41. editable: {
  42. add: true,
  43. updateTime: true,
  44. updateGroup: true,
  45. remove: true
  46. },
  47. */
  48. showCurrentTime: true
  49. };
  50. var timeline = new vis.Timeline(container, items, options);
  51. </script>
  52. </body>
  53. </html>