example06_format_custom_css.html 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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>
  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', 'startdate');
  81. data.addColumn('datetime', 'enddate');
  82. data.addColumn('string', 'content');
  83. data.addRows([
  84. [new Date(2010,07,23), , '<div>Conversation</div><img src="img/community-users-icon.png" style="width:32px; height:32px;">'],
  85. [new Date(2010,07,23,23,00,00), , '<div>Mail from boss</div><img src="img/mail-icon.png" style="width:32px; height:32px;">'],
  86. [new Date(2010,07,24,16,00,00), , 'Report'],
  87. [new Date(2010,07,26), new Date(2010,08,02), 'Traject A'],
  88. [new Date(2010,07,28), , '<div>Memo</div><img src="img/notes-edit-icon.png" style="width:48px; height:48px;">'],
  89. [new Date(2010,07,29), , '<div>Phone call</div><img src="img/Hardware-Mobile-Phone-icon.png" style="width:32px; height:32px;">'],
  90. [new Date(2010,07,31), new Date(2010,08,03), 'Traject B'],
  91. [new Date(2010,08,04,12,00,00), , '<div>Report</div><img src="img/attachment-icon.png" style="width:32px; height:32px;">']
  92. ]);
  93. // specify options
  94. options = {
  95. width: "100%",
  96. height: "400px",
  97. editable: true, // make the events dragable
  98. enableKeys: true,
  99. eventMargin: 15,
  100. showButtonAdd: false,
  101. style: "box"
  102. };
  103. // Instantiate our timeline object.
  104. timeline = new links.Timeline(document.getElementById('mytimeline'));
  105. // Draw our timeline with the created data and options
  106. timeline.draw(data, options);
  107. }
  108. </script>
  109. </head>
  110. <body>
  111. <p>This page demonstrates the timeline visualization with custom css.</p>
  112. <div id="mytimeline"></div>
  113. <!-- Information about where the used icons come from -->
  114. <p style="color:gray; font-size:10px; font-style:italic;">
  115. Icons by <a href="http://dryicons.com" target="_blank" title="Aesthetica 2 Icons by DryIcons" style="color:gray;" >DryIcons</a>
  116. and <a href="http://www.tpdkdesign.net" target="_blank" title="Refresh Cl Icons by TpdkDesign.net" style="color:gray;" >TpdkDesign.net</a>
  117. </p>
  118. </body>
  119. </html>