2.0.0 release fixes (#815)
[dygraphs.git] / tests / small-range-zero.html
CommitLineData
54425b14 1<!DOCTYPE html>
d053ab5a
DV
2<html>
3 <head>
fd6b8dad 4 <link rel="stylesheet" href="../dist/dygraph.css">
d053ab5a 5 <title>no range</title>
fbd6834a 6 <script type="text/javascript" src="../dist/dygraph.js"></script>
7e5ddc94 7
d053ab5a
DV
8 </head>
9 <body>
10 <p>There should be an appropriate amount of padding at the top of the chart:</p>
11 <div id="blah"></div>
12
13 <script type="text/javascript">
14 function CSV() {
15 var label = "X";
16
17 return "date," + label + "\n20091206,2659329.631743\n20091213,2772361.123362\n20091220,2737584.647191\n20091227,2720000.550414\n20100103,2910306.897977\n20100110,2901385.313093\n20100117,2903041.312099\n20100124,2966455.128911\n";
18 }
19
f6fbf9e0 20 var g1 = new Dygraph(document.getElementById("blah"),
d053ab5a
DV
21 CSV,
22 {
23 width: 640,
24 height: 480,
25 includeZero: true
26 });
27
28 </script>
85abed30
DV
29
30 <p>The second series (which is entirely zero) should be visible, and the
31 y-axis should go down to zero.</p>
32 <div id="blah2"></div>
33 <script type="text/javascript">
34 var data=[
35 ["2006-10-11",0,15228],
36 ["2006-10-12",0,15219],
37 ["2006-10-13",0,15225],
38 ["2006-10-14",0,15212],
39 ["2006-10-15",0,15211],
40 ["2006-10-16",0,15322],
41 ["2006-10-17",0,15414],
42 ["2006-10-18",0,15422],
43 ["2006-10-19",0,15434],
44 ["2006-10-20",0,15423]
45 ];
46 var str = "";
47 for (var i = 0; i < data.length; i++) {
48 str += data[i].join(",") + "\n";
49 }
50
f6fbf9e0 51 var g2 = new Dygraph(document.getElementById("blah2"),
85abed30
DV
52 str,
53 { labels: [ "date", "zero", "non-zero" ] });
54 </script>
d053ab5a
DV
55 </body>
56</html>