Skip to content

Commit

Permalink
Use .rangeBands() for bar charts to avoid extra outer padding.
Browse files Browse the repository at this point in the history
  • Loading branch information
allinurl committed Nov 22, 2016
1 parent 8007a56 commit dd68cab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions resources/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,9 @@ svg {
stroke-width: 1;
shape-rendering: crispEdges;
}
.bars rect.bar {
shape-rendering: crispEdges;
}
.rects rect {
fill: transparent;
}
Expand Down
2 changes: 1 addition & 1 deletion resources/js/charts.js
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ function BarChart(dualYaxis) {
xScale.domain(data.map(function (d) {
return d[0];
}))
.rangeRoundBands([0, innerW()], .1);
.rangeBands([0, innerW()], .1);

// Update the y-scale.
yScale0.domain([0, d3.max(data, function (d) {
Expand Down

0 comments on commit dd68cab

Please sign in to comment.