diff --git a/API.txt b/API.txt index cae0c4a..1abd9ef 100644 --- a/API.txt +++ b/API.txt @@ -923,6 +923,16 @@ Currently available hooks (when in doubt, check the Flot source): Note that you must leave datapoints in a good condition as Flot doesn't check it or do any normalization on it afterwards. + + - 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. + - bindEvents [phase 6] diff --git a/jquery.flot.js b/jquery.flot.js index 6b9c79e..af13fab 100644 --- a/jquery.flot.js +++ b/jquery.flot.js @@ -113,6 +113,7 @@ processOptions: [], processRawData: [], processDatapoints: [], + draw: [], bindEvents: [], drawOverlay: [] }, @@ -994,8 +995,11 @@ function draw() { if (options.grid.show) drawGrid(); + for (var i = 0; i < series.length; ++i) drawSeries(series[i]); + + executeHooks(hooks.draw, [ctx]); } function extractRange(ranges, coord) {