-
Notifications
You must be signed in to change notification settings - Fork 21
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
Add support for an inView callbaack #20
Comments
As soon as the new version releases for chart.js V3 you can use the The initial prop only gets set to true when the chart scolls in to vieuw: options: {
animation: {
onComplete: (ctx) => {
if (!ctx.initial) {
return;
}
console.log('Chart in view')
}
}
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have a need to be able to set a state var once the chart is in view and the animation has started. Unfortunately I cannot rely solely on the events from the chart, I am using
onComplete
, but in adding this plugin,onComplete
is immediately fired on startup, even if the chart isn't in view, which causes problems for me. I have yet to determine whyonComplete
is firing. Long story short, it would be helpful to have a callback/event likeinView
that fires once the chart scrolls into view. This would allow me to ignore theonComplete
events until after this callback event happens.The text was updated successfully, but these errors were encountered: