Fix drawing.js bug
[dygraphs.git] / gallery / range-selector.js
CommitLineData
72c8bf99
RK
1Gallery.register(
2 'range-selector',
3 {
4 name: 'Range Selector',
5 title: 'Demo of the Range Selector',
6 setup: function(parent) {
7 parent.innerHTML =
8 "<p>No roll period.</p>" +
9 "<div id='noroll' style='width:800px; height:320px;'></div>" +
10 "<p>Roll period of 14 timesteps, custom range selector height and plot color.</p>" +
11 "<div id='roll14' style='width:800px; height:320px;'></div>";
12 },
13 run: function() {
14 g1 = new Dygraph(
15 document.getElementById("noroll"),
16 data_temp,
17 {
18 customBars: true,
19 title: 'Daily Temperatures in New York vs. San Francisco',
20 ylabel: 'Temperature (F)',
21 legend: 'always',
22 labelsDivStyles: { 'textAlign': 'right' },
23 showRangeSelector: true
24 }
25 );
26 g2 = new Dygraph(
27 document.getElementById("roll14"),
28 data_temp,
29 {
30 rollPeriod: 14,
31 showRoller: true,
32 customBars: true,
33 title: 'Daily Temperatures in New York vs. San Francisco',
34 ylabel: 'Temperature (F)',
35 legend: 'always',
36 labelsDivStyles: { 'textAlign': 'right' },
37 showRangeSelector: true,
38 rangeSelectorHeight: 30,
39 rangeSelectorPlotStrokeColor: 'yellow',
40 rangeSelectorPlotFillColor: 'lightyellow'
41 });
42 }
43 });