带有分类类的图表图表气泡

问题描述 投票:0回答:1

[带有高图,是否可以通过在类中添加类似于“平铺地图圆”(https://www.highcharts.com/maps/demo/map-bubble)的分析来制作“地图气泡”(https://www.highcharts.com/maps/demo/circlemap-africa

提前谢谢您!

javascript jquery charts highcharts
1个回答
0
投票

$(function() {

  $.getJSON('http://www.highcharts.com/samples/data/jsonp.php?filename=world-population.json&callback=?', function(data) {
    var data1 = data.slice(0, 70),
      data2 = data.slice(70, 150),
      data3 = data.slice(150);

    $('#container').highcharts('Map', {
      chart: {
        borderWidth: 1
      },

      title: {
        text: 'World population 2010 by country'
      },

      subtitle: {
        text: 'Map bubble color demo'
      },

      legend: {
        enabled: false
      },

      mapNavigation: {
        enabled: true,
        buttonOptions: {
          verticalAlign: 'bottom'
        }
      },

      series: [{
        name: 'Countries',
        mapData: Highcharts.maps['custom/world'],
        color: '#E0E0E0',
        enableMouseTracking: false
      }, {
        type: 'mapbubble',
        color: '#ff0000',
        mapData: Highcharts.maps['custom/world'],
        joinBy: ['iso-a2', 'code'],
        data: data1,
        name: 'Population 2010',

        minSize: 4,
        maxSize: '12%',
        tooltip: {
          pointFormat: '{point.code}: {point.z} thousands'
        }
      }, {
        type: 'mapbubble',
        color: '#00ff00',
        mapData: Highcharts.maps['custom/world'],
        joinBy: ['iso-a2', 'code'],
        data: data2,
        name: 'Population 2010',

        minSize: 4,
        maxSize: '12%',
        tooltip: {
          pointFormat: '{point.code}: {point.z} thousands'
        }
      }, {
        type: 'mapbubble',
        color: '#0000ff',
        mapData: Highcharts.maps['custom/world'],
        joinBy: ['iso-a2', 'code'],
        data: data3,
        name: 'Population 2010',

        minSize: 4,
        maxSize: '12%',
        tooltip: {
          pointFormat: '{point.code}: {point.z} thousands'
        }
      }]
    });

  });
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="http://code.highcharts.com/maps/highmaps.js"></script>
<script src="http://code.highcharts.com/maps/modules/data.js"></script>
<script src="http://code.highcharts.com/mapdata/custom/world.js"></script>


<div id="container" style="height: 500px; min-width: 310px; max-width: 800px; margin: 0 auto"></div>
© www.soinside.com 2019 - 2024. All rights reserved.