X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;ds=sidebyside;f=gallery%2Fstock.js;h=ad7319e7c099c610d0619d06313af876a79f6370;hb=ef44ba44d235f6e6fbbc3ae481661380cb6514be;hp=0cee3fb26ed7cf8ddf86b42db7225068fff7ecb1;hpb=3c10a0f3519355ee651d04bf2972bd31298eff18;p=dygraphs.git
diff --git a/gallery/stock.js b/gallery/stock.js
index 0cee3fb..ad7319e 100644
--- a/gallery/stock.js
+++ b/gallery/stock.js
@@ -1,14 +1,17 @@
+/*global Gallery,Dygraph,data */
+/*global stockData */
Gallery.register(
'stock',
{
name: 'Stock Chart Demo',
title: 'Stock Chart Demo',
setup: function(parent) {
- parent.innerHTML = "
" +
- "" +
- " " +
- "" +
- "
";
+ parent.innerHTML = [
+ "
",
+ "",
+ " ",
+ " ",
+ "
"].join("\n");
},
run: function() {
var g = new Dygraph(document.getElementById("stock_div"), stockData,
@@ -16,15 +19,15 @@ Gallery.register(
customBars: true,
logscale: true
});
-
+
var linear = document.getElementById("linear");
var log = document.getElementById("log");
- linear.onclick = function() { setLog(false); }
- log.onclick = function() { setLog(true); }
var setLog = function(val) {
g.updateOptions({ logscale: val });
linear.disabled = !val;
log.disabled = val;
- }
+ };
+ linear.onclick = function() { setLog(false); };
+ log.onclick = function() { setLog(true); };
}
- });
\ No newline at end of file
+ });