Skip to content

Instantly share code, notes, and snippets.

@molliemarie
Last active February 7, 2020 19:04
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 molliemarie/fa37e896bc3e3c30e3937db517b7b126 to your computer and use it in GitHub Desktop.
Save molliemarie/fa37e896bc3e3c30e3937db517b7b126 to your computer and use it in GitHub Desktop.
Scatter1_HTML_ClassWork
license: mit
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>First Scatter Plot Using HTML!</title>
<style>
/* 5) Set `circle` elements to have a "fill" of "purple" or whatever color you choose */
circle {
fill: purple;
}
svg {
border: 1px solid #f0f;
}
</style>
</head>
<body>
<!-- 1) Make a container `<div>` in which you'll render your content -->
<div>
<p>My HTML Scatter</p>
<svg width=300 height=400>
<circle cx=100 cy=100 r=10></circle>
<circle cx=150 cy=150 r=15></circle>
<circle cx=200 cy=200 r=20></circle>
</svg>
</div>
<!-- 2) Create a `<p>` element in which you write "My HTML Scatter" -->
<!-- 3) Make a container `<svg>` element in which you'll place your circles -->
<!-- Set your svg's `width` to 300, and `height` to `400` -->
<!-- 4) Put 3 `<circle>` inside of your `<svg>`,
setting the properties for each one: -->
<!--
- `cx`: How far to move the circle in the `x` direction (right). Should be 100, 150, and 200.
- `cy`: How for to move the circle in the `y` direction (down from the top). Should be 100, 150, and 200.
- 'r': circle's radius. Should be 10, 15, and 20.
-->
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment