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.

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