diff --git a/spec/row-chart-spec.js b/spec/row-chart-spec.js index 687e99082..e2f538a4d 100644 --- a/spec/row-chart-spec.js +++ b/spec/row-chart-spec.js @@ -75,6 +75,22 @@ describe('dc.rowChart', function () { }); }); + describe('with renderTitleLabel', function () { + beforeEach(function () { + chart.group(positiveGroupHolder.group); + chart.x(d3.scale.linear()); + chart.title(function () { + return 'test title'; + }); + chart.renderTitleLabel(true); + chart.render(); + }); + + it('should render title label centered', function () { + expect(chart.select('g.row .titlerow').attr('dy')).toBeDefined(); + }); + }); + function itShouldBehaveLikeARowChartWithGroup (groupHolder, N) { describe('for ' + groupHolder.groupType + ' data', function () { beforeEach(function () { @@ -344,4 +360,3 @@ describe('dc.rowChart', function () { itShouldBehaveLikeARowChartWithGroup(mixedGroupHolder, 5); itShouldBehaveLikeARowChartWithGroup(largerGroupHolder, 7); }); - diff --git a/src/row-chart.js b/src/row-chart.js index 699338e43..a70605f16 100644 --- a/src/row-chart.js +++ b/src/row-chart.js @@ -242,6 +242,7 @@ dc.rowChart = function (parent, chartGroup) { var titlelab = rows.select('.' + _titleRowCssClass) .attr('x', _chart.effectiveWidth() - _titleLabelOffsetX) .attr('y', _labelOffsetY) + .attr('dy', _dyOffset) .attr('text-anchor', 'end') .on('click', onClick) .attr('class', function (d, i) {