Aman Adhikari
Aman Adhikari

Reputation: 3280

Set different color for each bubble in Bubble-Map

In Higchart's Bubble-Map chart, Is it possible to set different color for each bubble ? If yes then please update this jsfiddle link.

series : [{
            name: 'Countries',
            mapData: mapData,
            color: '#E0E0E0',
            enableMouseTracking: false
        }, {
            type: 'mapbubble',
            mapData: mapData,
            //color : 'red' // This color applies for all the bubbles but i want different color for each bubble
            name: 'Population 2013',
            joinBy: ['iso-a2', 'code'],
            data: data,
            minSize: 4,
            maxSize: '12%',
            tooltip: {
                pointFormat: '{point.code}: {point.z} thousands'
            }
        }]

Upvotes: 1

Views: 179

Answers (1)

Ella Ryan
Ella Ryan

Reputation: 1155

You can put the color in the data string, eg

var data = [{
       code: "AF",
       z: 30552,
       color: '#642288'
    }, /*.... etc */
]

Since the data in the example is being loaded from elsewhere, I copied it into the fiddle and added the colors.

Updated JS Fiddl

Upvotes: 3

Related Questions