Page MenuHomePhabricator
Authored By
stwalkerster
Aug 15 2017, 7:43 PM
Size
6 KB
Referenced Files
None
Subscribers
None
<!DOCTYPE html>
<html lang="en">
<head>
<style>
.monthlyStats rect {
fill: steelblue;
}
.monthlyStats text {
fill: white;
font: 10px sans-serif;
text-anchor: end;
}
.monthlyStats g.tick text {
fill: black;
font: 10px sans-serif;
text-anchor: end;
}
</style>
</head>
<body>
<h3>Requests closed per month</h3>
<svg class="monthlyStats" width="800"></svg>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/4.10.0/d3.min.js" type="text/javascript"></script>
<script type="text/javascript">
var data = [{"month":"Unknown","closed":2899},{"month":"2008 May","closed":1821},{"month":"2008 June","closed":2529},{"month":"2008 July","closed":2481},{"month":"2008 August","closed":1182},{"month":"2008 September","closed":1395},{"month":"2008 October","closed":1362},{"month":"2008 November","closed":1074},{"month":"2008 December","closed":1382},{"month":"2009 January","closed":1146},{"month":"2009 February","closed":1373},{"month":"2009 March","closed":1541},{"month":"2009 April","closed":1437},{"month":"2009 May","closed":1234},{"month":"2009 June","closed":1171},{"month":"2009 July","closed":863},{"month":"2009 August","closed":970},{"month":"2009 September","closed":1121},{"month":"2009 October","closed":820},{"month":"2009 November","closed":679},{"month":"2009 December","closed":587},{"month":"2010 January","closed":801},{"month":"2010 February","closed":789},{"month":"2010 March","closed":942},{"month":"2010 April","closed":1108},{"month":"2010 May","closed":1000},{"month":"2010 June","closed":770},{"month":"2010 July","closed":735},{"month":"2010 August","closed":751},{"month":"2010 September","closed":930},{"month":"2010 October","closed":856},{"month":"2010 November","closed":831},{"month":"2010 December","closed":476},{"month":"2011 January","closed":652},{"month":"2011 February","closed":715},{"month":"2011 March","closed":735},{"month":"2011 April","closed":659},{"month":"2011 May","closed":705},{"month":"2011 June","closed":651},{"month":"2011 July","closed":915},{"month":"2011 August","closed":973},{"month":"2011 September","closed":891},{"month":"2011 October","closed":801},{"month":"2011 November","closed":923},{"month":"2011 December","closed":685},{"month":"2012 January","closed":854},{"month":"2012 February","closed":761},{"month":"2012 March","closed":712},{"month":"2012 April","closed":652},{"month":"2012 May","closed":647},{"month":"2012 June","closed":667},{"month":"2012 July","closed":684},{"month":"2012 August","closed":674},{"month":"2012 September","closed":788},{"month":"2012 October","closed":775},{"month":"2012 November","closed":896},{"month":"2012 December","closed":2914},{"month":"2013 January","closed":2584},{"month":"2013 February","closed":1723},{"month":"2013 March","closed":1948},{"month":"2013 April","closed":1643},{"month":"2013 May","closed":877},{"month":"2013 June","closed":1140},{"month":"2013 July","closed":1096},{"month":"2013 August","closed":1230},{"month":"2013 September","closed":992},{"month":"2013 October","closed":1254},{"month":"2013 November","closed":921},{"month":"2013 December","closed":1330},{"month":"2014 January","closed":967},{"month":"2014 February","closed":1016},{"month":"2014 March","closed":1036},{"month":"2014 April","closed":838},{"month":"2014 May","closed":610},{"month":"2014 June","closed":407},{"month":"2014 July","closed":664},{"month":"2014 August","closed":836},{"month":"2014 September","closed":982},{"month":"2014 October","closed":1038},{"month":"2014 November","closed":1002},{"month":"2014 December","closed":1105},{"month":"2015 January","closed":1375},{"month":"2015 February","closed":1406},{"month":"2015 March","closed":1147},{"month":"2015 April","closed":1909},{"month":"2015 May","closed":1101},{"month":"2015 June","closed":1456},{"month":"2015 July","closed":1161},{"month":"2015 August","closed":1266},{"month":"2015 September","closed":1804},{"month":"2015 October","closed":1910},{"month":"2015 November","closed":1692},{"month":"2015 December","closed":1477},{"month":"2016 January","closed":1494},{"month":"2016 February","closed":1431},{"month":"2016 March","closed":1445},{"month":"2016 April","closed":1365},{"month":"2016 May","closed":1885},{"month":"2016 June","closed":1673},{"month":"2016 July","closed":1477},{"month":"2016 August","closed":1135},{"month":"2016 September","closed":1296},{"month":"2016 October","closed":1434},{"month":"2016 November","closed":1348},{"month":"2016 December","closed":1697},{"month":"2017 January","closed":1139},{"month":"2017 February","closed":1858},{"month":"2017 March","closed":1652},{"month":"2017 April","closed":957},{"month":"2017 May","closed":1812},{"month":"2017 June","closed":68}];
var margin = {top: 0, right: 0, bottom: 0, left: 100};
var width = 800 - margin.left - margin.right;
var barHeight = 20;
var x = d3.scaleLinear()
.domain([0, d3.max(data, function(d) {return d.closed; })])
.range([0, width]);
var y = d3.scaleBand()
.domain(data.map(function(d) {return d.month;}))
.rangeRound([0, barHeight * data.length]);
var chart = d3.select('svg.monthlyStats');
var bar = chart.selectAll('g')
.data(data)
.enter()
.append('g')
.attr("transform", function(d, i) { console.log(d); return "translate(100," + i * barHeight + ")"; });
bar.append('rect')
.style('width', function(d) { return x(d.closed) + "px";})
.style('height', barHeight - 1);
bar.append('text')
.attr('x', function(d) { return x(d.closed) - 3; })
.attr('y', barHeight / 2)
.attr("dy", ".35em")
.text(function(d) { return d.closed; });
var chartarea = chart.attr('height', barHeight * data.length)
.attr('width', width + margin.left + margin.right)
.append('g')
.attr('transform', 'translate(' + margin.left + "," + margin.top + ")")
.call(d3.axisLeft(y));
</script>
</body>
</html>

File Metadata

Mime Type
text/plain; charset=utf-8
Storage Engine
amazon-s3
Storage Format
Raw Data
Storage Handle
phabricator/tk/4x/5kjg5cc543bldjly
Default Alt Text
(6 KB)

Event Timeline