Skip to content

Commit

Permalink
Fix horizontal axis clip - #211
Browse files Browse the repository at this point in the history
  • Loading branch information
masayuki0812 committed May 7, 2014
1 parent e796a16 commit 6d670cc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions c3.js
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,8 @@
return +d3.select(__bindto).style('height').replace('px', ''); // TODO: if rotated, use width
}
function getAxisClipX(forHorizontal) {
return forHorizontal ? -(1 + 4) : -(margin.left - 1);
// axis line width + padding for left
return forHorizontal ? -(1 + 30) : -(margin.left - 1);
}
function getAxisClipY(forHorizontal) {
return forHorizontal ? -20 : -4;
Expand All @@ -561,7 +562,8 @@
return getAxisClipY(__axis_rotated);
}
function getAxisClipWidth(forHorizontal) {
return forHorizontal ? width + 2 + 4 : margin.left + 20;
// width + axis line width + padding for left/right
return forHorizontal ? width + 2 + 30 + 30 : margin.left + 20;
}
function getAxisClipHeight(forHorizontal) {
return forHorizontal ? (__axis_x_height ? __axis_x_height : 0) + 80 : height + 8;
Expand Down
Loading

0 comments on commit 6d670cc

Please sign in to comment.