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

Polar bar fails with data labels #18444

Closed
TorsteinHonsi opened this issue Feb 6, 2023 · 0 comments · Fixed by #18500
Closed

Polar bar fails with data labels #18444

TorsteinHonsi opened this issue Feb 6, 2023 · 0 comments · Fixed by #18500

Comments

@TorsteinHonsi
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants