Skip to content

Instantly share code, notes, and snippets.

@lnmunhoz
Last active February 21, 2019 06:01
Show Gist options
  • Save lnmunhoz/632767b8b6f28fb1c27c6c8bbf73e6a6 to your computer and use it in GitHub Desktop.
Save lnmunhoz/632767b8b6f28fb1c27c6c8bbf73e6a6 to your computer and use it in GitHub Desktop.
learning d3: ellipse
license: mit
<!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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment