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

MultiChart X-axis scale fix #1881

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

MultiChart X-axis scale fix #1881

wants to merge 1 commit into from

Conversation

frozenshadow
Copy link

X-axis scale fix for issue #1662

.range([0, availableWidth]);
var ex = d3.extent(d3.merge(series1.concat(series2)), function(d) { return d.x }); // Allow extent to be used multiple times
for(var i = 0; i < charts.length; i++){ // Loop through all charts except bars1 and bars2 (because it's ordinal)
if(!(i === 4 || i === 5)){ charts[i].xDomain(ex); } // Set xDomain for each chart individually
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of using the index, this should be checking if the charts are ordinal... otherwise someone adding/changing that array of charts will break this in a non-obvious way.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the response.
Sounds like you've got a good point there. I will look into it later.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@liquidpele
I'm truly sorry for this late reply.
It has been quite a long time since I have seen and touched this code. And unfortunately I don't really understand what you mean. Do you mean the for loop?

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