Data element visibility consistency #11030
Unanswered
stockiNail
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Developing an enhancement in chartjs-plugin-annotation, I have faced a weird situation about the visibility of the data elements. The new features is based on doughnut controllers and I have tested only there, therefore not sure if it's the same for all others.
I have seen that using
hide
andshow
API, when thedataIndex
is passed as argument, the implementation is changing the data elements adding/setting thehidden
option in each data element.Instead, toggleDataVisibility and getDataVisibility API are managing an internal object,
_hiddenIndices
, which is not touch fromhide
andshow
.In this way, if I'm performing an
hide
action to a specific index of a dataset, thegetDataVisibility
is returning alwaystrue
(case with 1 dataset).Not sure if it's working as designed.
Here a codepen, https://codepen.io/stockinail/pen/MWBjQjO, where clicking on chart area, the first element will be hidden but the
getDataVisibility
invocation returnstrue
, see the console.Beta Was this translation helpful? Give feedback.
All reactions