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

Responsive X-Axis #856

Closed
wants to merge 3 commits into from
Closed

Responsive X-Axis #856

wants to merge 3 commits into from

Conversation

robhardwick
Copy link
Contributor

I'm trying to use the dc.js line chart in a context where the chart can be resized by the user. This seems to be working well when the chart width is updated but when the height is changed the x-axis doesn't have its y position updated.

I've created a JSFiddle where you can see the problem (just click "Update"):

http://jsfiddle.net/bsbwjepf/

Looking at the code, the issue seems to be on lines 417-421 of coordinate-grid-mixin.js. The x-axis is only translated to the correct position on the first render and not during a redraw (which is what I'm looking for).

I'm happy to submit a pull-request to change this behaviour but would appreciate confirmation that this is a real bug and I'm not just missing something.

@gordonwoodhull
Copy link
Contributor

A PR would be great. This was previously filed as #544, but this is somewhat more specific.

@robhardwick
Copy link
Contributor Author

Not sure why the tests have failed, any ideas?

@robhardwick
Copy link
Contributor Author

It looks like the tests were broken by the upgrade from grunt-contrib-jasmine v0.7.0 to v0.8.1 in commit d467386. If I revert the package to the old version and run the tests locally they all pass.

I can add this to my pull request if that makes it easier but maybe you would prefer to deal with it yourself? I'm still not sure why the upgrade to jasmine seems to be breaking date comparisons.

@gordonwoodhull
Copy link
Contributor

It's okay, we'll fix the tests rather than reverting Jasmine. There is a certain amount of churn simply because of updates to dependencies. Don't worry about it.

@gordonwoodhull gordonwoodhull added this to the v2.0 milestone May 24, 2015
@gordonwoodhull
Copy link
Contributor

Hmm, this causes the axis to transition in from the top of the chart at first render, kind of extravagant. I'll figure out how to fix that.

gordonwoodhull added a commit that referenced this pull request Aug 5, 2015
on redraw:
* resize svg
* reposition axis labels
* reposition y axis

also set transforms on initial render, so as not to have extravagant
intro animations, for #856
gordonwoodhull added a commit that referenced this pull request Aug 5, 2015
@gordonwoodhull
Copy link
Contributor

Merged in 2.0 beta 15, with some other fixes for resizing charts. Thanks @robhardwick !

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

Successfully merging this pull request may close these issues.

2 participants