Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chart.labels are not updating #10429

Closed
wchmiel opened this issue Mar 27, 2019 · 6 comments

Comments

Projects
None yet
6 participants
@wchmiel
Copy link
Contributor

commented Mar 27, 2019

Expected behaviour

chart.labels should update using chart.update() with new labels options.

Actual behaviour

chart.labels are not updating.

Live demo with steps to reproduce

https://jsfiddle.net/BlackLabel/fxuypzw5/

@sebastianbochan

This comment has been minimized.

Copy link
Contributor

commented Mar 27, 2019

It looks like the renderLabels function does not set reference to rendered label. As a result update does not recognize object and does not apply new options.

Workaround
The solution is adding label by renderer.label, keep reference and call the attr() method as update.

Demo:

Docs:

@pawelfus

This comment has been minimized.

Copy link
Contributor

commented Mar 28, 2019

Maybe we should slowly deprecate this chart.label in favour of annotations?

@sebastianbochan

This comment has been minimized.

Copy link
Contributor

commented May 14, 2019

The second solution is keeping all labels in extra array like chart.labels or something. As a result reference to labels will exist.

Internal note
Regarding to pawel's idea, I agree but, how about back-compatibility?
@TorsteinHonsi what do you think?

@TorsteinHonsi

This comment has been minimized.

Copy link
Collaborator

commented May 15, 2019

I agree with Pawel, the chart.labels feature is so limited that we should rather slowly deprecate it in favour of annotations.

@sebastianbochan

This comment has been minimized.

Copy link
Contributor

commented May 16, 2019

Will we focus on changing docs only or remove the functionality in core too?

I suggest to start with update docs at the beginning.

@TorsteinHonsi

This comment has been minimized.

Copy link
Collaborator

commented May 20, 2019

I suggest to start with update docs at the beginning.

Yes I agree. The functionality is so small that it doesn't hurt to leave it there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.