Closed mbehr1 closed 2 years ago
element.elements[0].options.display is set to false and never set back to the orig. value if the line annotation e.g. with zoom/pan is moved once out of the "inside" area.
Let me do some additional tests but should work with zoom/pan.
I tried setting display back to true in e.g. the "enter" callback and that works but only if I access element.elements[0]... directly. enter:
({ element }, event) => { element.elements[0].options.display=true; element.options.label.display=true; // <- this seems not to be sufficient return true; }
tested with version v2.0.0
To change the options of the label, you have to access to the label element, by element.label.options
. The element.options.label
are not used at runtime.
To change the options of the label, you have to access to the label element, by
element.label.options
. Theelement.options.label
are not used at runtime.
Thx. Now setting element.label.options.display=true; works as well as workaround.
@stockiNail thx a lot! I can confirm it's fixed 👍 (any rough indication when 2.0.1 might be released?)
I can confirm it's fixed 👍
Glad to hear it!
(any rough indication when 2.0.1 might be released?)
Not yet. @LeeLenaleee what do you think?
There are not really any bugs open that are clear and can be solved now so I guess we can bump the version to 2.0.1
@mbehr1 version 2.0.1 has been published.
@stockiNail thx a lot! Really appreciate the fast reaction/response!
It seems that due to https://github.com/chartjs/chartjs-plugin-annotation/blob/eee842cb5181bdebcb29b23a6a8e4891f6c0c30f/src/types/line.js#L93
element.elements[0].options.display is set to false and never set back to the orig. value if the line annotation e.g. with zoom/pan is moved once out of the "inside" area.
Is this by design/intended? Is there any workaround? I tried setting display back to true in e.g. the "enter" callback and that works but only if I access element.elements[0]... directly. enter: ({ element }, event) => {
element.elements[0].options.display=true; element.label.options.display=true; // <- this works as well return true; }
tested with version v2.0.0