D3.js:利用image()函數來加入圖片

下列是程式碼範例,利用image()函數來加入圖片

svg_01 = d3.select("#div01").append("svg")

        .attr("width", "100%")

        .attr("height", "100%")

        .attr("viewBox","0 0 300 80")

        .attr("id", "ID001")

        .append("g")

svg_01.append("svg:image")

    .attr('x', 100) //x座標

    .attr('y', 100) //y座標

    .attr('width', 150) //指定圖片寬度

    .attr('height', 150) //指定圖片長度

    .attr("xlink:href", "img/001.png") //圖片路徑與檔名

Windows 11安裝時跳過網路連線