Built with blockbuilder.org
forked from lnmunhoz's block: 1. Centered Circle
forked from lnmunhoz's block: learning d3: centered square
forked from lnmunhoz's block: learning d3: centered square
| license: mit |
Built with blockbuilder.org
forked from lnmunhoz's block: 1. Centered Circle
forked from lnmunhoz's block: learning d3: centered square
forked from lnmunhoz's block: learning d3: centered square
| <!DOCTYPE html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <script src="https://d3js.org/d3.v4.min.js"></script> | |
| <style> | |
| body { margin:0;position:fixed;top:0;right:0;bottom:0;left:0 } | |
| </style> | |
| </head> | |
| <body> | |
| <div id="chart-area"></div> | |
| <script> | |
| const svg = d3.select("#chart-area") | |
| .append("svg") | |
| .attr("width", 400) | |
| .attr("height", 400) | |
| .style("border", "1px solid black") | |
| const ellipse = svg.append("ellipse") | |
| .attr("cx", 200) | |
| .attr("cy", 200) | |
| .attr("rx", 50) | |
| .attr("ry", 100) | |
| .attr("fill", "blue") | |
| </script> | |
| </body> |