Lorenzo
Lorenzo

Reputation: 797

Highcharts Bubble with text

Can I make a bubble chart like this?'

I try this: Highcharts naming of individual bubbles but not work :/

Upvotes: 0

Views: 2202

Answers (1)

SteveP
SteveP

Reputation: 19093

Yes you can, and all post you mentioned showed the way. The basics is that you need the label text in your data, and you need to customise the label formatter. e.g.

 series: [{
        dataLabels: {
            enabled: true,
            x:40,
            formatter:function() {
                return this.point.name;
            },
            style:{color:"black"}
        },
        data: [{
            "x": 23,
            "y": 22,
            "z": 200,
            "name":"point1"
        }, {
            "x": 43,
            "y": 12,
            "z": 100,
            "name":"point2"
        }]
    }]

http://jsfiddle.net/tqVF8/

The 'x' parameter in the dataLabel defines an offset of where to place the label relative to the point. You can also specify a 'y' option to move it up or down. These figures can be negative.

To vary the point colors, you can set a 'color' attribute for each point object in the data.

Upvotes: 3

Related Questions