diff --git a/src/jquery.flot.js b/src/jquery.flot.js index f9293bc..7e46334 100644 --- a/src/jquery.flot.js +++ b/src/jquery.flot.js @@ -3067,11 +3067,12 @@ Licensed under the MIT license. } function drawSeriesPoints(series) { - function plotPoints(datapoints, radius, fillStyle, offset, shadow, axisx, axisy, symbol) { + function plotPoints(datapoints, radius, fillStyle, offset, shadow, axisx, axisy, symbol, extraData = null) { var points = datapoints.points, ps = datapoints.pointsize; for (var i = 0; i < points.length; i += ps) { var x = points[i], y = points[i + 1]; + var value = x; if (x == null || x < axisx.min || x > axisx.max || y < axisy.min || y > axisy.max) { continue; } @@ -3081,16 +3082,17 @@ Licensed under the MIT license. y = axisy.p2c(y) + offset; if (symbol === "circle") { ctx.arc(x, y, radius, 0, shadow ? Math.PI : Math.PI * 2, false); + ctx.closePath(); + if (fillStyle) { + ctx.fillStyle = fillStyle; + ctx.fill(); + } + ctx.stroke(); } else { - symbol(ctx, x, y, radius, shadow, datapoints, series); - } - ctx.closePath(); - - if (fillStyle) { - ctx.fillStyle = fillStyle; + symbol(ctx, x, y, radius, shadow, extraData, value); + ctx.fillStyle = "#FF0000"; ctx.fill(); } - ctx.stroke(); } } @@ -3100,7 +3102,8 @@ Licensed under the MIT license. var lw = series.points.lineWidth, sw = series.shadowSize, radius = series.points.radius, - symbol = series.points.symbol; + symbol = series.points.symbol, + extraData = series.points.extraData; // If the user sets the line width to 0, we change it to a very // small value. A line width of 0 seems to force the default of 1. @@ -3117,18 +3120,18 @@ Licensed under the MIT license. ctx.lineWidth = w; ctx.strokeStyle = "rgba(0,0,0,0.1)"; plotPoints(series.datapoints, radius, null, w + w / 2, true, - series.xaxis, series.yaxis, symbol); + series.xaxis, series.yaxis, symbol, extraData); ctx.strokeStyle = "rgba(0,0,0,0.2)"; plotPoints(series.datapoints, radius, null, w / 2, true, - series.xaxis, series.yaxis, symbol); + series.xaxis, series.yaxis, symbol, extraData); } ctx.lineWidth = lw; ctx.strokeStyle = series.points.strokeColor || series.color; plotPoints(series.datapoints, radius, getFillStyle(series.points, series.color), 0, false, - series.xaxis, series.yaxis, symbol); + series.xaxis, series.yaxis, symbol, extraData); ctx.restore(); } @@ -3710,7 +3713,7 @@ Licensed under the MIT license. if (x < axisx.min || x > axisx.max || y < axisy.min || y > axisy.max) { return; } - + var value = x; var pointRadius, radius; if (series.points.show) { @@ -3729,7 +3732,7 @@ Licensed under the MIT license. if (series.points.symbol === "circle") { octx.arc(x, y, radius, 0, 2 * Math.PI, false); } else { - series.points.symbol(octx, x, y, radius, false); + series.points.symbol(octx, x, y, radius, false, series.points.extraData, value); } octx.closePath(); octx.stroke();