【问题标题】:How can I add an image inside C3.js piechart slices?如何在 C3.js 饼图切片中添加图像?
【发布时间】:2018-04-08 22:44:53
【问题描述】:

我想在 C3.js 饼图切片中添加一个图标。我想要这个:

【问题讨论】:

标签: c3.js


【解决方案1】:

这应该使用 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' });  
});

更多信息 - Adding FontAwesome icons to a D3 graph

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-12-04
    • 2020-10-31
    相关资源
    最近更新 更多