4 name
: "Multiple y-axes",
5 setup
: function(parent
) {
7 "<p>The same data with both one and two y-axes. Two y-axes:</p>" +
8 "<div id='demodiv' style='width: 640; height: 350; border: 1px solid black'></div>" +
9 "<p>A single y-axis:</p>" +
10 "<div id='demodiv_one' style='width: 640; height: 350; border: 1px solid black'></div>" +
11 "<input type='checkbox' id='check'><label for='check'> Fill?</label>";
14 document
.getElementById('check') = function(el
) {
15 g
.updateOptions( { fillGraph
: el
.checked
} );
16 g2
.updateOptions( { fillGraph
: el
.checked
} );
20 for (var i
= 1; i
<= 100; i
++) {
22 if (d
> 31) { m
= "02"; d
-= 31; }
23 if (m
== "02" && d
> 28) { m
= "03"; d
-= 28; }
24 if (m
== "03" && d
> 31) { m
= "04"; d
-= 31; }
25 if (d
< 10) d
= "0" + d
;
26 // two series, one with range 1-100, one with range 1-2M
27 data
.push([new Date("2010/" + m + "/" + d
),
30 1e6
* (1 + i
* (100 - i
) / (50 * 50)),
31 1e6
* (2 - i
* (100 - i
) / (50 * 50))]);
35 document
.getElementById("demodiv"),
38 labels
: [ 'Date', 'Y1', 'Y2', 'Y3', 'Y4' ],
44 axis
: 'Y3' // use the same y-axis as series Y3
48 // set axis-related properties here
52 ylabel
: 'Primary y-axis',
53 y2label
: 'Secondary y-axis',
59 document
.getElementById("demodiv_one"),
62 labels
: [ 'Date', 'Y1', 'Y2', 'Y3', 'Y4' ],
64 ylabel
: 'Primary y-axis',
65 y2label
: 'Secondary y-axis',