Skip to content

Instantly share code, notes, and snippets.

Last active August 9, 2018 20:17
  • Star 1 You must be signed in to star a gist
  • Fork 12 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save mbostock/7322386 to your computer and use it in GitHub Desktop.
Bar Chart I
license: gpl-3.0
<!DOCTYPE html>
<meta charset="utf-8">
.chart div {
font: 10px sans-serif;
background-color: steelblue;
text-align: right;
padding: 3px;
margin: 1px;
color: white;
<div class="chart"></div>
<script src="//"></script>
var data = [4, 8, 15, 16, 23, 42];
var x = d3.scale.linear()
.domain([0, d3.max(data)])
.range([0, 420]);".chart")
.style("width", function(d) { return x(d) + "px"; })
.text(function(d) { return d; });
Copy link

scale.linear() has changed to scaleLinear()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment