Chart.js icon indicating copy to clipboard operation
Chart.js copied to clipboard

Fix: applyStack() returned the sum of all values for hidden dataset indices

Open rluba opened this issue 1 year ago • 1 comments

… which causes incorrect animations when showing/hiding stacked datasets. This fixes #11198.

rluba avatar Jul 15 '24 11:07 rluba

Is it possible to write a test for this change?

etimberg avatar Jul 15 '24 12:07 etimberg

That is exactly the fix I'm desperate for. Would be great, if this got merged.

@etimberg I could've looked into writing the test, but I'm new to the library codebase, so I would really appreciate, if you can help me to find the correct place to write this test. I found tests for datasets visibility in the core.controller.tests.js, but I didn't find lots of examples of how and where to write tests of animated transitions. Is there now a standart way to test transitions and to check which values library are using during the transition?

DeyLak avatar Oct 23 '24 01:10 DeyLak

@DeyLak I don't believe we have a standard way to check for values during animations.

I would probably write a test that verifies that the sum doesn't include hidden datasets and that should be enough.

etimberg avatar Oct 23 '24 12:10 etimberg

I've submitted the new PR: https://github.com/chartjs/Chart.js/pull/11938

DeyLak avatar Oct 24 '24 12:10 DeyLak

Closing since this was fixed in #11938

etimberg avatar Oct 24 '24 15:10 etimberg