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

Remove duplicate scale building #6247

Merged
merged 1 commit into from
Oct 22, 2019
Merged

Remove duplicate scale building #6247

merged 1 commit into from
Oct 22, 2019

Conversation

kurkle
Copy link
Member

@kurkle kurkle commented May 6, 2019

Remove duplicate calls to ensureScalesHaveIDs and buildOrUpdateScales from initialize.

These two are also called from updateConfig:

chart.ensureScalesHaveIDs();
chart.buildOrUpdateScales();

Which is called from update:

updateConfig(me);

Which in turn is called from construct (right after initialize):

me.initialize();
me.update();

Edit: This duplication comes from #4198 where updating of scales after initialization was fixed.

@benmccann
Copy link
Contributor

The last few lines of updateConfig don't seem like they're updating the config at all. Maybe we should move them to update instead?

	chart.buildOrUpdateScales();

	// Tooltip
	chart.tooltip._options = newOptions.tooltips;
	chart.tooltip.initialize();

@kurkle
Copy link
Member Author

kurkle commented May 6, 2019

Tooltip is iniatialized again in update. But I guess there is same issue in (re)moving that: plugins might expect Tooltip to be iniatialized.

@etimberg etimberg merged commit cec2d26 into chartjs:master Oct 22, 2019
@kurkle kurkle deleted the dedupe branch November 13, 2019 06:15
exwm pushed a commit to exwm/Chart.js that referenced this pull request Apr 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants