Trouble shooting a problem with drawing circles.
Darker circle should be an oval. The lighter one should be a circle.
EDIT: The solution was to add an ellipse to the svg rather than a circle.
license: gpl-3.0 |
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<svg width="960" height="200"></svg> | |
<script src="https://d3js.org/d3.v4.min.js"></script> | |
<script> | |
var svg = d3.select("svg"), | |
width = +svg.attr("width"), | |
height = +svg.attr("height"); | |
svg.append('ellipse') | |
.attr('cx', 150) | |
.attr('cy', 100) | |
.attr('rx', 25) | |
.attr('ry', 50) | |
.style('fill', 'darkseagreen') | |
.style('stroke', '#232323'); | |
svg.append('circle') | |
.attr('cx', 450) | |
.attr('cy', 100) | |
.attr('r', 50) | |
.style('fill', 'lightseagreen') | |
.style('stroke', '#232323'); | |
</script> |