Skip to content

MultiChart X-axis scale fix#1881

Open
frozenshadow wants to merge 1 commit intonovus:masterfrom
frozenshadow:multichart_x-axis_scale_fix
Open

MultiChart X-axis scale fix#1881
frozenshadow wants to merge 1 commit intonovus:masterfrom
frozenshadow:multichart_x-axis_scale_fix

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