fix(xy): use round ticks on linear bar charts#1435
Closed
markov00 wants to merge 9 commits intoelastic:masterfrom
Closed
fix(xy): use round ticks on linear bar charts#1435markov00 wants to merge 9 commits intoelastic:masterfrom
markov00 wants to merge 9 commits intoelastic:masterfrom
Conversation
On linear scale for bar charts, we manually compute the ticks, instead of using the tick function. The commit change that behaviour using the right rounded ticks instead
Replace linear x scale with ordinal one when necessary. Apply UTC timezone where using time scale
rshen91
approved these changes
Oct 21, 2021
Contributor
rshen91
left a comment
There was a problem hiding this comment.
LGTM - tested locally and saw no issues. Nice use of isXDomain hahaha
Contributor
This was referenced Apr 12, 2022
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.







Summary
This PR changes the way the X-axis is rendered in linear bar charts.
Instead of computing the ticks as
I've converted this code to use the standard
d3.scale.ticksinstead.This causes a lot of failures in the VRTs because a lot of bar chart uses the Linear scale on the x axis (that should be discouraged if not used in association with the histogram mode or with a controlled number of ticks)
The changes at the screenshot levels are also due to the reverting nature to ordinal scale in the X axis of bar chart and the subsequent removal of the legend extra parameter.
As discussed also with @monfera a bar chart can use the linear scale on the x scale, but its use slightly distorts the nature of the reading: in this case, the bar is only an adornment of a Y value and its width doesn't represent any more an interval in the x scale unless you use the histogram mode that correctly aligns the ticks at the beginning and end of the bar interval.
Checklist
:xy,:partition):interactions,:axis)closes #123,fixes #123)dark,light,eui-dark&eui-light