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

Datalabel doesn't dissapear after hiding bar chart by clicking legend label #77

Closed
mukhammad-akilov opened this issue Aug 2, 2018 · 2 comments

Comments

@mukhammad-akilov
Copy link

Browser version: Google Chrome 68
OS version: Windows 10
Charjs version: 2.7.2
Chartjs plugin datalabels version: 0.3.0
CodePen link

Issues describe:
After clicking legend label for disappearing bar chart datalabel does not dissapear but bar chart dissapears normally.

screenshot1

Also there is another issue.
Datalabel goes beyond schedule

screenshot2

Can I make it so that the datalabel has moved to the body of the bar chart if the datalabel goes beyond schedule?

@simonbrunel
Copy link
Member

@Ghost180195 this issue has already been reported in #51 and fixed in v0.4.0 released today (fiddle)

Can I make it so that the datalabel has moved to the body of the bar chart...

No built-in solution. You could write a scriptable option for align that checks if your value is below a certain threshold, but that doesn't scale very well. I'm planning to introduce a new constrain option that will make sure the label stays inside the chart area but it's definitely not ready. If you think of another API that could help to fix this case, please open a new "feature" ticket describing exactly the behavior you are expecting so we can discuss about it.

I'm closing this tickets as duplicate of #51

@mukhammad-akilov
Copy link
Author

Thanks for you answer.
I have a question. How can i get suggestedMax number s(for example in the image it is 4000 for legend2 and it is 400 fro legend1)?

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