The core problem is that the proxy tracks moveTo and lineTo calls and assumes that all lineTo calls draw lines. However, this assumes that the path will be stroked, and this isn't always the case. For the filled area below filled/stacked lines, it fills the path but doesn't stroke it. The strokeStyle was left as whatever the most recent line used, and had no effect on the filled path since it's not stroked. But the line count test just looked at the strokeStyle and lineTo calls and counted them as lines, so the line count for the first series was something like 55 instead of the expected <10 number..

It would arguably be more correct to change the proxy to distinguish stroked from non-stroked paths, but that seems a bit tricky since it requires fixing things up at the time the path gets closed.

I had also tried setting strokeStyle to null or undefined, but that just got ignored and the strokeStyle was left unchanged at its previous value.