Box Annotation coordinates #775
afshinmoshrefi
started this conversation in
General
Replies: 1 comment 11 replies
-
@afshinmoshrefi all annotations can have some events hooks (see doc https://www.chartjs.org/chartjs-plugin-annotation/latest/guide/configuration.html#events). In your use case, it could be enough to set the plugins: {
annotation: {
annotations: {
myBox: {
type: 'box',
...
enter(context, event) {
// cursor hover the annotation
}
}
}
}
} |
Beta Was this translation helpful? Give feedback.
11 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a box annotation drawn on a line chart.
I have an event handler that needs to know when the cursor is inside the annotation box.
To accomplish this, I need to calculate the screen coordinates of the box annotation.
How can I calculate the screen location of the box annotation?
Beta Was this translation helpful? Give feedback.
All reactions