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

Orientation 'right' not working with dates #2251

Closed
matejfalat opened this issue May 23, 2022 · 4 comments · Fixed by #2642
Closed

Orientation 'right' not working with dates #2251

matejfalat opened this issue May 23, 2022 · 4 comments · Fixed by #2642

Comments

@matejfalat
Copy link

The Problem

Setting orientation = "right" doesn't seem to work properly when values are date objects. Tick labels are moved to the right, but the axis remains on the left.

Reproduction

https://codesandbox.io/s/interesting-nova-q14s3v?file=/index.js

@zfrankdesign
Copy link

zfrankdesign commented Jun 16, 2023

I think I am having a similar issue 😬 If I add enough padding on the right side things work, but that's not ideal. Also if I add left padding to the chart (having issue with x axis label getting rendered off the left of the chart x axis) sometimes the y axis gets rendered on the left side again...

@zfrankdesign
Copy link

The Problem

Setting orientation = "right" doesn't seem to work properly when values are date objects. Tick labels are moved to the right, but the axis remains on the left.

Reproduction

https://codesandbox.io/s/interesting-nova-q14s3v?file=/index.js

@matejfalat I seemed to get my padding and y axis orientation (on the right) problems working by converting the date values in my data to numbers i.e. new Date(date).setHours(0, 0, 0, 0) no clue why this works, but it seems to stop my y axis from rendering on the left

@scottarver
Copy link
Contributor

Here is a fork of the codesandbox that shows it working and not working if you comment line 20

https://codesandbox.io/s/sleepy-orla-qjq68f?file=/index.js

@scottarver
Copy link
Contributor

scottarver commented Aug 28, 2023

I've got it narrowed down to a Date equality bug.

origin.x === domain.x[0] || origin.x === domain.x[1]

image
image

Before After
image image

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 a pull request may close this issue.

3 participants