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

When values are only 1 and 0 in callback - strange middle values are being included #5079

Closed
mkantautas opened this issue Dec 25, 2017 · 2 comments

Comments

@mkantautas
Copy link

https://codepen.io/anon/pen/MrbRBw?editors=1010 <-- this demo illustrates my problem

So I have multiple graphs and using one graph as a parent graph for inheriting the same patterns. And one thing that differs from all the graphs are the Y axis custom values. On some I want to return custom values and on some the original ones. With the custom one everything works as expected, but with the original ones on occasion when I only have 0 and 1 values I get some bizarre middle values, which are not there and ofc I don't want to display them.

Expected Behavior

Well I should only see 0 and 1 values or at least tell me how to achieve this?

Current Behavior

The opposite

Environment

  • Chart.js version: 2.7
  • Browser name and version: Newest Ubuntu chrome
@mkantautas
Copy link
Author

   if (Math.floor(data) === data) {
                        return data;
                    }

Was what I was looking for - case closed !

@simonbrunel
Copy link
Member

simonbrunel commented Dec 25, 2017

@neorganic looks like this is fixed by #4943 and will be shipped in the next release (duplicates #4928)

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

2 participants