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

Bar Chart on a monthly times scale #7991

Closed
correaricardo opened this issue Nov 1, 2020 · 2 comments · Fixed by #8560
Closed

Bar Chart on a monthly times scale #7991

correaricardo opened this issue Nov 1, 2020 · 2 comments · Fixed by #8560

Comments

@correaricardo
Copy link

When I use the multiple bar chart with monthly time scale in x-axis, some datasets in first and last position are cropped

Expected Behavior

Draw the chart correctly and show the current month in labels section

Current Behavior

Some datasets in first and last position are cropped and the current month is not shown in labels section

image

Possible Solution

I don't know.

I tried setting the offset flag as true, but only works if I set the time scale unit as day

image

I tried setting the scale bounds as ticks, but the bars look too thin

image

Steps to Reproduce

https://codesandbox.io/s/compassionate-dijkstra-dje3k?file=/src/App.js

Context

Environment

  • Chart.js version: 2.9.4
  • Browser name and version: Chrome 86
@correaricardo
Copy link
Author

I fixed it with a workaround. I wrote a function that check if all data have the same month and year and set unit time to: day, otherwise set unit time to: month.

@etimberg
Copy link
Member

etimberg commented Nov 1, 2020

@correaricardo I think that work around also works for #7992

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants