4 name
: 'Stock Chart Demo',
5 title
: 'Stock Chart Demo',
6 setup
: function(parent
) {
7 parent
.innerHTML
= "<div id='stock_div' style='width: 800px; height: 400px;'></div><br/>" +
8 "<div style='width: 800px; text-align: center;'>" +
9 "<button id='linear'>Linear Scale</button> " +
10 "<button id='log' disabled='true'>Log Scale</button>" +
14 var g
= new Dygraph(document
.getElementById("stock_div"), stockData
,
20 var linear
= document
.getElementById("linear");
21 var log
= document
.getElementById("log");
22 linear
.onclick
= function() { setLog(false); }
23 log
.onclick
= function() { setLog(true); }
24 var setLog
= function(val
) {
25 g
.updateOptions({ logscale
: val
});
26 linear
.disabled
= !val
;