chungtinhlakho
chungtinhlakho

Reputation: 930

D3 fill shape when draw with path

I'm using D3 to draw a certain shape layout for my map and the drew area has to be shaded. I am using line path to achieved the shape, What I couldn't figured out is how do I shade (fill) the area with a certain color. See picture for an example shape, just random in this case for visual aid. enter image description here

Upvotes: 0

Views: 269

Answers (2)

fhoff
fhoff

Reputation: 1

In order to fill the area described by these paths, simply assign the CSS attribute fill.

Upvotes: 0

Arjun Patel
Arjun Patel

Reputation: 266

you need to checkout the fill style property on paths.

<style>
path {  
 fill: red;
}
</style>

Upvotes: 1

Related Questions