};
// Verifies that a div resize gets picked up.
+/*
+ this one isn't quite ready yet.
CssTestCase.prototype.testDivResize = function() {
var opts = {
};
assertEquals(490, graph.offsetHeight);
assertEquals({width: 650, height: 490}, g.size());
};
+*/
html, body {
height: 100%;
}
- #div_g {
- position: absolute;
- left: 10px;
- right: 10px;
- top: 10px;
- height: 250px;
- border: 1px solid black;
- }
</style>
</head>
<body>
- <div id="div_g"></div>
+ <div id="div_g" style="width:95%; height:95%"></div>
<script type="text/javascript">
- document.getElementById("div_g").addEventListener('resize', function() {
- console.log("resize!");
- }, false);
- document.getElementById("div_g").onresize = function() {
- console.log("resize2!");
- };
- //g = new Dygraph(
- // document.getElementById("div_g"),
- // NoisyData, {
- // rollPeriod: 7,
- // errorBars: true
- // }
- // );
+ g = new Dygraph(
+ document.getElementById("div_g"),
+ NoisyData, {
+ rollPeriod: 7,
+ errorBars: true
+ }
+ );
- // window.onresize = function() {
- // g.resize();
- // }
+ window.onresize = function() {
+ g.resize();
+ }
</script>
</body>
</html>