X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=gallery%2Frange-selector.js;h=09bfd49c32b98280e5e3e6959655ff2d3bdce12c;hb=2a1f00d810b5c4f04b72bc6a393380b858f70909;hp=4d9a82ad897c5ff244b59ee41ef4ada9837b2884;hpb=e14dc3feda3e6d429bb953dab83c593d851d90af;p=dygraphs.git diff --git a/gallery/range-selector.js b/gallery/range-selector.js index 4d9a82a..09bfd49 100644 --- a/gallery/range-selector.js +++ b/gallery/range-selector.js @@ -1,17 +1,25 @@ +/*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, { @@ -23,7 +31,7 @@ Gallery.register( showRangeSelector: true } ); - g2 = new Dygraph( + new Dygraph( document.getElementById("roll14"), data_temp, { @@ -38,6 +46,26 @@ Gallery.register( 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', + labelsDivStyles: { 'textAlign': 'right', 'backgroundColor': '#101015' }, + showRangeSelector: true, + rangeSelectorPlotFillColor: 'MediumSlateBlue', + rangeSelectorPlotFillGradientColor: 'rgba(123, 104, 238, 0)', + axisLabelColor: 'white', + colorValue: 0.9, + fillAlpha: 0.4 + } + ); } });