Skip to content

Commit c46b3a8

Browse files
committed
Merge pull request almende#283 from NickHardy/patch-2
Added some information about floatingRange
2 parents 3d4c21e + 3f2ef22 commit c46b3a8

File tree

2 files changed

+76
-2
lines changed

2 files changed

+76
-2
lines changed

js/src/timeline/doc/index.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,14 +289,15 @@ <h3>Fields</h3>
289289
<tr>
290290
<td>start</td>
291291
<td>Date</td>
292-
<td>yes</td>
292+
<td>yes*</td>
293293
<td>
294294
The start date of the event, for example <code>new Date(2010,2,23)</code>.
295295
<br>
296296
<blockquote style="color: red; font-style: italic;">
297297
Remark: Months in the JavaScript Date object are zero-based,<br>
298298
so <code>new Date(2010,2,23)</code> represents 23th of March, 2010.
299299
</blockquote>
300+
* If the type is set to floatingRange, the start is optional.
300301
</td>
301302
</tr>
302303
<tr>
@@ -364,7 +365,7 @@ <h3>Fields</h3>
364365
<td>type</td>
365366
<td>String</td>
366367
<td>no</td>
367-
<td>Type of the event, optional. Available values: "box", "range", "dot".
368+
<td>Type of the event, optional. Available values: "box", "range", "dot", "floatingRange".
368369
By default, the type is "range" for events having a start and end
369370
date, and "box" for events with a start date. This default can be
370371
overwritten by the global option "style".
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
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

Comments
 (0)