Built with blockbuilder.org
Created
January 4, 2020 05:47
-
-
Save postmalloc/c816dcdcea93bfc78332ef45663db571 to your computer and use it in GitHub Desktop.
fresh block
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
license: mit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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; } | |
.chart div { | |
font: 10px sans-serif; | |
background-color: steelblue; | |
text-align: right; | |
padding: 3px; | |
margin: 1px; | |
color: white; | |
} | |
</style> | |
</head> | |
<body> | |
<div class='chart'></div> | |
<script> | |
// Feel free to change or delete any of the code you see in this editor! | |
data = [29, 62, 160, 273, 310] | |
d3.select('.chart') | |
.selectAll('div') | |
.data(data) | |
.enter() | |
.append('div') | |
.style('width', d => d + 'px') | |
.text(d => d + 'px') | |
</script> | |
</body> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment