Skip to content

Instantly share code, notes, and snippets.

@valex
Created November 5, 2017 20:12
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 valex/4d789c42b4ba61c0484782105e826705 to your computer and use it in GitHub Desktop.
Save valex/4d789c42b4ba61c0484782105e826705 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<script src="http://d3js.org/d3.v4.min.js"></script>
<script src="https://d3js.org/d3-selection-multi.v1.min.js"></script>
<meta name="description" content="D3byEX 4.4" />
<meta charset="utf-8">
</head>
<body>
<script>
var data = [55, 44, 30, 23, 17, 14, 16, 25, 41, 61, 85,
101, 95, 105, 114, 150, 180, 210, 125, 100, 71,
75, 72, 67];
var maxValue = d3.max(data);
var width = 500, height = 500;
var svg = d3.select('body')
.append('svg')
.attrs({ width: width, height: height });
var scale = d3.scaleLinear()
.domain([0, maxValue])
.range([0, width]);
var axisGroup = svg.append('g');
var axis = d3.axisBottom(scale);
axisGroup.call(axis);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment