Skip to content

Commit

Permalink
fixed bar colouring
Browse files Browse the repository at this point in the history
  • Loading branch information
jalperin committed Jul 20, 2018
1 parent b125b01 commit 3968bf3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion paperbuzzviz.js
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,10 @@ function PaperbuzzViz(options) {

bars
.enter().append("rect")
.attr("class", function(d) { return "paperbuzz-bar " + viz.z((level == 'day' ? d3.timeWeek(getDate(level, d)) : d.year)); })
.attr("class", function(d) {
var bartype = (level == 'day' ? d3.timeWeek(getDate(level, d)) : getDate(level, d).getFullYear());
return "paperbuzz-bar " + viz.z(bartype);
})
.attr("x", function(d) { return viz.x(getDate(level, d)) + 2; }) // padding of 2, 1 each
.attr("y", function(d) { return viz.y(d.count) } )
.attr("width", barWidth)
Expand Down

0 comments on commit 3968bf3

Please sign in to comment.