* The chart canvas has already been created by the Dygraph object. The
* renderer simply gets a drawing context.
*
- * @param {Dyraph} dygraph The chart to which this renderer belongs.
+ * @param {Dygraph} dygraph The chart to which this renderer belongs.
* @param {Canvas} element The <canvas> DOM element on which to draw.
* @param {CanvasRenderingContext2D} elementContext The drawing context.
* @param {DygraphLayout} layout The chart's DygraphLayout object.
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,
+ singleSeriesName: opt_seriesName,
allSeriesPoints: sets
});
ctx.restore();
* @private
*/
DygraphCanvasRenderer._fillPlotter = function(e) {
+ // Skip if we're drawing a single series for interactive highlight overlay.
+ if (e.singleSeriesName) return;
+
// We'll handle all the series at once, not one-by-one.
if (e.seriesIndex !== 0) return;
'rgba(' + rgb.r + ',' + rgb.g + ',' + rgb.b + ',' + fillAlpha + ')';
ctx.fillStyle = err_color;
ctx.beginPath();
- while(iter.hasNext) {
+ var last_x, is_first = true;
+ while (iter.hasNext) {
var point = iter.next();
if (!Dygraph.isOK(point.y)) {
prevX = NaN;
continue;
}
if (stackedGraph) {
+ if (!is_first && last_x == point.xval) {
+ continue;
+ } else {
+ is_first = false;
+ last_x = point.xval;
+ }
+
currBaseline = baseline[point.canvasx];
var lastY;
if (currBaseline === undefined) {