Skip to content

StackLabels formatter in stacked waterfall chart #17902

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

Closed
kamil-musialowski opened this issue Oct 31, 2022 · 1 comment · Fixed by #17984
Closed

StackLabels formatter in stacked waterfall chart #17902

kamil-musialowski opened this issue Oct 31, 2022 · 1 comment · Fixed by #17984

Comments

@kamil-musialowski
Copy link
Contributor

Formatter should have correct properties values. At this moment, it is not possible to create a simple, conditional formatter like this.x === 3, since console logging the x values throws only 0.

Live demo with steps to reproduce

Open up the console and see this.x values.
https://jsfiddle.net/BlackLabel/p8u6be1a/

Product version

Highcharts + Highcharts More 10.2.1 (latest)

@karolkolodziej
Copy link
Contributor

Thank you @kamil-musialowski for reporting that issue.

Internal note:
While creating the dummyStackItem 4th argument (which is x value), is set to zero.

dummyStackItem = new StackItem(
yAxis as any,
yAxis.options.stackLabels as any,
false,
0,
void 0
);

It should be changed to something meaningful later inisde the objectEach where it can be extracted probably as key:

            // Render each waterfall stack total
            objectEach(waterfallStacks, function (type): void {
                objectEach(type, function (
                    stackItem: StacksItemObject,
                    key: string
                ): void {
                    dummyStackItem.total = stackItem.stackTotal;
                    dummyStackItem.x = +key;

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