1 /*global Gallery,Dygraph,data */
6 name
: 'Stock Chart Demo',
7 title
: 'Stock Chart Demo',
8 setup
: function(parent
) {
10 "<div id='stock_div' style='width: 600px; height: 300px;'></div><br/>",
11 "<div style='width: 600px; text-align: center;'>",
12 " <button id='linear'>Linear Scale</button> ",
13 " <button id='log' disabled='true'>Log Scale</button>",
17 var g
= new Dygraph(document
.getElementById("stock_div"), stockData
,
23 var linear
= document
.getElementById("linear");
24 var log
= document
.getElementById("log");
25 var setLog
= function(val
) {
26 g
.updateOptions({ logscale
: val
});
27 linear
.disabled
= !val
;
30 linear
.onclick
= function() { setLog(false); };
31 log
.onclick
= function() { setLog(true); };