This reverts the change from https://github.com/danvk/dygraphs/pull/211
and instead provides a boolean arg to the plotter so that it can decide
not to draw if needed.
The problem with the approach from #211 is that this prevents error bars
from being highlighted, and those should be redrawn on mouseover.
Fixes issue 424.
for (var j = 0; j < sets.length; j++) {
setName = setNames[j];
- if (opt_seriesName && !(is_last && setName == opt_seriesName)) continue;
+ if (opt_seriesName && setName != opt_seriesName) continue;
var points = sets[j];
plotArea: this.area,
seriesIndex: j,
seriesCount: sets.length,
+ onlySeries: opt_seriesName,
allSeriesPoints: sets
});
ctx.restore();
DygraphCanvasRenderer._fillPlotter = function(e) {
// We'll handle all the series at once, not one-by-one.
if (e.seriesIndex !== 0) return;
+ if (e.onlySeries) return;
var g = e.dygraph;
var setNames = g.getLabels().slice(1); // remove x-axis