X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;ds=inline;f=gallery%2Ftwo-axes.js;h=fae6c899886852a5b15840a57c189a3b0c041c61;hb=80be397c6428c0015c21f4a4ac96e222eb51f67e;hp=93247dfa0192054056fa702ed273cc90b8e0861d;hpb=795b16307db2a673ba7aa3452f6f6b0e93baeb3a;p=dygraphs.git diff --git a/gallery/two-axes.js b/gallery/two-axes.js index 93247df..fae6c89 100644 --- a/gallery/two-axes.js +++ b/gallery/two-axes.js @@ -1,16 +1,23 @@ +/*global Gallery,Dygraph,data */ Gallery.register( 'two-axes', { name: "Multiple y-axes", setup: function(parent) { - parent.innerHTML = + parent.innerHTML = "
The same data with both one and two y-axes. Two y-axes:
" + "" + "A single y-axis:
" + "" + - ""; + ""; }, run: function() { + var g, g2; + document.getElementById('check').onchange = function(el) { + g.updateOptions( { fillGraph: el.checked } ); + g2.updateOptions( { fillGraph: el.checked } ); + }; + var data = []; for (var i = 1; i <= 100; i++) { var m = "01", d = i; @@ -57,13 +64,8 @@ Gallery.register( labels: [ 'Date', 'Y1', 'Y2', 'Y3', 'Y4' ], labelsKMB: true, ylabel: 'Primary y-axis', - y2label: 'Secondary y-axis', + y2label: 'Secondary y-axis' } ); - - window.update = function(el) { - g.updateOptions( { fillGraph: el.checked } ); - g2.updateOptions( { fillGraph: el.checked } ); - } } });