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

Sunburst chart: Circular labels don't show when the numbers are large and the difference between parent and child is very small #18884

Closed
Luca-Busse opened this issue Apr 26, 2023 · 4 comments · Fixed by #18892

Comments

@Luca-Busse
Copy link

Expected behaviour

When dataLabels are enabled and circularMode is enabled, the labels should always show.

Actual behaviour

When the difference between parent node and child node is very small, e.g. root.value: 6284, child node value: 6283, the label for the child does not show.

Live demo with steps to reproduce

https://jsfiddle.net/L37wze5h/1/

Product version

Highcharts 10.2.1

Affected browser(s)

Microsoft Edge, Firefox, Chrome

@highsoft-bot highsoft-bot added this to To do in Development-Flow via automation Apr 26, 2023
@TorsteinHonsi
Copy link
Collaborator

Thanks for reporting!

@raf18seb I propose fixing it here:

// Check if dataLabels should be render in the
// upper half of the circle
if (end - start > Math.PI) {
upperHalf = false;
moreThanHalf = true;
}

... by adding a block that separates the start and the end:

        // Check if dataLabels should be render in the upper half of the circle
        if (end - start > Math.PI) {
            upperHalf = false;
            moreThanHalf = true;
            // Close to the full circle, add some padding so that the SVG
            // renderer treats it as separate points (#18884).
            if ((end - start) > 2 * Math.PI - 0.01) {
                start += 0.01;
                end -= 0.01;
            }
        }

@Luca-Busse
Copy link
Author

Thank you! When will this fix be available?

@jszuminski
Copy link
Contributor

It's been merged, so it'll be available within the next release.

However, if you need to you can use the code from GitHub: https://jsfiddle.net/BlackLabel/fjrus9pw/

@Luca-Busse
Copy link
Author

Thank you!

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

Successfully merging a pull request may close this issue.

4 participants