【问题标题】:how can I add labels to g.raphael pie chart如何向 g.raphael 饼图添加标签
【发布时间】:2014-12-10 14:58:47
【问题描述】:

我想为 g.raphael 饼图添加标签,以便与每个段一起显示。我找不到任何代码来执行此操作,也无法自行解决 - 谁能帮忙?

【问题讨论】:

    标签: text label raphael graphael pie-chart


    【解决方案1】:

    我建议您使用 raphael 的示例代码: http://raphaeljs.com/pie.html

    标签添加在这一行:

     txt = paper.text(cx + (r + delta + 55) * Math.cos(-popangle * rad),
     cy + (r + delta + 25) * Math.sin(-popangle * rad), 
     labels[j]).attr({fill: bcolor, stroke: "none", opacity: 0, "font-size": 20});
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-04-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多