X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;ds=sidebyside;f=dygraph.js;h=38dd1f447a852aab379f9716b2e68ab752f3db75;hb=df75aef5d3eb2056253841c2522e61ecf5dc53a2;hp=a96b98fdac21b87243a4bc7cbb914c07b468d4d1;hpb=e1242d5b540803a1848481ce75932a85693de74c;p=dygraphs.git diff --git a/dygraph.js b/dygraph.js index a96b98f..38dd1f4 100644 --- a/dygraph.js +++ b/dygraph.js @@ -2027,7 +2027,7 @@ Dygraph.prototype.updateSelection_ = function(opt_animFraction) { ctx.lineWidth = this.getNumericOption('strokeWidth', pt.name); ctx.strokeStyle = color; ctx.fillStyle = color; - callback(this.g, pt.name, ctx, canvasx, pt.canvasy, + callback(this, pt.name, ctx, canvasx, pt.canvasy, color, circleSize, pt.idx); } ctx.restore(); @@ -2366,18 +2366,22 @@ Dygraph.stackPoints_ = function( var actualYval = point.yval; if (isNaN(actualYval) || actualYval === null) { - // Interpolate/extend for stacking purposes if possible. - updateNextPoint(i); - if (prevPoint && nextPoint && fillMethod != 'none') { - // Use linear interpolation between prevPoint and nextPoint. - actualYval = prevPoint.yval + (nextPoint.yval - prevPoint.yval) * - ((xval - prevPoint.xval) / (nextPoint.xval - prevPoint.xval)); - } else if (prevPoint && fillMethod == 'all') { - actualYval = prevPoint.yval; - } else if (nextPoint && fillMethod == 'all') { - actualYval = nextPoint.yval; - } else { + if(fillMethod == 'none') { actualYval = 0; + } else { + // Interpolate/extend for stacking purposes if possible. + updateNextPoint(i); + if (prevPoint && nextPoint && fillMethod != 'none') { + // Use linear interpolation between prevPoint and nextPoint. + actualYval = prevPoint.yval + (nextPoint.yval - prevPoint.yval) * + ((xval - prevPoint.xval) / (nextPoint.xval - prevPoint.xval)); + } else if (prevPoint && fillMethod == 'all') { + actualYval = prevPoint.yval; + } else if (nextPoint && fillMethod == 'all') { + actualYval = nextPoint.yval; + } else { + actualYval = 0; + } } } else { prevPoint = point;