Skip to content

Instantly share code, notes, and snippets.

@amitkaps
Created October 5, 2015 20:42
Show Gist options
  • Save amitkaps/9b1bccb42e1046ba08a2 to your computer and use it in GitHub Desktop.
Save amitkaps/9b1bccb42e1046ba08a2 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<style>
#chart div {
background-color: brown;
height: 25px;
margin: 5px;
}
</style>
<div id="chart"> </div>
<script>
var data = [5, 25, 15, 20, 10]
for (i = 0; i < data.length; i++){
var div = document.createElement("div");
div.style.width = data[i]*10 + "px";
document.getElementById('chart').appendChild(div);
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment