`axisBottom.tickValues` does not respect string interval when crossing end of month boundaries
See original GitHub issueDescribe/explain the bug
I’m running into a strange issue with using intervals in tickValues
(every 3 days, every 7 days, etc). When the data moves past the end of the month, the tickValue interval is thrown off. As you can see in the screenshot, both 07/31 and 08/1 ticks are shown next to each other and does not hold up to the every 3 days interval.
To Reproduce
- Use a line chart that uses a time series for the X Axis
- Use a dataset that crosses over the end of a month (i.e. 07-29-2020 through 08-08-2020)
- Use a
tickValues
interval of “every 3 days”, “every 7 days”, etc
Reproduced in this code sandbox: https://codesandbox.io/s/brave-brown-9qd33
Expected behavior I would expect the X-Axis to understand the end of the month and continue its interval of three days (or whatever the interval is). In my example, the X-Axis would look like this:
To get around this for now, I was able to manually assign x-axis tick values: https://codesandbox.io/s/cocky-firefly-tekbg
I’ll likely just create these tick values based on my data set and then format my dates via a function in axisBottom.format
.
Desktop (please complete the following information):
- OS: MacOS Catalina 10.15.6
- Browser: Chrome
- Version: 84.0
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:6
Top GitHub Comments
Looks like an issue based on the usage of
d3.ticks
withd3.timeDay.every(n)
http://jsfiddle.net/myqhpogs/
bump
On Sun, Mar 28, 2021 at 2:48 PM stale[bot] @.***> wrote: