Added draw hook

git-svn-id: https://flot.googlecode.com/svn/trunk@167 1e0a6537-2640-0410-bfb7-f154510ff394
pull/1/head
olau@iola.dk 17 years ago
parent f1db197e35
commit 2ebeb5d4f6

@ -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 Note that you must leave datapoints in a good condition as Flot
doesn't check it or do any normalization on it afterwards. 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] - bindEvents [phase 6]

@ -113,6 +113,7 @@
processOptions: [], processOptions: [],
processRawData: [], processRawData: [],
processDatapoints: [], processDatapoints: [],
draw: [],
bindEvents: [], bindEvents: [],
drawOverlay: [] drawOverlay: []
}, },
@ -994,8 +995,11 @@
function draw() { function draw() {
if (options.grid.show) if (options.grid.show)
drawGrid(); drawGrid();
for (var i = 0; i < series.length; ++i) for (var i = 0; i < series.length; ++i)
drawSeries(series[i]); drawSeries(series[i]);
executeHooks(hooks.draw, [ctx]);
} }
function extractRange(ranges, coord) { function extractRange(ranges, coord) {

Loading…
Cancel
Save