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

v2.0 Update issue for bar chart #1640

Closed
andi-b opened this issue Nov 11, 2015 · 2 comments
Closed

v2.0 Update issue for bar chart #1640

andi-b opened this issue Nov 11, 2015 · 2 comments

Comments

@andi-b
Copy link
Contributor

andi-b commented Nov 11, 2015

This almost works correctly - the initial loading of data is correct, but when I do the following with new data for barChartData :

window.myBar.data = barChartData;
window.myBar.update();

Only the chart itself updates with the correct data, but tooltip is incorrect. So I then did the following:

window.myBar.tooltip._data = barChartData;
window.myBar.update();

The label is now correct, but the value(yLabel) of the tooltip is still incorrect. It looks like it's the yLabel that is returning old data on line 2649 in Chart.js

return this._data.datasets[datasetIndex].label + ': ' + yLabel;

I may be going about this the wrong way, but from what I can tell this is the best and easiest method for me.

@etimberg
Copy link
Member

The issue here is that internally the data object is attached to lots of places (scales, tooltip, etc). The solution is to simply store the reference to the data object in a single place.

@etimberg
Copy link
Member

Fixed in #1646

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

2 participants