Search⌘ K

Make a Dashed Line

Explore how to make dashed lines on your simple D3 graph by using the stroke-dasharray style property. Understand how numerical patterns control dash length and spacing, and learn how to apply dashed lines effectively on graph elements and axes.

Dashed lines totally rock!

One of the best parts about it is that they’re so simple to do! Literally, it is just one line!

Making a dashed line

So, let’s imagine that we want to make the line on our simple graph dashed. All we have to do ...