I want to add an icon inside C3.js piechart slices. I want this:
Asked
Active
Viewed 315 times
0

Antti29
- 2,953
- 12
- 34
- 36
-
Hello and welcome to StackOverflow. Please take some time to read the help page, especially the sections named ["What topics can I ask about here?"](http://stackoverflow.com/help/on-topic) and ["What types of questions should I avoid asking?"](http://stackoverflow.com/help/dont-ask). And more importantly, please read [the Stack Overflow question checklist](http://meta.stackexchange.com/q/156810/204922). You might also want to learn about [Minimal, Complete, and Verifiable Examples](http://stackoverflow.com/help/mcve). – Clijsters Oct 27 '17 at 11:16
1 Answers
0
This should add icons using fontawesome
d3.selectAll(".c3-chart-arcs text").each(function(d) {
// your update code here as it was in your example
d3.select(this).append('text')
.attr('font-family', 'FontAwesome')
.attr('font-size', function(d) { return '2em'} )
.text(function(d) { return '\uf118' });
});
More info - Adding FontAwesome icons to a D3 graph

Amitoz Deol
- 65
- 1
- 9