Skip to content

Polar bar fails with data labels #18444

Description

@TorsteinHonsi

Actual behaviour

A polar chart with type "bar" and data labels causes JavaScript error.

Live demo with steps to reproduce

https://jsfiddle.net/highcharts/30fg6y8d/

Product version

v10.3.3

Affected browser(s)

All

Workaround

Set type: 'column' and inverted: true.

Suggested fix

The following statement goes wrong because it assumes that Series is two steps up in the inheritance chain:

Object
.getPrototypeOf(Object.getPrototypeOf(this))
.alignDataLabel.call(
this,
point,
dataLabel,
options,
alignTo,
isNew
);

However, with bar, and theoretically other custom series types, this assumption is not correct, and we get into an eternal loop. The fix is to apply it on the Series prototype directly:

        Series.prototype.alignDataLabel.call(
            this, point, dataLabel, options, alignTo, isNew
        );

In addition to that statement, Series must be imported and the typing of alignTo must be resolved.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions