Annotations with strings on D3 histograms

I would like to add annotations to an SVG histogram written in D3.

I want to add lines and text to the chart as shown below:

enter image description here

My question is, is there a best practice for this or a general pattern?

My guess would be to use the .each method following the data .enter() method

. Then, using a conditional statement, you can call a function that inserts the rendered lines and text.

+3


source to share


1 answer


There are several ready-made options that can help:

Swoopy Arrows

Swoopy Drag



D3-ring-note

Polyglue

+1


source







All Articles