Commit 278b32dc authored by Vlad Dumitru's avatar Vlad Dumitru
Browse files

slant the results bar labels for better support of long answers

parent 6320110c
......@@ -15,9 +15,9 @@
{% block page-scripts %}
<script>
// set the dimensions and margins of the graph
var margin = {top: 50, right: 30, bottom: 70, left: 60},
var margin = {top: 120, right: 30, bottom: 70, left: 60},
width = 460 - margin.left - margin.right,
height = 400 - margin.top - margin.bottom;
height = 500 - margin.top - margin.bottom;
// append the svg object to the body of the page
var svg = d3.select("#my_dataviz")
......@@ -64,11 +64,12 @@
text
.enter()
.append('text')
.attr('font-size', 72)
.attr('font-size', 48)
.attr('z-index', 100)
.attr('x', function(d) { return x(d[0]) + x.bandwidth() / 2; })
.attr('x', function(d) { return x(d[0]); })
.attr('y', function(d) { return y(d[1]) + 24; })
.attr('text-anchor', 'middle')
.attr('text-anchor', 'start')
.attr('transform', function(d) { return `rotate(-45, ${x(d[0]) + x.bandwidth() / 2}, ${y(d[1]) + 24})`})
.text(function (d) { return d[0]; })
</script>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment