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

add alignment prop for domain start and end label to keep within chart footprint #264

Merged
merged 5 commits into from
Jul 9, 2020

Conversation

scottsheffield
Copy link
Contributor

@scottsheffield scottsheffield commented Jul 8, 2020

This is functionally to make this visual difference, keeping both the spacing calculation and visual treatment of the first and potentially last labels rest with alignment setting them within the footprint of the chart.

Check out the normal x axis label alignment: centered under the point

Screen Shot 2020-07-08 at 4 52 24 PM

With noLabelOverhang first and last labels (being both the min and max of the charted width) aligning to fall within the vertical footprint of the chart.

Screen Shot 2020-07-08 at 4 52 31 PM

* overhang where the first and possibly last labels' text hangs over the edges of the x axis range.
* Setting this to `true` will force the first and last labels to align in such a way that their text does
* not exceed the x range. That is, the first label will be text-anchor: "start" instead of "middle", and
* the label marking the right edge of the chart will be anchored to the "end" instead of "middle".
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great explanation!

@acmei acmei merged commit 96aa198 into spotify:master Jul 9, 2020
@scottsheffield scottsheffield deleted the time-paradox branch July 9, 2020 19:35
acmei added a commit that referenced this pull request Dec 10, 2020
* 'gh-pages' of github.com:spotify/reactochart: (45 commits)
  Gh pages v3.2.1 (#272)
  Gh pages v3.2.0 (#270)
  Update docs v3.1
  v3.1.0 release
  Update CHANGELOG.md
  3.1.0
  add alignment prop for domain start and end label to keep within chart footprint (#264)
  Gh pages v3.0.3 (#261)
  v3.0.3 release
  3.0.3
  Fix issue with RangeBarChart test (#260)
  Generate docs and add tests for onClick handler (#258)
  allow for onclick event handlers (#257)
  Update sinon to the latest version 🚀 (#235)
  Greenkeeper/husky 4.2.3 (#239)
  chore(package): update raw-loader to version 4.0.0 (#197)
  Greenkeeper/react docgen 5.1.0 (#233)
  v3.0.2 release
  3.0.2
  Remove deprecated Lifecycle hooks (#234)
  ...
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.

2 participants