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.

52 lines
1.7 KiB

  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <title>Timeline | Grid styling</title>
  5. <script src="../../dist/vis.js"></script>
  6. <link href="../../dist/vis.css" rel="stylesheet" type="text/css" />
  7. <style type="text/css">
  8. body, html {
  9. font-family: sans-serif;
  10. }
  11. /* alternating column backgrounds */
  12. .vis.timeline .timeaxis .grid.odd {
  13. background: #f5f5f5;
  14. }
  15. /* gray background in weekends, white text color */
  16. .vis.timeline .timeaxis .grid.saturday,
  17. .vis.timeline .timeaxis .grid.sunday {
  18. background: gray;
  19. }
  20. .vis.timeline .timeaxis .text.saturday,
  21. .vis.timeline .timeaxis .text.sunday {
  22. color: white;
  23. }
  24. </style>
  25. <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>
  26. <body>
  27. <div id="visualization"></div>
  28. <script type="text/javascript">
  29. // DOM element where the Timeline will be attached
  30. var container = document.getElementById('visualization');
  31. // Create a DataSet (allows two way data-binding)
  32. var items = new vis.DataSet([
  33. {id: 1, content: 'custom', start: '2015-01-01'},
  34. {id: 2, content: 'styling', start: '2016-01-01'},
  35. {id: 3, content: 'of', start: '2017-01-01'},
  36. {id: 4, content: 'background', start: '2018-01-01'},
  37. {id: 5, content: 'grid', start: '2019-01-01'}
  38. ]);
  39. // Configuration for the Timeline
  40. var options = {};
  41. // Create a Timeline
  42. var timeline = new vis.Timeline(container, items, options);
  43. </script>
  44. </body>
  45. </html>