Really fix spacing bug

git-svn-id: https://flot.googlecode.com/svn/trunk@61 1e0a6537-2640-0410-bfb7-f154510ff394
pull/1/head
olau@iola.dk 18 years ago
parent 8d07034e65
commit 436abc2f2e

@ -1,3 +1,9 @@
Flot x.x
--------
Fixed a bug in calculating spacing around the plot (reported by timothytoe).
Flot 0.4 Flot 0.4
-------- --------

@ -695,7 +695,7 @@
dummyDiv.remove(); dummyDiv.remove();
} }
var maxOutset = options.grid.borderWidth; var maxOutset = options.grid.borderWidth / 2;
if (options.points.show) if (options.points.show)
maxOutset = Math.max(maxOutset, options.points.radius + options.points.lineWidth/2); maxOutset = Math.max(maxOutset, options.points.radius + options.points.lineWidth/2);
for (i = 0; i < series.length; ++i) { for (i = 0; i < series.length; ++i) {
@ -705,6 +705,7 @@
plotOffset.left = plotOffset.right = plotOffset.top = plotOffset.bottom = maxOutset; plotOffset.left = plotOffset.right = plotOffset.top = plotOffset.bottom = maxOutset;
if (yLabelMaxWidth > 0)
plotOffset.left += yLabelMaxWidth + options.grid.labelMargin; plotOffset.left += yLabelMaxWidth + options.grid.labelMargin;
plotWidth = canvasWidth - plotOffset.left - plotOffset.right; plotWidth = canvasWidth - plotOffset.left - plotOffset.right;
@ -730,7 +731,9 @@
dummyDiv.remove(); dummyDiv.remove();
} }
if (xLabelMaxHeight > 0)
plotOffset.bottom += xLabelMaxHeight + options.grid.labelMargin; plotOffset.bottom += xLabelMaxHeight + options.grid.labelMargin;
plotHeight = canvasHeight - plotOffset.bottom - plotOffset.top; plotHeight = canvasHeight - plotOffset.bottom - plotOffset.top;
hozScale = plotWidth / (xaxis.max - xaxis.min); hozScale = plotWidth / (xaxis.max - xaxis.min);
vertScale = plotHeight / (yaxis.max - yaxis.min); vertScale = plotHeight / (yaxis.max - yaxis.min);

Loading…
Cancel
Save