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