reference sentence rewrite
[dygraphs.git] / gallery / avoid-min-zero.js
1 Gallery.register(
2 'avoid-min-zero',
3 {
4 name: "Avoid Min Zero",
5 setup: function(parent) {
6 parent.innerHTML =
7 "<p>1: Line chart with axis at zero problem:</p><div id='graph1'></div> " +
8 "<p>2: Step chart with axis at zero problem:</p><div id='graphd2'></div> " +
9 "<p>3: Line chart with <code>avoidMinZero</code> option:</p><div id='graph3'></div> " +
10 "<p>4: Step chart with <code>avoidMinZero</code> option:</p><div id='graphd4'></div> ";
11 },
12 run: function() {
13 var g1 = new Dygraph(document.getElementById("graph1"),
14 "Date,Temperature\n" +
15 "2008-05-07,0\n" +
16 "2008-05-08,1\n" +
17 "2008-05-09,0\n" +
18 "2008-05-10,0\n" +
19 "2008-05-11,3\n" +
20 "2008-05-12,4\n"
21 )
22 var g2 = new Dygraph(document.getElementById("graphd2"),
23 "Date,Temperature\n" +
24 "2008-05-07,0\n" +
25 "2008-05-08,1\n" +
26 "2008-05-09,0\n" +
27 "2008-05-10,0\n" +
28 "2008-05-11,3\n" +
29 "2008-05-12,4\n",
30 {
31 stepPlot: true
32 }
33 )
34 var g3 = new Dygraph(document.getElementById("graph3"),
35 "Date,Temperature\n" +
36 "2008-05-07,0\n" +
37 "2008-05-08,1\n" +
38 "2008-05-09,0\n" +
39 "2008-05-10,0\n" +
40 "2008-05-11,3\n" +
41 "2008-05-12,4\n",
42 {
43 avoidMinZero: true
44 }
45 )
46 var g4 = new Dygraph(document.getElementById("graphd4"),
47 "Date,Temperature\n" +
48 "2008-05-07,0\n" +
49 "2008-05-08,1\n" +
50 "2008-05-09,0\n" +
51 "2008-05-10,0\n" +
52 "2008-05-11,3\n" +
53 "2008-05-12,4\n",
54 {
55 stepPlot: true,
56 avoidMinZero: true
57 }
58 )
59 }
60 });