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.

138 lines
4.5 KiB

  1. <html>
  2. <head>
  3. <title>Timeline demo</title>
  4. <script type="text/javascript" src="http://www.google.com/jsapi"></script>
  5. <script type="text/javascript" src="../timeline.js"></script>
  6. <link rel="stylesheet" type="text/css" href="../timeline.css">
  7. <style type="text/css">
  8. body {font: 10pt arial;}
  9. div.timeline-frame {
  10. border-color: purple;
  11. border-width: 2px;
  12. }
  13. div.timeline-canvas {
  14. background-color: #FFF4F7;
  15. }
  16. div.timeline-event {
  17. border-color: #F991A3;
  18. background-color: pink;
  19. }
  20. div.timeline-event-selected {
  21. border-color: orange;
  22. background-color: yellow;
  23. }
  24. div.timeline-event-box {
  25. font-size: 12pt;
  26. font-family: purisa, cursive;
  27. color: purple;
  28. border-width: 3px;
  29. }
  30. div.timeline-event-line {
  31. border-width: 3px;
  32. }
  33. div.timeline-event-dot {
  34. border-width: 8px;
  35. border-radius: 8px;
  36. -moz-border-radius: 8px;
  37. }
  38. div.timeline-event-range {
  39. font-size: 12pt;
  40. font-family: purisa, cursive;
  41. color: purple;
  42. border-width: 3px;
  43. }
  44. div.timeline-axis {
  45. border-color: purple;
  46. border-width: 2px;
  47. }
  48. div.timeline-axis-grid {
  49. border-width: 2px;
  50. }
  51. div.timeline-axis-grid-minor {
  52. border-color: #FFD7DD;
  53. }
  54. div.timeline-axis-grid-major {
  55. border-color: pink;
  56. }
  57. div.timeline-axis-text {
  58. font-family: purisa, cursive;
  59. font-size: 15px;
  60. color: purple;
  61. }
  62. div.timeline-axis-text-minor {
  63. padding-top: 15px;
  64. }
  65. div.timeline-axis-text-major {
  66. font-weight: bold;
  67. padding-top: 5px;
  68. padding-bottom: 10px;
  69. }
  70. </style>
  71. <script type="text/javascript">
  72. google.load("visualization", "1");
  73. // Set callback to run when API is loaded
  74. google.setOnLoadCallback(drawVisualization);
  75. var timeline;
  76. // Called when the Visualization API is loaded.
  77. function drawVisualization() {
  78. // Create and populate a data table.
  79. var data = new google.visualization.DataTable();
  80. data.addColumn('datetime', 'start');
  81. data.addColumn('datetime', 'end');
  82. data.addColumn('string', 'content');
  83. data.addRows([
  84. [new Date(2010,7,23), , '<div>Conversation</div><img src="img/community-users-icon.png" style="width:32px; height:32px;">'],
  85. [new Date(2010,7,23,23,0,0), , '<div>Mail from boss</div><img src="img/mail-icon.png" style="width:32px; height:32px;">'],
  86. [new Date(2010,7,24,16,0,0), , 'Report'],
  87. [new Date(2010,7,26), new Date(2010,8,2), 'Traject A'],
  88. [new Date(2010,7,28), , '<div>Memo</div><img src="img/notes-edit-icon.png" style="width:48px; height:48px;">'],
  89. [new Date(2010,7,29), , '<div>Phone call</div><img src="img/Hardware-Mobile-Phone-icon.png" style="width:32px; height:32px;">'],
  90. [new Date(2010,7,31), new Date(2010,8,3), 'Traject B'],
  91. [new Date(2010,8,4,12,00,00), , '<div>Report</div><img src="img/attachment-icon.png" style="width:32px; height:32px;">']
  92. ]);
  93. // specify options
  94. var options = {
  95. width: "100%",
  96. height: "400px",
  97. editable: true, // make the events draggable
  98. eventMargin: 15,
  99. showButtonNew: false,
  100. style: "box"
  101. };
  102. // Instantiate our timeline object.
  103. timeline = new links.Timeline(document.getElementById('mytimeline'), options);
  104. // Draw our timeline with the created data and options
  105. timeline.draw(data);
  106. }
  107. </script>
  108. </head>
  109. <body>
  110. <p>This page demonstrates the timeline visualization with custom css.</p>
  111. <div id="mytimeline"></div>
  112. <!-- Information about where the used icons come from -->
  113. <p style="color:gray; font-size:10px; font-style:italic;">
  114. Icons by <a href="http://dryicons.com" target="_blank" title="Aesthetica 2 Icons by DryIcons" style="color:gray;" >DryIcons</a>
  115. and <a href="http://www.tpdkdesign.net" target="_blank" title="Refresh Cl Icons by TpdkDesign.net" style="color:gray;" >TpdkDesign.net</a>
  116. </p>
  117. </body>
  118. </html>