diff --git a/API.txt b/API.txt index 75ec3b6..bc64035 100644 --- a/API.txt +++ b/API.txt @@ -950,14 +950,23 @@ hooks in the plugins bundled with Flot. doesn't check it or do any normalization on it afterwards. + - drawSeries [phase 5] + + function(plot, canvascontext, series) + + Hook for custom drawing of a single series. Called just before the + standard drawing routine has been called in the loop that draws + each series. + + - draw [phase 5] function(plot, canvascontext) Hook for drawing on the canvas. Called after the grid is drawn - (unless it's disabled) and the series have been plotted (in case - any points, lines or bars have been turned on). For examples of how - to draw things, look at the source code. + (unless it's disabled or grid.aboveData is set) and the series have + been plotted (in case any points, lines or bars have been turned + on). For examples of how to draw things, look at the source code. - bindEvents [phase 6] diff --git a/NEWS.txt b/NEWS.txt index 828d8fe..dcad031 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -18,7 +18,7 @@ Changes: to null). Issue 235. - Date formatter now accepts %0m and %0d to get a zero-padded month or day (issue raised by Maximillian Dornseif). - +- New hooks: drawSeries Bug fixes: diff --git a/jquery.flot.js b/jquery.flot.js index 4fae3b8..e6373e7 100644 --- a/jquery.flot.js +++ b/jquery.flot.js @@ -139,6 +139,7 @@ processOptions: [], processRawData: [], processDatapoints: [], + drawSeries: [], draw: [], bindEvents: [], drawOverlay: [] @@ -1067,8 +1068,10 @@ if (grid.show && !grid.aboveData) drawGrid(); - for (var i = 0; i < series.length; ++i) + for (var i = 0; i < series.length; ++i) { + executeHooks(hooks.drawSeries, [ctx, series[i]]); drawSeries(series[i]); + } executeHooks(hooks.draw, [ctx]);