X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;ds=sidebyside;f=gallery%2Frange-selector.js;h=e243b43b206a382296f76dca3477f6ef4e0b6aa3;hb=64f1c4dfd7425931fcd1bd9949157c0ba6958656;hp=4d9a82ad897c5ff244b59ee41ef4ada9837b2884;hpb=72c8bf9993215da78476fa918af09e12b297a34c;p=dygraphs.git
diff --git a/gallery/range-selector.js b/gallery/range-selector.js
index 4d9a82a..e243b43 100644
--- a/gallery/range-selector.js
+++ b/gallery/range-selector.js
@@ -1,17 +1,30 @@
+/*global Gallery,Dygraph,data */
+/*global data_temp */
Gallery.register(
'range-selector',
{
name: 'Range Selector',
title: 'Demo of the Range Selector',
setup: function(parent) {
- parent.innerHTML =
- "
No roll period.
" +
- "" +
- "Roll period of 14 timesteps, custom range selector height and plot color.
" +
- "";
+ parent.innerHTML = [
+ "",
+ "No roll period.
",
+ "",
+ "",
+ "Roll period of 14 timesteps, custom range selector height and plot color.
",
+ "",
+ "",
+ "",
+ "
Dark background, custom range selector gradient color.
",
+ "
",
+ "
"].join("\n");
},
run: function() {
- g1 = new Dygraph(
+ new Dygraph(
document.getElementById("noroll"),
data_temp,
{
@@ -19,11 +32,10 @@ Gallery.register(
title: 'Daily Temperatures in New York vs. San Francisco',
ylabel: 'Temperature (F)',
legend: 'always',
- labelsDivStyles: { 'textAlign': 'right' },
showRangeSelector: true
}
);
- g2 = new Dygraph(
+ new Dygraph(
document.getElementById("roll14"),
data_temp,
{
@@ -33,11 +45,28 @@ Gallery.register(
title: 'Daily Temperatures in New York vs. San Francisco',
ylabel: 'Temperature (F)',
legend: 'always',
- labelsDivStyles: { 'textAlign': 'right' },
showRangeSelector: true,
rangeSelectorHeight: 30,
rangeSelectorPlotStrokeColor: 'yellow',
rangeSelectorPlotFillColor: 'lightyellow'
- });
+ }
+ );
+ new Dygraph(
+ document.getElementById("darkbg"),
+ data_temp,
+ {
+ rollPeriod: 14,
+ showRoller: true,
+ customBars: true,
+ title: 'Nightly Temperatures in New York vs. San Francisco',
+ ylabel: 'Temperature (F)',
+ legend: 'always',
+ showRangeSelector: true,
+ rangeSelectorPlotFillColor: 'MediumSlateBlue',
+ rangeSelectorPlotFillGradientColor: 'rgba(123, 104, 238, 0)',
+ colorValue: 0.9,
+ fillAlpha: 0.4
+ }
+ );
}
});