this.annotations = new Array();
this.chartLabels = {};
- this.area = layout.plotArea;
+ this.area = layout.getPlotArea();
this.container.style.position = "relative";
this.container.style.width = this.width + "px";
this.datasets = new Array();
this.annotations = new Array();
this.yAxes_ = null;
- this.plotArea = this.computePlotArea_();
// TODO(danvk): it's odd that xTicks_ and yTicks_ are inputs, but xticks and
// yticks are outputs. Clean this up.
this.datasets[setname] = set_xy;
};
+DygraphLayout.prototype.getPlotArea = function() {
+ return this.computePlotArea_();
+}
+
// Compute the box which the chart should be drawn in. This is the canvas's
// box, less space needed for axis and chart labels.
DygraphLayout.prototype.computePlotArea_ = function() {
canvas.style.height = canvas.height + 'px'; // for IE
};
- var plotArea = this.layout_.plotArea;
+ var plotArea = this.layout_.getPlotArea();
var xAxisLabelHeight = this.attr_('axisLabelFontSize') + 2 * this.attr_('axisTickSize');
this.canvasRect_ = {
x: plotArea.x,
<body>
<h2>Multiple y-axes</h2>
<p>The same data with both one and two y-axes. Two y-axes:</p>
- <div id="demodiv"></div>
+ <div id="demodiv" style="width: 640; height: 350; border: 1px solid black"></div>
<p>A single y-axis:</p>
- <div id="demodiv_one"></div>
+ <div id="demodiv_one" style="width: 640; height: 350; border: 1px solid black"></div>
<script type="text/javascript">
var data = [];
data,
{
labels: [ 'Date', 'Y1', 'Y2', 'Y3', 'Y4' ],
- width: 640,
- height: 350,
'Y3': {
axis: {
}
data,
{
labels: [ 'Date', 'Y1', 'Y2', 'Y3', 'Y4' ],
- width: 640,
- height: 350,
labelsKMB: true
}
);