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.

58 lines
1.3 KiB

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