Skip to content

Instantly share code, notes, and snippets.

@jonfrost
Created September 18, 2011 17:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonfrost/1225313 to your computer and use it in GitHub Desktop.
Save jonfrost/1225313 to your computer and use it in GitHub Desktop.
SVG Open ~ D3 Workshop ~ Example 01
<!DOCTYPE html>
<html>
<head>
<title>D3 Example 1 ~ SVG Open</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script>
<style type="text/css">
body {
background: #aaa;
}
ellipse {
stroke: steelblue;
stroke-width: 2.5;
fill: #ddd;
}
</style>
</head>
<body>
<div id="vis" style="width:100%;height:100%;"></div>
<script type="text/javascript">
var svg = d3.select("#vis").append("svg:svg")
.attr("width", 400)
.attr("height", 300);
svg.append("svg:ellipse")
.attr("cx", 100)
.attr("cy", 100)
.attr("rx", 70)
.attr("ry", 90);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment