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.4 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. </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>