Commit | Line | Data |
---|---|---|
e88a95b4 DV |
1 | /*global Gallery,Dygraph,data */ |
2 | /*global data_temp */ | |
fec16662 RK |
3 | Gallery.register( |
4 | // Get a better name. | |
5 | 'temperature-sf-ny', | |
6 | { | |
7 | name: 'Roll Periods and Error Bars', | |
8 | title: 'Demo of a graph with many data points and custom error bars.', | |
9 | setup: function(parent) { | |
605b6119 | 10 | parent.innerHTML = [ |
93a5bb4c | 11 | "<style>.dygraph-legend { text-align: right; }</style>", |
605b6119 | 12 | "<p>Roll period of 14 timesteps.</p>", |
10eef8e9 | 13 | "<div id='roll14' style='width:600px; height:300px;'></div>", |
605b6119 | 14 | "<p>No roll period.</p>", |
10eef8e9 | 15 | "<div id='noroll' style='width:600px; height:300px;'></div>"] |
605b6119 | 16 | .join("\n"); |
fec16662 RK |
17 | }, |
18 | run: function() { | |
e88a95b4 | 19 | new Dygraph( |
fec16662 RK |
20 | document.getElementById("noroll"), |
21 | data_temp, | |
22 | { | |
23 | customBars: true, | |
24 | title: 'Daily Temperatures in New York vs. San Francisco', | |
25 | ylabel: 'Temperature (F)', | |
26 | legend: 'always', | |
fec16662 RK |
27 | } |
28 | ); | |
e88a95b4 | 29 | new Dygraph( |
fec16662 RK |
30 | document.getElementById("roll14"), |
31 | data_temp, | |
32 | { | |
33 | rollPeriod: 14, | |
34 | showRoller: true, | |
35 | customBars: true, | |
36 | title: 'Daily Temperatures in New York vs. San Francisco', | |
37 | ylabel: 'Temperature (F)', | |
38 | legend: 'always', | |
fec16662 RK |
39 | } |
40 | ); | |
41 | } | |
e88a95b4 | 42 | }); |