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.

51 lines
1.9 KiB

  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <title>Timeline | Background areas</title>
  5. <style>
  6. body, html {
  7. font-family: arial, sans-serif;
  8. font-size: 11pt;
  9. }
  10. .vis-item.vis-background.negative {
  11. background-color: rgba(255, 0, 0, 0.2);
  12. }
  13. .vis-item.vis-background.marker {
  14. border-left: 2px solid green;
  15. }
  16. </style>
  17. <script src="../../dist/vis.js"></script>
  18. <link href="../../dist/vis.css" rel="stylesheet" type="text/css" />
  19. <script>(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script','//www.google-analytics.com/analytics.js','ga');ga('create', 'UA-61231638-1', 'auto');ga('send', 'pageview');</script></head>
  20. <body>
  21. <p>This example demonstrates the item type "background", see "Period A" and "Period B". The background areas can be styled with css.</p>
  22. <div id="visualization"></div>
  23. <script>
  24. var items = new vis.DataSet([
  25. {id: 'A', content: 'Period A', start: '2014-01-16', end: '2014-01-22', type: 'background'},
  26. {id: 'B', content: 'Period B', start: '2014-01-25', end: '2014-01-30', type: 'background', className: 'negative'},
  27. {id: 1, content: 'item 1<br>start', start: '2014-01-23'},
  28. {id: 2, content: 'item 2', start: '2014-01-18'},
  29. {id: 3, content: 'item 3', start: '2014-01-21'},
  30. {id: 4, content: 'item 4', start: '2014-01-19', end: '2014-01-24'},
  31. {id: 5, content: 'item 5', start: '2014-01-28', type:'point'},
  32. {id: 6, content: 'item 6', start: '2014-01-26'}
  33. ]);
  34. var container = document.getElementById('visualization');
  35. var options = {
  36. start: '2014-01-10',
  37. end: '2014-02-10',
  38. editable: true
  39. };
  40. var timeline = new vis.Timeline(container, items, options);
  41. </script>
  42. </body>
  43. </html>