-
Notifications
You must be signed in to change notification settings - Fork 329
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
Hide/Show annotations? #95
Comments
I am looking for the same thing |
Not currently. If you'd like to take a crack at it, we'll entertain a PR! Thanks! |
I might take a look at doing a PR at some point. Any guidance? I've taken a look at the chartjs-plugin-datalabels project which uses a Just having trouble envisioning how I might apply the same to this project Hopefully when I take a deeper look later it might become more apparent to me |
@Techn1x @corentingi I'm going to make a pull request for this. But for now, you can make following changes. First, add a new option called "display" into default options: Then add "canHide" option to check them individually: So if you add "canHide: true" into your annotation and if you leave "display: false", then these annotations will not be visible. How can you enable/disable visibility of the annotations? Just enable "display" option by setting it to "display: true/false" and then update your chart. Like in example:
That's it :) |
will this be in the next release? |
Thanks for this plugin! However, I'm also interested in this feature. |
Is this implemented in plugin? Can I show / hide annotations? |
Inspired by @yusufozturk I've added a PR that adds this feature #141 It's a bit more advanced in that it can be dynamically changed updated after initial draw of annotations. It also uses Hiding an annotation simply just renders it invisible (this way event hooks still work, so you can mouse in/out etc.) Perhaps a later PR could be to include Took me a year to get it done but oh well :) |
It looks like this got close to being completed, but didn't get over the line. @Techn1x Any chance it could be completed? |
|
Any ETA on the implementation? |
try to set the value to a value out of the axis:
|
I was trying to do this in in React.
|
@joshfleming seeing the annotation configuration you posted, I have the feeling you are not using the version 1.x (or master) where |
Closing since this is implemented in v1.0.0-beta.4 https://jsfiddle.net/892t1r03/ |
Hi, is there any way to hide & show the individual annotations with a property? (Rather than removing the object from the
annotations
array?)For example, Chart.JS allows you to define a
display
: true/false/callback on things like the legendThanks!
The text was updated successfully, but these errors were encountered: