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.

73 lines
2.8 KiB

  1. <html>
  2. <head>
  3. <title>Timeline demo</title>
  4. <style type="text/css">
  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.addColumn('string', 'type');
  23. data.addRows([
  24. [new Date(2010,7,23), , 'Conversation<br>' +
  25. '<img src="img/comments-icon.png" style="width:32px; height:32px;">', 'box'],
  26. [new Date(2010,7,23,23,0,0), , 'Mail from boss<br>' +
  27. '<img src="img/mail-icon.png" style="width:32px; height:32px;">', 'box'],
  28. [new Date(2010,7,26), new Date(2010,8,2), 'Traject A (default range)', 'range'],
  29. [ , new Date(2010,7,26), 'Traject B ( floatingRange no start date )', 'floatingRange'],
  30. [new Date(2010,7,31), , 'Traject C ( floatingRange no end date )', 'floatingRange'],
  31. [ , , 'Traject D ( floatingRange no start date and no end date )', 'floatingRange']
  32. ]);
  33. // specify options
  34. var options = {
  35. "width": "100%",
  36. "height": "300px",
  37. 'editable': true, // enable dragging and editing events
  38. };
  39. // Instantiate our timeline object.
  40. timeline = new links.Timeline(document.getElementById('mytimeline'), options);
  41. // Draw our timeline with the created data and options
  42. timeline.draw(data);
  43. }
  44. </script>
  45. </head>
  46. <body>
  47. <h1>Timeline floatingRange demo</h1>
  48. <p>
  49. This demo shows how to use floatingRange items.
  50. The start and end dates are optional in this type of range.
  51. </p>
  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>