-
Notifications
You must be signed in to change notification settings - Fork 373
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
chartjs-plugin-annotation/src/elements.js
Lines 93 to 104 in 1e95744
| function updateSubElements(mainElement, elements, resolver, animations) { | |
| const subElements = mainElement.elements || (mainElement.elements = []); | |
| subElements.length = elements.length; | |
| for (let i = 0; i < elements.length; i++) { | |
| const definition = elements[i]; | |
| const properties = definition.properties; | |
| const subElement = getOrCreateElement(subElements, i, definition.type, definition.initProperties); | |
| const subResolver = resolver[definition.optionScope].override(definition); | |
| properties.options = resolveAnnotationOptions(subResolver); | |
| animations.update(subElement, properties); | |
| } | |
| } |
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);