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

max is not working properly in time scale v2.7.0 #4758

Closed
DurgpalSingh opened this issue Sep 14, 2017 · 8 comments
Closed

max is not working properly in time scale v2.7.0 #4758

DurgpalSingh opened this issue Sep 14, 2017 · 8 comments

Comments

@DurgpalSingh
Copy link

DurgpalSingh commented Sep 14, 2017

Current Behavior

I set max value in time scale it working fine when dataset has 2 and more values otherwise behaviour unexpected.
Why it is behaving like this.

Steps to Reproduce (for bugs)

Dataset with 2 and more values

https://jsfiddle.net/657fxL8r/7/

Dataset with 1 value.

https://jsfiddle.net/657fxL8r/8/

Environment

  • Chart.js 2.7.0:
@DurgpalSingh DurgpalSingh changed the title max is not working properly in time scale max is not working properly in time scale v2.7.0 Sep 14, 2017
@etimberg
Copy link
Member

I think this is related to source: 'labels'. CC @simonbrunel @benmccann for a better answer

@benmccann
Copy link
Contributor

I believe source: 'labels' was the default in 2.6.0, so if it is related to that it's unlikely to be a new issue

@benmccann
Copy link
Contributor

benmccann commented Sep 15, 2017

What is the behavior you expect here?

@DurgpalSingh
Copy link
Author

DurgpalSingh commented Sep 15, 2017

@benmccann I know labels is not beyond with max but ticks is dependent on max. In second fiddle when I have only one dataset ticks is not depending on max. I am expecting when I set max to one year and unit : 'month' then ticks should be 12 and bar will show only one tick that is not happening here when I have only one dataset. See the difference of both fiddle.

@benmccann
Copy link
Contributor

will show only one tick that is not happening here

I'm not understanding your explanation of what you expect the behavior to be. When I click https://jsfiddle.net/657fxL8r/8/ I see only one tick

@DurgpalSingh
Copy link
Author

DurgpalSingh commented Sep 18, 2017

@benmccann this fiddle https://jsfiddle.net/657fxL8r/8/ showing one one tick its right but bar width is not correct. See another fiddle https://jsfiddle.net/657fxL8r/7/ Here bar width is right.
I want bar width same as fiddle2. I know I can set bar width with bar Thickness but I want to set auto when i set max value is year.

@benmccann
Copy link
Contributor

benmccann commented Sep 18, 2017

Yes, I agree that it is strange that the bar is off-center

I believe @nagix was working on a solution for that

@DurgpalSingh
Copy link
Author

Any solution

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

No branches or pull requests

3 participants