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.

142 lines
4.7 KiB

  1. <html >
  2. <head>
  3. <title>Timeline demo</title>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  5. <script type="text/javascript" src="http://www.google.com/jsapi"></script>
  6. <script type="text/javascript" src="../timeline.js"></script>
  7. <link rel="stylesheet" type="text/css" href="../timeline.css">
  8. <style type="text/css">
  9. body {font: 10pt arial;}
  10. div.timeline-frame {
  11. border-color: #103E9C;
  12. }
  13. div.timeline-axis {
  14. border-color: #103E9C;
  15. background-color: #EEEFF1;
  16. filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#F9F9F9', endColorstr='#EEEFF1'); /* for IE */
  17. background: -webkit-gradient(linear, left top, left bottom, from(#F9F9F9), to(#EEEFF1)); /* for webkit browsers */
  18. background: -moz-linear-gradient(top, #F9F9F9, #EEEFF1); /* for firefox 3.6+ */
  19. }
  20. div.timeline-axis-text {
  21. font: bold 12px arial ;
  22. color: #103E9C;
  23. }
  24. div.timeline-event {
  25. border: none;
  26. background-color: white;
  27. }
  28. div.timeline-event-selected {
  29. background-color: #C0D8E1;
  30. }
  31. div.timeline-event-content {
  32. margin: 0;
  33. }
  34. div.timeline-groups-axis {
  35. border-color: #103E9C;
  36. }
  37. div.timeline-groups-text {
  38. font: bold 12px arial ;
  39. color: #103E9C;
  40. }
  41. div.order {
  42. border: 1px solid #FB3738;
  43. border-radius: 2px;
  44. -moz-border-radius: 2px;
  45. font: bold 12px arial ;
  46. color: #103E9C;
  47. padding: 2px;
  48. margin:1px;
  49. overflow: hidden;
  50. }
  51. </style>
  52. <script type="text/javascript">
  53. var timeline = null;
  54. google.load("visualization", "1");
  55. // Set callback to run when API is loaded
  56. google.setOnLoadCallback(drawVisualization);
  57. // Called when the Visualization API is loaded.
  58. function drawVisualization() {
  59. // Create and populate a data table.
  60. var data = new google.visualization.DataTable();
  61. data.addColumn('datetime', 'start');
  62. data.addColumn('datetime', 'end');
  63. data.addColumn('string', 'content');
  64. data.addColumn('string', 'group');
  65. var order = 1;
  66. for (var truck = 11; truck < 15; truck++) {
  67. var date = new Date(2010, 12, 14, 8, 0, 0);
  68. for (var i = 0; i < 10; i++) {
  69. date.setHours(date.getHours() + 4 * (Math.random() < 0.2));
  70. var start = new Date(date);
  71. date.setHours(date.getHours() + 2 + Math.floor(Math.random()*4));
  72. var end = new Date(date);
  73. var orderText = "Order " + order;
  74. if (Math.random() < 0.25) {
  75. orderText = "<img src='img/product-icon.png' style='width:32px; height:32px; vertical-align: middle'> " + orderText;
  76. }
  77. orderText = "<div title='Order " + order + "' class='order'>" + orderText + "</div>";
  78. var truckText = "<img src='img/truck-icon.png' style='width:24px; height:24px; vertical-align: middle'>" +
  79. "Truck " + truck;
  80. data.addRow([start, end, orderText, truckText]);
  81. order++;
  82. }
  83. }
  84. // specify options
  85. var options = {
  86. width: "100%",
  87. height: "auto",
  88. layout: "box",
  89. editable: false,
  90. selectable: false,
  91. eventMargin: 10, // minimal margin between events
  92. eventMarginAxis: 20, // minimal margin beteen events and the axis
  93. showMajorLabels: false,
  94. axisOnTop: true,
  95. groupsChangeable : false,
  96. groupsOnRight: false
  97. };
  98. // Instantiate our timeline object.
  99. timeline = new links.Timeline(document.getElementById('mytimeline'), options);
  100. // Draw our timeline with the created data and options
  101. timeline.draw(data);
  102. }
  103. </script>
  104. </head>
  105. <body>
  106. <h1>Stacking with grouping example</h1>
  107. <div id="mytimeline"></div>
  108. <!-- Information about where the used icons come from -->
  109. <p style="color:gray; font-size:10px; font-style:italic;">
  110. Icons by <a href="http://dryicons.com" target="_blank" title="Aesthetica 2 Icons by DryIcons" style="color:gray;" >DryIcons</a>
  111. and <a href="http://www.tpdkdesign.net" target="_blank" title="Refresh Cl Icons by TpdkDesign.net" style="color:gray;" >TpdkDesign.net</a>
  112. </p>
  113. </body>
  114. </html>