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.

99 lines
2.8 KiB

  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <title>Timeline | Custom 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 {
  9. font-family: purisa, 'comic sans', cursive;
  10. }
  11. .vis-timeline {
  12. border: 2px solid purple;
  13. font-family: purisa, 'comic sans', cursive;
  14. font-size: 12pt;
  15. background: #ffecea;
  16. }
  17. .vis-item {
  18. border-color: #F991A3;
  19. background-color: pink;
  20. font-size: 15pt;
  21. color: purple;
  22. box-shadow: 5px 5px 20px rgba(128,128,128, 0.5);
  23. }
  24. .vis-item,
  25. .vis-item.vis-line {
  26. border-width: 3px;
  27. }
  28. .vis-item.vis-dot {
  29. border-width: 10px;
  30. border-radius: 10px;
  31. }
  32. .vis-item.vis-selected {
  33. border-color: green;
  34. background-color: lightgreen;
  35. }
  36. .vis-time-axis .vis-text {
  37. color: purple;
  38. padding-top: 10px;
  39. padding-left: 10px;
  40. }
  41. .vis-time-axis .vis-text.vis-major {
  42. font-weight: bold;
  43. }
  44. .vis-time-axis .vis-grid.vis-minor {
  45. border-width: 2px;
  46. border-color: pink;
  47. }
  48. .vis-time-axis .vis-grid.vis-major {
  49. border-width: 2px;
  50. border-color: #F991A3;
  51. }
  52. </style>
  53. <script src="../../googleAnalytics.js"></script>
  54. </head>
  55. <body>
  56. <p>
  57. The style of the Timeline can be fully customized via CSS:
  58. </p>
  59. <div id="visualization"></div>
  60. <script type="text/javascript">
  61. var container = document.getElementById('visualization');
  62. // note that months are zero-based in the JavaScript Date object
  63. var items = new vis.DataSet([
  64. {start: new Date(2010,7,23), content: '<div>Conversation</div><img src="../resources/img/community-users-icon.png" style="width:32px; height:32px;">'},
  65. {start: new Date(2010,7,23,23,0,0), content: '<div>Mail from boss</div><img src="../resources/img/mail-icon.png" style="width:32px; height:32px;">'},
  66. {start: new Date(2010,7,24,16,0,0), content: 'Report'},
  67. {start: new Date(2010,7,26), end: new Date(2010,8,2), content: 'Traject A'},
  68. {start: new Date(2010,7,28), content: '<div>Memo</div><img src="../resources/img/notes-edit-icon.png" style="width:48px; height:48px;">'},
  69. {start: new Date(2010,7,29), content: '<div>Phone call</div><img src="../resources/img/Hardware-Mobile-Phone-icon.png" style="width:32px; height:32px;">'},
  70. {start: new Date(2010,7,31), end: new Date(2010,8,3), content: 'Traject B'},
  71. {start: new Date(2010,8,4,12,0,0), content: '<div>Report</div><img src="../resources/img/attachment-icon.png" style="width:32px; height:32px;">'}
  72. ]);
  73. var options = {
  74. editable: true,
  75. margin: {
  76. item: 20,
  77. axis: 40
  78. }
  79. };
  80. var timeline = new vis.Timeline(container, items, options);
  81. </script>
  82. </body>
  83. </html>