Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

row chart title label needs dy offset #941

Closed
wojdyr opened this issue Jun 3, 2015 · 5 comments
Closed

row chart title label needs dy offset #941

wojdyr opened this issue Jun 3, 2015 · 5 comments
Labels
Milestone

Comments

@wojdyr
Copy link

wojdyr commented Jun 3, 2015

rowChart with renderTitleLabel(true) has vertically misaligned title labels:
rowchart

Both labels and titles have the same y, but labels have also dy.
Adding dy to titles fixes the problem.

diff --git a/src/row-chart.js b/src/row-chart.js
index d7a16de..347ae7a 100644
--- a/src/row-chart.js
+++ b/src/row-chart.js
@@ -241,6 +241,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) {
@gordonwoodhull
Copy link
Contributor

This looks like a reasonable fix. The _dyOffset fix for titles is relatively new and it just needs to be applied to labels as well.

@gordonwoodhull gordonwoodhull added this to the v2.0 milestone Jun 3, 2015
@gordonwoodhull
Copy link
Contributor

Thanks @wojdyr!

@adrm
Copy link
Contributor

adrm commented Apr 12, 2016

@gordonwoodhull Is this patch to be applied soon? I can submit the pull request with @wojdyr 's patch if he is not able to do it now.

@gordonwoodhull
Copy link
Contributor

Yes, please do. There is a lot to keep track of in this project, and all pull requests help, even small ones. Thanks!

@gordonwoodhull
Copy link
Contributor

Fixed in 2.0 beta 28. Thanks @adrm!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants