example12_millisecondscale.html 2.7 KB

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