-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
NaN string displayed when clicking on legend to hide a horizontal bar chart with Y-axis labels as strings #4216
Comments
@singhrasster do you have a test case that reproduces this? |
Yes, so I have a horizontalBar chart where I have 2 categories of bars ( horizontal). The Y-axis labels are strings whereas the X-axis labels are numbers. Since there are two bars, there are two legends created. I click on each legend to hide the corresponding bar. When both bars are hidden (after clicking on the two legends), I see NaN on the top left of the X-axis. There can be any number of categories of horiontal bars, say N. Whenever all N bars are hidden by clicking on all the corresponding N legends, the string NaN gets displayed left to the Y-axis. I don't have anything setup online to show exactly. But, on some google search, I came across someone's fiddle where there is a horizontal bar. In that you can click on the Green legend left to the text "Test" to hide the bar. The bar is hidden but then you will see a text 'NaN' displayed to the left of the Y-axis. |
Looks like something goes wrong when there is no data, and the text that shows up should have been on the x axis. Definitely a bug that needs to be fixed |
@etimberg Is this issue fixed now? If yes, how can I use it? Do I need to update my chart.js library to a newer version? Currently I am using "chart.js": "2.5.0", in my package.json |
@singhrasster this is not yet fixed |
I have a horizontal bar chart. And my X-axis labels are numbers whereas the Y-axis labels are strings. when I click on the legend to hide the bar chart, the chart is hidden, however I see a string NaN on the top left of the Y-axis. Is it a bug? What is the fix for this?
The text was updated successfully, but these errors were encountered: