chartjs / chartjs/chartjs-plugin-annotation

Scriptable yAdjust and chartjs-plugin-zoom

Open
#973 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
623
Forks
377
PR merge metrics
No merged PRs in 30d

Description

I am using yAdjust to avoid line labels from overlapping, and this is working well until I enable the zoom plugin.

The issue I am running in to is that the Scriptable function is receiving the label's position before the zoom not after. I added `console.log(definition.properties);` to this part of the code, and it is the x, y value that I need access to.. but this doesn't match the x,y value in to the function `context.element.label.x` and `context.element.label.y`

https://github.com/chartjs/chartjs-plugin-annotation/blob/1e95744fb98e6fe9426f8b6a7bd17b1fcdee2f42/src/elements.js#L93-L104

Image

Is there any way to get access to this value? I see it looks like it is overriding the label on the resolver here? but I can't figure out how to get this value... `resolver[definition.optionScope].override(definition);`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.