-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
bugfix/17589-multiple-datalabels-update #18549
bugfix/17589-multiple-datalabels-update #18549
Conversation
File size comparisonSizes for compiled+gzipped (bold) and compiled files.
|
Visual test results - No difference found |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at the changes, I am wondering if we can simplify this a bit.
We know that point.dataLabels
should always be an array, and that point.dataLabel
should always be the same as point.dataLabels[0]
. If this is not the case, it should be considered a bug. (Or am I wrong? Check DataLabel.ts
, line 563).
So say the assumption above is true, or we make it true. In that case, all the juggling between point.dataLabel
and point.dataLabels
and checking i === 0
can be replaced with a structure like this:
for (let dataLabel of point.dataLabels) {
// Do stuff to each data label. Destroy if that's what we want, but remember
// to splice it out from `point.dataLabels`
}
// Write back to `point.dataLabel`. `point.dataLabels[0]` can now be either
// an SVGElement or undefined, both of which are correct.
point.dataLabel = point.dataLabels[0];
@TorsteinHonsi It seems to me, that it won't be so simple. In the place, where I have added a fix we are already in a loop through data labels for each point. In my opinion, to change the logic (to use |
Fixed #17589, update of multiple data labels didn't work in specific conditions.