Skip to content

Commit

Permalink
Fixing up row chart x axis label
Browse files Browse the repository at this point in the history
  • Loading branch information
ruhley committed Oct 27, 2015
1 parent c9f4690 commit a8d72ae
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 28 deletions.
12 changes: 6 additions & 6 deletions dc.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dc.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dc.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dc.min.js.map

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions src/row-chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
dc.rowChart = function (parent, chartGroup) {

var X_AXIS_LABEL_CLASS = 'x-axis-label';
var DEFAULT_AXIS_LABEL_PADDING = 30;
var DEFAULT_AXIS_LABEL_PADDING = 12;

var _g;

Expand Down Expand Up @@ -90,18 +90,18 @@ dc.rowChart = function (parent, chartGroup) {
dc.transition(axisG, _chart.transitionDuration())
.call(_xAxis);

renderXAxisLabel(axisG);
renderXAxisLabel();
}

function renderXAxisLabel (g) {
var axisXLab = g.selectAll('text.' + X_AXIS_LABEL_CLASS);
function renderXAxisLabel () {
var axisXLab = _g.selectAll('text.' + X_AXIS_LABEL_CLASS);

if (axisXLab.empty() && _chart.xAxisLabel()) {
axisXLab = g.append('text')
axisXLab = _g.append('text')
.attr('class', X_AXIS_LABEL_CLASS)
.attr('transform',
'translate(' + (_chart.margins().left + _chart.xAxisLength() / 2) +
',' + _xAxisLabelPadding + ')'
',' + (_chart.height() - _xAxisLabelPadding) + ')'
)
.attr('text-anchor', 'middle');
}
Expand Down
20 changes: 10 additions & 10 deletions web/js/dc.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion web/js/dc.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion web/js/dc.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion web/js/dc.min.js.map

Large diffs are not rendered by default.

0 comments on commit a8d72ae

Please sign in to comment.