2

Pls find the link for treemap http://jsfiddle.net/BlackLabel/m0587v4q/. What I need is when I double click on legend it should show that respective data only on tree map and rest should hide.

     $('#container').highcharts({
        'chart': {
            type: 'treemap'
        },

        series: [{

            data: [{
                'name': 'Americas',
                'value': 52976,
                'color': 'rgba(47,126,216,1)'
            }, {
                'name': 'Australia',
                'value': 41219,
                'color': 'rgba(13,35,58,1)'
            }, {
                'name': 'Europe',
                'value': 62756,
                'color': 'rgba(139,188,33,1)'
            }, {
                'name': 'Asia',
                'value': 14577,
                'color': 'rgba(145,0,0,1)'
            }],
            legendType: 'point',
            showInLegend: true
        }]


    });
Bernardo Marques
  • 925
  • 2
  • 10
  • 33

1 Answers1

0

You can use Custom-Events plugin and add double click event in this way:

legend: {
  itemEvents: {
    dblclick: function() {
      console.log('dblclick')
    },
    click: function() {
      console.log('click')
    }
  }
}

Live demo: http://jsfiddle.net/BlackLabel/6m4e8x0y/4952/

Docs: https://www.highcharts.com/plugin-registry/single/15/Custom-Events

ppotaczek
  • 36,341
  • 2
  • 14
  • 24