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

Error bar domain fix #2863

Merged
merged 2 commits into from Jul 26, 2022
Merged

Conversation

lukask-proxora
Copy link
Contributor

Fixes #2811

The basic idea of the fix is to use the layout of the parent component of the ErrorBar component in order to determine which axis domain the error bar should impact.

Before, this was determined by this code:
_.isNil(direction) || _.isNil(axisType) ? true : axisType.indexOf(direction) >= 0
For direction 'x' however, both 'yAxis' and 'xAxis' contain 'x' and therefore both domains were impacted by the error bar.
Also, if the direction was not set, the error bar always had an impact on both axis domains.

In this fix, the logic if an error bar impacts the domain of an axis was extracted to a separate function for better readability and to give it an explicite name.

@arcthur arcthur merged commit 4ac9a2d into recharts:master Jul 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ErrorBar in LineChart changes XAxis domain 'dataMin' and 'dataMax'
2 participants