Built with blockbuilder.org
forked from molliemarie's block: BarChart2_D3_Complete
license: mit |
Built with blockbuilder.org
forked from molliemarie's block: BarChart2_D3_Complete
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Second Bar Chart Using D3!</title> | |
<style> | |
/* Set `rect` elements to have a "fill" of "purple" or whatever color you choose */ | |
rect { | |
fill: purple; | |
} | |
svg { | |
border: 1px solid #f0f; | |
} | |
</style> | |
<!--- Load the d3 library --> | |
<script src="https://d3js.org/d3.v4.min.js"></script> | |
</head> | |
<body> | |
</body> | |
<script type="text/javascript"> | |
// 1) Select your `body` and append a `div` element in which you'll render your content. To do this, you'll use the `d3.select()` method, and then the `.append()` method to append your element to your selection. | |
// 2) Append a new `p` element to the `div` you just created, and use the `.text()` method to set the text to "My Bar Chart" | |
// 3) Append a container `svg` to your `div` element in which you'll place your rectangles | |
// 4) Append 3 `rect` elements inside of your `<svg>` (one at a time), setting the properties for each one. | |
</script> | |
</html> |