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

fix(axis): misaligned axis with rotated histogram #805

Merged
merged 3 commits into from
Sep 5, 2020

Conversation

nickofthyme
Copy link
Collaborator

@nickofthyme nickofthyme commented Sep 5, 2020

Summary

Fix #800

This PR provides a low risk fix to the misaligned axis for rotated histogram bar charts.

Added vrt to validate this change in the future

A future fix should be done to fix this at the root cause.

After screenshots

image

image

Screen Recording 2020-09-05 at 12 11 PM

Checklist

  • Any consumer-facing exports were added to src/index.ts (and stories only import from ../src except for test data & storybook)
  • This was checked for cross-browser compatibility
  • Proper documentation or storybook story was added for features that require explanation or tutorials
  • Unit tests were updated or added to match the most common scenarios

@nickofthyme nickofthyme added bug Something isn't working :axis Axis related issue :xy Bar/Line/Area chart related labels Sep 5, 2020
@codecov-commenter
Copy link

Codecov Report

Merging #805 into master will decrease coverage by 0.00%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #805      +/-   ##
==========================================
- Coverage   74.36%   74.35%   -0.01%     
==========================================
  Files         273      273              
  Lines        9318     9323       +5     
  Branches     2007     2011       +4     
==========================================
+ Hits         6929     6932       +3     
- Misses       2382     2383       +1     
- Partials        7        8       +1     
Flag Coverage Δ
#unittests 74.35% <66.66%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/scales/index.ts 100.00% <ø> (ø)
src/chart_types/xy_chart/utils/axis_utils.ts 92.44% <60.00%> (-0.50%) ⬇️
src/scales/scale_continuous.ts 97.90% <100.00%> (+0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6d0319f...f1ffdfe. Read the comment docs.

@nickofthyme
Copy link
Collaborator Author

nickofthyme commented Sep 5, 2020

Confirmed correct alignment by overlaying 0 degree with 180 and 90 degree with -90. Ticks match perfectly with these changes.

Bottom axis

image

Left axis

image

@nickofthyme nickofthyme merged commit 6c454e1 into elastic:master Sep 5, 2020
markov00 pushed a commit that referenced this pull request Sep 6, 2020
# [21.1.0](v21.0.1...v21.1.0) (2020-09-06)

### Bug Fixes

* **axis:** misaligned axis with rotated histogram bar charts ([#805](#805)) ([6c454e1](6c454e1))

### Features

* **brush:** histogram brushing last values and rounding ([#801](#801)) ([6d0319f](6d0319f))
* **tooltip:** series tick formatters ([#802](#802)) ([fbcd92e](fbcd92e))
@markov00
Copy link
Member

markov00 commented Sep 6, 2020

🎉 This PR is included in version 21.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@markov00 markov00 added the released Issue released publicly label Sep 6, 2020
@nickofthyme nickofthyme deleted the fix/histogram-axis branch January 25, 2021 15:14
AMoo-Miki pushed a commit to AMoo-Miki/OpenSearch-Dashboards that referenced this pull request Feb 10, 2022
# [21.1.0](elastic/elastic-charts@v21.0.1...v21.1.0) (2020-09-06)

### Bug Fixes

* **axis:** misaligned axis with rotated histogram bar charts ([opensearch-project#805](elastic/elastic-charts#805)) ([a52a692](elastic/elastic-charts@a52a692))

### Features

* **brush:** histogram brushing last values and rounding ([opensearch-project#801](elastic/elastic-charts#801)) ([867abbc](elastic/elastic-charts@867abbc))
* **tooltip:** series tick formatters ([opensearch-project#802](elastic/elastic-charts#802)) ([813b915](elastic/elastic-charts@813b915))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:axis Axis related issue bug Something isn't working released Issue released publicly :xy Bar/Line/Area chart related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Axis misaligned with -90 or 180 degree rotation histogram
3 participants