hitautodestruct
hitautodestruct

Reputation: 20820

How do I place the labels next to the series on a split packed bubble chart?

Issue

Using Highcharts I am trying to do away with the legend on a split packed bubble and place the series names under or near the visual groups (see illustration below).

Illustration of labels on packed bubble charts series

I tried setting plotOptions.packedbubble.label to { enabled: true } but its not showing anything.

Question:

How do I show the series names under the groups of the split packed bubble chart?

Upvotes: 2

Views: 839

Answers (1)

Sebastian Wędzel
Sebastian Wędzel

Reputation: 11633

You can use the parentNodeFormat feature or parentNodeFormatter callback to achieve the wanted effect. Using the callback you can return custom HTML element if you need.

Demo: https://jsfiddle.net/BlackLabel/j2hq9osz/

dataLabels: {
    enabled: true,
    parentNodeFormat: '{series.name}',
    format: '{point.name}',
    style: {
        color: 'black',
        textOutline: 'none',
        fontWeight: 'normal'
    }
}

API: https://api.highcharts.com/highcharts/series.packedbubble.dataLabels.parentNodeFormat

Upvotes: 3

Related Questions