Nicolas Gehlert
Nicolas Gehlert

Reputation: 3253

Tooltip Options not working for Highcharts Treemap

I want to add some tooltip formatting to a Highcharts treemap. For example the valueSuffix or valueDecimals. I have no problems using those attributes with different chart types but somehow they don't work for treemaps.

Here is the example code and Fiddle where I tried to use them.

$('#container').highcharts({
        tooltip: {
            backgroundColor: '#00FF00',
            valueSuffix: 'E',
            valueDecimals: 2
        },
        series: [{
            type: "treemap",
            layoutAlgorithm: 'stripes',
            alternateStartingDirection: true,
            levels: [{
            }]
        }]
    });

as you can see, the background-color attribute works.

I know that I could use the formatter with a function, but I prefer using the properties provided by Highcharts.

According to the documentation, you can also use series.tooltip or plotOptions.treemap.tooltip properties for styling but they did not work either.

Upvotes: 1

Views: 720

Answers (2)

Halvor Holsten Strand
Halvor Holsten Strand

Reputation: 20536

A workaround is to push what appears to be a missing value in pointArrayMap manually.

For example (JSFiddle):

Highcharts.seriesTypes.treemap.prototype.pointArrayMap.push('node.val');

Upvotes: 1

Sebastian Bochan
Sebastian Bochan

Reputation: 37588

Thank you for the reporting. Looks like a bug, which I added to our tracker here: https://github.com/highcharts/highcharts/issues/5352

Upvotes: 2

Related Questions