Skip to content

Commit

Permalink
Better solution to #17545. No need for alignAttr anymore.
Browse files Browse the repository at this point in the history
  • Loading branch information
TorsteinHonsi committed Nov 18, 2023
1 parent affb4e7 commit 69fc2c2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
5 changes: 2 additions & 3 deletions ts/Extensions/OverlappingDataLabels.ts
Expand Up @@ -278,10 +278,9 @@ function hideOrShow(label: SVGElement, chart: Chart): boolean {
isLabelAffected = true;

// Animate or set the opacity
label.alignAttr.opacity = newOpacity;
label[label.isOld ? 'animate' : 'attr'](
label.alignAttr,
null as any,
{ opacity: newOpacity },
void 0,
complete
);
fireEvent(chart, 'afterHideOverlappingLabel');
Expand Down
5 changes: 1 addition & 4 deletions ts/Series/Funnel/FunnelSeries.ts
Expand Up @@ -214,7 +214,7 @@ class FunnelSeries extends PieSeries {
options.verticalAlign = 'bottom';

// Call the parent method
if (!inside || point.visible) {
if (inside && point.visible) {
baseAlignDataLabel.call(
series,
point,
Expand All @@ -223,9 +223,6 @@ class FunnelSeries extends PieSeries {
alignTo,
isNew
);
// Delete `alignAttr` for funnel and pyramid, because it is not
// used, but caused problems with the overlapping logic (#17545)
delete dataLabel.alignAttr;
}

if (inside) {
Expand Down

0 comments on commit 69fc2c2

Please sign in to comment.