How do I display an icon at a point on a line chart using d3.js

后端 未结 2 1435
孤城傲影
孤城傲影 2021-01-24 07:46

I am creating a simple line chart using d3, ... but instead of the standard points along the path, I\'d like to display a fon-awesome icon such as \'fa-arrow-up\'.

I\'ve

2条回答
  •  不要未来只要你来
    2021-01-24 08:18

    var image = ;//image link
    

    Give the link to your image above

    point.append("image")
        .attr("xlink:href", image)
        .attr("x", -12)
        .attr("y", -12)
        .attr("width", 24)
        .attr("height", 24)
        ;
    

    Make sure you give it attributes : x/y, width/height

提交回复
热议问题