1

I am trying to add icons on my text nodes from font-awesome. Instead of showing me the proper icon, the whole html gets class fontawesome-i2svg-active fontawesome-i2svg-complete and i get a big question mark/exclamation mark are shown on the page.

I tried applying the following code which i found as a reply on fontawesome github page.

const textEnter = textElements
  .enter()
  .append('text')
  .attr('x', 15)
  .attr('y', -17)
  .attr('fill', 'black')
  .attr('class', 'fa')
  .attr('font-size', '20')
  .text('\uf2b9');

EDIT:

The solution which is offered here doesn't work:

Adding FontAwesome icons to a D3 graph

Arkadiy Stepanov
  • 181
  • 1
  • 2
  • 14

1 Answers1

-1

Are you using the Font-Awesome font? Double check with the inspector that FontAwesome is set as the font-family

Another solution would be to use font awesomes svg files as images. or depending on your setup you could even inline the svg files directly in the source code.

Leon Radley
  • 7,596
  • 5
  • 35
  • 54