切换布局
显示结果
<!DOCTYPE html> <html> <head> <script type = "text/javascript" src = "https://cdn.jsdelivr.net/npm/d3@7"></script> </head> <body> <div id = "svgcontainer"></div> <script> var width = 300; var height = 300; var svg = d3.select("#svgcontainer") .append("svg") .attr("width", width) .attr("height", height); svg.append("ellipse") .attr("cx", 200) .attr("cy", 50) .attr("rx", 100) .attr("ry", 50) .attr("fill", "green") </script> </body> </html>