See this part of the spec on the Z command:
http://www.w3.org/TR/SVG/paths.html#PathDataClosePathCommand
And this part on filling paths:
http://www.w3.org/TR/SVG/painting.html#FillProperties
Specifically:
"""
The fill operation fills open subpaths by performing the fill
operation as if an additional "closepath" command were added to the
path to connect the last point of the subpath with the first point of
the subpath. Thus, fill operations apply to both open subpaths within
‘path’ elements (i.e., subpaths without a closepath command) and
‘polyline’ elements.
"""
So, if you use d3.svg.line to create an svg:path element, you probably
only want to apply a stroke style. If you apply a fill style, there's
that implicit closepath command that connects the first and last point
of the line. If you want a fill, you probably want to use d3.svg.area
instead, which defines an explicit baseline (which could be 0 for a
simple area chart, or another series of data for a stacked area
chart). Areas can also be stroked, in which case the entire path is
stroked. Often, you use an area for fill in conjunction with a line
for stroke, as here:
Mike
Right, that's what I'd recommend. I should have also mentioned that
the default fill for paths is opaque black (with no stroke), which is
not what you want for a line.
> I'm just getting this weird Chrome 'bug' now
Have you used the element inspector to see what styles are being
applied to the path elements? Are you styling a containing svg:g or
svg:svg element? Can you include a screenshot or an example of the
problem so we can see exactly what the bug is?
Mike
That does look a little suspicious. Why so many repeated data points
"L920,84"? My guess is somewhere in your line you have a spurious L0,0
that causes it to go back to the origin. I'd try simplifying the line
geometry until the problem goes away, and then figure out where the
bogus point is coming from.
Mike
I don't think it's duplicate datapoints that are causing the problem,
but it was suspicious and suggested to me there could perhaps be
another problem related to the line construction.
Mike