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

Integer Y-labels #221

Open
oesmith opened this issue Apr 14, 2013 · 17 comments
Open

Integer Y-labels #221

oesmith opened this issue Apr 14, 2013 · 17 comments

Comments

@oesmith
Copy link
Contributor

oesmith commented Apr 14, 2013

Continued from #162.

Sometimes it doesn't make much sense to display decimal labels when the data types are all integers. There should be a way to force Y-axis labels to be all integers.

@t3chn0r
Copy link

t3chn0r commented Oct 31, 2013

👍

2 similar comments
@javicrespo
Copy link

👍

@thefotolander
Copy link

👍

@t3chn0r
Copy link

t3chn0r commented Dec 16, 2013

Hello @oesmith, any update on this one? Regards

@chilipepper987
Copy link

I would like this too! Any update?

@sudodoki
Copy link
Contributor

Guys, be sure to see #340. There might be no updates if you don't contribute back. 😿

@t3chn0r
Copy link

t3chn0r commented Dec 21, 2013

Hello @sudodoki, I will take a shot at implementing this then and see how it goes... I will take a look at it tomorrow and ask people to test it.

@t3chn0r
Copy link

t3chn0r commented Dec 21, 2013

Please have a look at PR #341... Will appreciate people willing to test the PR and send feedback.

@jenssegers
Copy link

👍

@prionkor
Copy link

👍 for this. I hope this will fix soon :)

@rgravina
Copy link

👍 This would be great too! It's useful for things like counts of users/people etc. that should be integers.

@rgravina
Copy link

I've found that this workaround works for me for the time being. Passing into the constructor:

yLabelFormat: (y) -> if y != Math.round(y) then '' else y

This will null out any column values which would be decimal, so for e.g. a range of 0 - 30, with a default numSteps of 5, it would render like this.
screen shot 2014-07-22 at 4 05 22 pm

Although, it seems now like there's a PR to implement it which works: #344

@GC-Mark
Copy link

GC-Mark commented Oct 9, 2014

Any updates on this?

@DeleTaylor
Copy link

Hey @rgravina, thanks for your workaround. It looks great in my app.

Here's the actual code I used:

new Morris.Bar({
  ...
  yLabelFormat: function(y){return y != Math.round(y)?'':y;},
  ...
});

@ajsumalbag14
Copy link

Any update on this? Or is there a new version already created? please link me. Thank you.

@frankhdz
Copy link

I am interested in this as well. Any updates?

@marcomorain
Copy link

👍

pierresh pushed a commit to pierresh/morris.js that referenced this issue Feb 26, 2020
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

No branches or pull requests