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
BarChart error: invalid data range; cannot be zero #62
Comments
I fixed this problem by rewriting code like this:
|
in bar_chart.go |
Hey @lovermaker. Thanks for this. I'd be interested in seeing that merged. Would you be able to open A PR? |
Faced this problem too and used the implementation of @lovermaker, works like a charm. I guess this should be merged soon. |
This Also worked for me, can someone merge this ? |
For anyone unable to add a fork that has the fix proposed above, here is a workaround that can be added to your package that consumes go-chart.
Hopefully this ticket gets some attention. It has been a long standing issue and has a simple fix. |
When I get one value or a series of same value, and draw a BarChart, I will get an error 'invalid data range; cannot be zero'.
Finally, I found the reason.
In the function
getRanges
,when one value or a series of same valuebc.Bars,min and max is same all the time. As a result, program will throw an error 'invalid data range; cannot be zero'.The text was updated successfully, but these errors were encountered: