projects
/
dygraphs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove old_init and the four arg constructor.
[dygraphs.git]
/
gallery
/
two-axes.js
diff --git
a/gallery/two-axes.js
b/gallery/two-axes.js
index
93247df
..
fae6c89
100644
(file)
--- 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) {
Gallery.register(
'two-axes',
{
name: "Multiple y-axes",
setup: function(parent) {
- parent.innerHTML =
+ parent.innerHTML =
"<p>The same data with both one and two y-axes. Two y-axes:</p>" +
"<div id='demodiv' style='width: 640; height: 350; border: 1px solid black'></div>" +
"<p>A single y-axis:</p>" +
"<div id='demodiv_one' style='width: 640; height: 350; border: 1px solid black'></div>" +
"<p>The same data with both one and two y-axes. Two y-axes:</p>" +
"<div id='demodiv' style='width: 640; height: 350; border: 1px solid black'></div>" +
"<p>A single y-axis:</p>" +
"<div id='demodiv_one' style='width: 640; height: 350; border: 1px solid black'></div>" +
- "<input type=
checkbox id='check' onChange='update(this)
'><label for='check'> Fill?</label>";
+ "<input type=
'checkbox' id='check
'><label for='check'> Fill?</label>";
},
run: function() {
},
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;
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',
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 } );
- }
}
});
}
});