Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Duplicate of this PR. I made this PR to also have this fix available in v2.x. Hope this is the correct way!
Description
The entry value for an error bar receives the default value
0
in case it was null. This would cause the domain to be calculated incorrectly, as0
may not be a value in the data array.When using error bars, the domain accounts for any potential in the error values. Error values are expressed relative to the main entry value. In case the main entry value is nullish, its default value would be
0
. This may not be a value in the actual data.Related Issue
No known related issues yet
Motivation and Context
Given this example data:
The min value of the y-axis domain would be:
[min(y - errorY[0]), max(y + errorY[1])] = [200 - 10, 400 + 10] = [190, 410]
Now consider this other example:
The current implementation would report:
[min(y - errorY[0]), max(y + errorY[1])] = [0 - 10, 400 + 10] = [-10, 410]
While the expected behaviour is:
[min(y - errorY[0]), max(y + errorY[1])] = [200 - 10, 400 + 10] = [190, 410]
Some codesandbox examples can be found here.
How Has This Been Tested?
I have added unit tests for the domain creation.
Types of changes
Checklist: