Commit 8d448106 authored by olau@iola.dk's avatar olau@iola.dk

Use new drawSeries hook, don't barf on series that don't have images


git-svn-id: https://flot.googlecode.com/svn/trunk@243 1e0a6537-2640-0410-bfb7-f154510ff394
parent c61c120a
...@@ -112,10 +112,12 @@ images (like Google Maps). ...@@ -112,10 +112,12 @@ images (like Google Maps).
}); });
} }
function draw(plot, ctx) { function drawSeries(plot, ctx, series) {
var plotOffset = plot.getPlotOffset(); var plotOffset = plot.getPlotOffset();
$.each(plot.getData(), function (i, series) { if (!series.images || !series.images.show)
return;
var points = series.datapoints.points, var points = series.datapoints.points,
ps = series.datapoints.pointsize; ps = series.datapoints.pointsize;
...@@ -206,7 +208,6 @@ images (like Google Maps). ...@@ -206,7 +208,6 @@ images (like Google Maps).
x2 - x1, y2 - y1); x2 - x1, y2 - y1);
ctx.globalAlpha = tmp; ctx.globalAlpha = tmp;
} }
});
} }
function processRawData(plot, series, data, datapoints) { function processRawData(plot, series, data, datapoints) {
...@@ -225,7 +226,7 @@ images (like Google Maps). ...@@ -225,7 +226,7 @@ images (like Google Maps).
function init(plot) { function init(plot) {
plot.hooks.processRawData.push(processRawData); plot.hooks.processRawData.push(processRawData);
plot.hooks.draw.push(draw); plot.hooks.drawSeries.push(drawSeries);
} }
$.plot.plugins.push({ $.plot.plugins.push({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment