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

Show a bar for Zero results in a Morris.bar #744

Open
SamFraser2007 opened this issue Jan 5, 2018 · 2 comments
Open

Show a bar for Zero results in a Morris.bar #744

SamFraser2007 opened this issue Jan 5, 2018 · 2 comments

Comments

@SamFraser2007
Copy link

Id like to show a bar for zero results in my bar chart, is there a way to do this?
I asked the question on stack overflow but only got one response, recommending a different library that will do this:
https://stackoverflow.com/questions/48097827/show-a-bar-for-zero-results-with-morris-js/48112328?noredirect=1#comment83204405_48112328

Heres a fiddle:
https://jsfiddle.net/beaver71/zm8wt4pj/

I think this would be a nice feature for morris!

@pierresh
Copy link

pierresh commented Jan 6, 2018

That is a good idea, I just wrote a solution in Stackoverflow:

If you compile from coffee script files, just add after lastTop += size in morris.bar.coffee

if size == 0 then size = 1

Otherwise just add after lastTop += size; in morris.js:

if (size === 0) { size = 1; }

pierresh pushed a commit to pierresh/morris.js that referenced this issue Jan 6, 2018
@SamFraser2007
Copy link
Author

SamFraser2007 commented Jan 8, 2018 via email

pierresh added a commit to pierresh/morris.js that referenced this issue Jan 15, 2018
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

2 participants