Gallery failure when CSS does not exist.
[dygraphs.git] / gallery / annotation-native.js
CommitLineData
c1f22b5a
RK
1Gallery.register(
2 'annotations-native',
3 {
4 name: 'Annotations with Native format',
5 setup: function(parent) {
6 parent.innerHTML =
7 "<p>This test demonstrates how annotations can be used with " +
8 "<a href='http://dygraphs.com/data.html#array'>native-format</a> data.</p>" +
9 "<div id='demodiv'></div>";
10 },
11 run: function() {
12 g = new Dygraph(
13 document.getElementById("demodiv"),
14 [
15 [ new Date("2011/11/01"), 100 ],
16 [ new Date("2011/11/02"), 200 ],
17 [ new Date("2011/11/03"), 300 ],
18 [ new Date("2011/11/04"), 100 ],
19 [ new Date("2011/11/05"), 200 ],
20 [ new Date("2011/11/06"), 300 ],
21 [ new Date("2011/11/07"), 200 ],
22 [ new Date("2011/11/08"), 100 ]
23 ],
24 {
25 labels: [ 'Date', 'Value' ]
26 }
27 );
28
29 g.setAnnotations([{
30 series: 'Value',
31 x: Date.parse('2011/11/04'),
32 shortText: 'M',
33 text: 'Marker'
34 }]);
35 }
36});