Jeremy Green
Jeremy Green

Reputation: 25

Highcharts donut tooltip formatting using drilldown data

I am attempting to put formatted html into the outer donut ring tooltips using data stored in the drilldown portion of the data, for example:

data = [{
    y: 33.84,
    color: '#ff0000',
    drilldown: {
        name: 'Downloads',
        categories: ['News', 'P2P'],
        data: [30.36, 3.48],
        color: '#ff0000',
        tooltip_data: ['News tooltip', 'P2P tooltip']
    }

I then call this using the tooltip formatter like so:

tooltip: {
    useHTML: true,
    formatter: function() {
        return this.point.tooltip_data;
    }
}

A more comprehensive example here: http://jsfiddle.net/mQ3En/1/

The tooltips generate however they are blank. This method works for a standard pie chart but not for the donut, I am assuming it is because the tooltip data is nested.

I am guessing that it is just the way I am accessing this.point, but thats as far as I can get.

Update: here is the working code... http://jsfiddle.net/emFqq/

Upvotes: 1

Views: 1094

Answers (2)

Sebastian Bochan
Sebastian Bochan

Reputation: 37588

I advice to use developers tools and console, which allows to find a reason. Your object is undefined, so you get a blank tootlip. Morever if you set parameter in drilldown obejct, you ned to push this object in parser (take look at the loop).

Upvotes: 1

jko
jko

Reputation: 2098

the tooltip.formatter() you chose is quite wrong.
remove it any everything seams to be working

Upvotes: 0

Related Questions