example01_basis.html 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <html>
  2. <head>
  3. <title>Timeline demo</title>
  4. <style>
  5. body {font: 10pt arial;}
  6. </style>
  7. <script type="text/javascript" src="http://www.google.com/jsapi"></script>
  8. <script type="text/javascript" src="../timeline.js"></script>
  9. <link rel="stylesheet" type="text/css" href="../timeline.css">
  10. <script type="text/javascript">
  11. var timeline;
  12. google.load("visualization", "1");
  13. // Set callback to run when API is loaded
  14. google.setOnLoadCallback(drawVisualization);
  15. // Called when the Visualization API is loaded.
  16. function drawVisualization() {
  17. // Create and populate a data table.
  18. var data = new google.visualization.DataTable();
  19. data.addColumn('datetime', 'start');
  20. data.addColumn('datetime', 'end');
  21. data.addColumn('string', 'content');
  22. data.addRows([
  23. [new Date(2010,7,23), , 'Conversation<br>' +
  24. '<img src="img/comments-icon.png" style="width:32px; height:32px;">'],
  25. [new Date(2010,7,23,23,0,0), , 'Mail from boss<br>' +
  26. '<img src="img/mail-icon.png" style="width:32px; height:32px;">'],
  27. [new Date(2010,7,24,16,0,0), , 'Report'],
  28. [new Date(2010,7,26), new Date(2010,8,2), 'Traject A'],
  29. [new Date(2010,7,28), , 'Memo<br>' +
  30. '<img src="img/notes-edit-icon.png" style="width:48px; height:48px;">'],
  31. [new Date(2010,7,29), , 'Phone call<br>' +
  32. '<img src="img/Hardware-Mobile-Phone-icon.png" style="width:32px; height:32px;">'],
  33. [new Date(2010,7,31), new Date(2010,8,3), 'Traject B'],
  34. [new Date(2010,8,4,12,0,0), , 'Report<br>' +
  35. '<img src="img/attachment-icon.png" style="width:32px; height:32px;">']
  36. ]);
  37. // specify options
  38. var options = {
  39. "width": "100%",
  40. "height": "300px",
  41. "style": "box"
  42. };
  43. // Instantiate our timeline object.
  44. timeline = new links.Timeline(document.getElementById('mytimeline'));
  45. // Draw our timeline with the created data and options
  46. timeline.draw(data, options);
  47. }
  48. </script>
  49. </head>
  50. <body>
  51. <div id="mytimeline"></div>
  52. <!-- Information about where the used icons come from -->
  53. <p style="color:gray; font-size:10px; font-style:italic;">
  54. Icons by <a href="http://dryicons.com" target="_blank" title="Aesthetica 2 Icons by DryIcons" style="color:gray;" >DryIcons</a>
  55. and <a href="http://www.tpdkdesign.net" target="_blank" title="Refresh Cl Icons by TpdkDesign.net" style="color:gray;" >TpdkDesign.net</a>
  56. </p>
  57. </body>
  58. </html>