Catao
Catao

Reputation: 129

Mult Serie Bubble Chart HighCharts

I'm trying to use Mult Series in Bubble Chart. What I'm doing at the moment is:

$('#container').highcharts('Map', {
    title: {
        text: 'Bubble Chart'
    },

    tooltip: {
        pointFormat: '{point.estado}<br>' +
            'Ligacoes: {point.ligacoes}'
    },

    series: [{
            name: 'Basemap',
            mapData: map,
            borderColor: '#606060',
            nullColor: 'rgba(200, 200, 200, 0.2)',
            showInLegend: false
        },  {
            type: 'mapbubble',
            dataLabels: {
                enabled: true,
                format: '{point.capital}'
            },
            name: 'Test',
            data: data,
            maxSize: '12%',
            color: '#EE0000'

            name: 'Test2',
            data: data,
            maxSize: '12%',
            color: '#EE0000'


    }]
});

At the moment I don't care if the data comes the same in both series. It's working if I just use one

name: 'Test',
data: data,
maxSize: '12%',
color: '#EE0000'

Anyone can try to tell what can I do... I'm trying to understand how to have more than one serie.

Thanks !

Upvotes: 0

Views: 45

Answers (1)

Halvor Holsten Strand
Halvor Holsten Strand

Reputation: 20536

Each series is represented as an object in the series-array. You are just re-stating the same name/value-pairs inside the same series object, which only overwrites the values.

In short it should look something like:

// series array
series: [{
    // Series object 1
    name: 'Basemap',
    mapData: map
},  {
    // Series object 2
    type: 'mapbubble',
    name: 'Bubble 1',
    data: data
},  {
    // Series object 3
    type: 'mapbubble',
    name: 'Bubble 2',
    data: data
}]

Or see this more elaborate JSFiddle for a demonstration.

Upvotes: 3

Related Questions