diff --git a/jquery.flot.js b/jquery.flot.js index aa97357..c5182bd 100644 --- a/jquery.flot.js +++ b/jquery.flot.js @@ -76,7 +76,7 @@ color: "#545454", // primary color used for outline and labels backgroundColor: null, // null for transparent, else color tickColor: "#dddddd", // color used for the ticks - labelMargin: 3, // in pixels + labelMargin: 5, // in pixels borderWidth: 2, coloredAreas: null, // array of { x1, y1, x2, y2 } or fn: plot area -> areas coloredAreasColor: "#f4f4f4", @@ -802,25 +802,21 @@ // get the most space needed around the grid for things // that may stick out var maxOutset = options.grid.borderWidth / 2; - if (options.points.show) - maxOutset = Math.max(maxOutset, options.points.radius + options.points.lineWidth/2); - for (i = 0; i < series.length; ++i) { - if (series[i].points.show) - maxOutset = Math.max(maxOutset, series[i].points.radius + series[i].points.lineWidth/2); - } + for (i = 0; i < series.length; ++i) + maxOutset = Math.max(maxOutset, 2 * (series[i].points.radius + series[i].points.lineWidth/2)); plotOffset.left = plotOffset.right = plotOffset.top = plotOffset.bottom = maxOutset; if (xaxis.labelHeight > 0) - plotOffset.bottom += xaxis.labelHeight + options.grid.labelMargin; + plotOffset.bottom = Math.max(maxOutset, xaxis.labelHeight + options.grid.labelMargin); if (yaxis.labelWidth > 0) - plotOffset.left += yaxis.labelWidth + options.grid.labelMargin; + plotOffset.left = Math.max(maxOutset, yaxis.labelWidth + options.grid.labelMargin); if (x2axis.labelHeight > 0) - plotOffset.top += x2axis.labelHeight + options.grid.labelMargin; + plotOffset.top = Math.max(maxOutset, x2axis.labelHeight + options.grid.labelMargin); if (y2axis.labelWidth > 0) - plotOffset.right += y2axis.labelWidth + options.grid.labelMargin; + plotOffset.right = Math.max(maxOutset, y2axis.labelWidth + options.grid.labelMargin); plotWidth = canvasWidth - plotOffset.left - plotOffset.right; plotHeight = canvasHeight - plotOffset.bottom - plotOffset.top; @@ -966,7 +962,7 @@ tick = yaxis.ticks[i]; if (!tick.label || tick.v < yaxis.min || tick.v > yaxis.max) continue; - html += '