Skip to content

Instantly share code, notes, and snippets.

@averydev
Last active May 22, 2017 03:39
Show Gist options
  • Save averydev/e530218664e0fd40409b9e0d8ce44349 to your computer and use it in GitHub Desktop.
Save averydev/e530218664e0fd40409b9e0d8ce44349 to your computer and use it in GitHub Desktop.
Isometric Test
license: gpl-3.0
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
font: 10px sans-serif;
}
.axis path,
.axis line {
fill: none;
stroke: #000;
shape-rendering: crispEdges;
}
.bar {
fill: steelblue;
}
.x.axis path {
display: none;
}
</style>
<body>
<script src="//d3js.org/d3.v3.min.js"></script>
<script>
var margin = {top: 20, right: 30, bottom: 30, left: 40},
width = 960 - margin.left - margin.right,
height = 500 - margin.top - margin.bottom;
var x = d3.scale.ordinal()
.rangeRoundBands([0, width], 0.1, 0.2);
var y = d3.scale.linear()
.range([height, 0]);
var svg = d3.select("body").append("svg")
.attr("width", width + margin.left + margin.right)
.attr("height", height + margin.top + margin.bottom)
.append("g")
.attr("transform", "translate(" + margin.left + "," + margin.top + ")");
svg.append('rect')
.attr('width', 20)
.attr('height', 20)
.attr('x', 0)
.attr('y',0);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment