|
| 1 | +<html> |
| 2 | +<head> |
| 3 | + <title>Timeline demo</title> |
| 4 | + |
| 5 | + <style type="text/css"> |
| 6 | + body {font: 10pt arial;} |
| 7 | + </style> |
| 8 | + |
| 9 | + <script type="text/javascript" src="http://www.google.com/jsapi"></script> |
| 10 | + <script type="text/javascript" src="../timeline.js"></script> |
| 11 | + <link rel="stylesheet" type="text/css" href="../timeline.css"> |
| 12 | + |
| 13 | + <script type="text/javascript"> |
| 14 | + var timeline; |
| 15 | + |
| 16 | + google.load("visualization", "1"); |
| 17 | + |
| 18 | + // Set callback to run when API is loaded |
| 19 | + google.setOnLoadCallback(drawVisualization); |
| 20 | + |
| 21 | + // Called when the Visualization API is loaded. |
| 22 | + function drawVisualization() { |
| 23 | + // Create and populate a data table. |
| 24 | + var data = new google.visualization.DataTable(); |
| 25 | + data.addColumn('datetime', 'start'); |
| 26 | + data.addColumn('datetime', 'end'); |
| 27 | + data.addColumn('string', 'content'); |
| 28 | + data.addColumn('string', 'type'); |
| 29 | + |
| 30 | + data.addRows([ |
| 31 | + [new Date(2010,7,23), , 'Conversation<br>' + |
| 32 | + '<img src="img/comments-icon.png" style="width:32px; height:32px;">', 'box'], |
| 33 | + [new Date(2010,7,23,23,0,0), , 'Mail from boss<br>' + |
| 34 | + '<img src="img/mail-icon.png" style="width:32px; height:32px;">', 'box'], |
| 35 | + [new Date(2010,7,26), new Date(2010,8,2), 'Traject A (default range)', 'range'], |
| 36 | + [ , new Date(2010,7,26), 'Traject B ( floatingRange no start date )', 'floatingRange'], |
| 37 | + [new Date(2010,7,31), , 'Traject C ( floatingRange no end date )', 'floatingRange'], |
| 38 | + [ , , 'Traject D ( floatingRange no start date and no end date )', 'floatingRange'] |
| 39 | + ]); |
| 40 | + |
| 41 | + // specify options |
| 42 | + var options = { |
| 43 | + "width": "100%", |
| 44 | + "height": "300px", |
| 45 | + 'editable': true, // enable dragging and editing events |
| 46 | + }; |
| 47 | + |
| 48 | + // Instantiate our timeline object. |
| 49 | + timeline = new links.Timeline(document.getElementById('mytimeline')); |
| 50 | + |
| 51 | + // Draw our timeline with the created data and options |
| 52 | + timeline.draw(data, options); |
| 53 | + } |
| 54 | + </script> |
| 55 | +</head> |
| 56 | + |
| 57 | +<body> |
| 58 | +<h1>Timeline floatingRange demo</h1> |
| 59 | +<p> |
| 60 | + This demo shows how to use floatingRange items. |
| 61 | + The start and end dates are optional in this type of range. |
| 62 | +</p> |
| 63 | + |
| 64 | +<div id="mytimeline"></div> |
| 65 | + |
| 66 | +<!-- Information about where the used icons come from --> |
| 67 | +<p style="color:gray; font-size:10px; font-style:italic;"> |
| 68 | + Icons by <a href="http://dryicons.com" target="_blank" title="Aesthetica 2 Icons by DryIcons" style="color:gray;" >DryIcons</a> |
| 69 | + and <a href="http://www.tpdkdesign.net" target="_blank" title="Refresh Cl Icons by TpdkDesign.net" style="color:gray;" >TpdkDesign.net</a> |
| 70 | +</p> |
| 71 | + |
| 72 | +</body> |
| 73 | +</html> |
0 commit comments