...
/Styles: Fill, Stroke, Opacity, and Fill-Opacity
Styles: Fill, Stroke, Opacity, and Fill-Opacity
Learn how to apply fill, stroke, opacity, and fill-opacity styles to your D3 elements.
We'll cover the following...
What is a style?
Believe it or not, that’s as difficult a question to answer as, “What’s an attribute?” I like to think that an element can be selected and arranged on a web page with select
and attr
. But once it’s there, changes to how it looks are a matter for style
. We will cover a range of qualities that neatly fit into this definition in the following section (such as fill, opacity, and stroke-width), but there are also a range of unusual style declarations that many may not have come across. I certainly hadn’t before writing this.
The other important thing to mention about setting styles for elements is that there are different ways to accomplish the task. We’ll go through the process of describing different styles, as they can be applied to individual ...