Skip to content

Scriptable yAdjust and chartjs-plugin-zoom #973

Open
@knap1930

Description

@knap1930

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

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);
}
}

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);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions