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