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
Closed

chart.labels are not updating #10429

wchmiel opened this issue Mar 27, 2019 · 6 comments
Assignees
Milestone

Comments

@wchmiel
Copy link
Contributor

wchmiel 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
Copy link
Contributor

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
Copy link
Contributor

pawelfus commented Mar 28, 2019

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

@sebastianbochan
Copy link
Contributor

sebastianbochan 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
Copy link
Collaborator

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

@sebastianbochan
Copy link
Contributor

sebastianbochan 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
Copy link
Collaborator

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
Projects
None yet
Development

No branches or pull requests

6 participants