U.S. states by population in 2016

by Black Label

HTML

<script src="https://code.highcharts.com/highcharts.src.js"></script>
<script src="https://code.highcharts.com/modules/heatmap.js"></script>
<script src="https://code.highcharts.com/modules/tilemap.js"></script>

<figure class="highcharts-figure">
    <div id="container"></div>
</figure>

CSS

.highcharts-figure,
.highcharts-data-table table {
    min-width: 360px;
    /* max-width: 700px; */
    margin: 1em auto;
}

.highcharts-data-table table {
    font-family: Verdana, sans-serif;
    border-collapse: collapse;
    border: 1px solid #ebebeb;
    margin: 10px auto;
    text-align: center;
    width: 100%;
    /* max-width: 500px; */
}

.highcharts-data-table caption {
    padding: 1em 0;
    font-size: 1.2em;
    color: #555;
}

.highcharts-data-table th {
    font-weight: 600;
    padding: 0.5em;
}

.highcharts-data-table td,
.highcharts-data-table th,
.highcharts-data-table caption {
    padding: 0.5em;
}

.highcharts-data-table thead tr,
.highcharts-data-table tr:nth-child(even) {
    background: #f8f8f8;
}

.highcharts-data-table tr:hover {
    background: #f1f7ff;
}

JavaScript

(function(H) {
  H.wrap(
    H.seriesTypes.tilemap.prototype.pointClass.prototype,
    'setVisible',
    function(proceed, vis) {
      const point = this;

      if (!point.orginalColor) {
        point.orginalColor = point.color;
      }

      if (vis) {
        point.color = point.orginalColor;
      } else {
        point.color = 'red';
      }
    });
}(Highcharts));

Highcharts.chart('container', {
  chart: {
    type: 'tilemap',
    inverted: false,
    height: '65%'
  },

  accessibility: {
    screenReaderSection: {
      beforeChartFormat: '<h5>{chartTitle}</h5>' +
        '<div>{chartSubtitle}</div>' +
        '<div>{chartLongdesc}</div>' +
        '<div>{viewTableButton}</div>'
    },
    point: {
      valueDescriptionFormat: '{index}. {xDescription}, {point.value}.'
    }
  },

  xAxis: {
    visible: false
  },

  yAxis: {
    visible: false
  },

  colorAxis: {
    dataClasses: [{
      from: 1,
      to: 1,
      color: '#828ee3',
      name: 'Субъекты организации и ее представительств'
    }, {
      from: 2,
      to: 2,
      color: '#febf10',
      name: 'Прибыли в субъект из организации'
    }, {
      from: 3,
      to: 3,
      color: '#6fcf97',
      name: 'Прибыли в организацию из субъекта'
    }]
  },

  tooltip: {
    headerFormat: '',
    pointFormat: 'The population of <b> {point.name}</b> is <b>{point.value}</b>'
  },

  plotOptions: {
    series: {
      tileShape: "square",
      dataLabels: {
        enabled: true,
        format: '{point.hc-a2}',
        color: '#000000',
        align: 'left',
        verticalAlign: 'top',
        style: {
          textOutline: false
        }
      }
    }
  },

  series: [{
    name: '',
    data: [{
        'hc-a2': 'Кали',
        name: 'Калининградская',
        region: 'South',
        x: 1,
        y: 7,
        value: 0,
        color: "#dde1f5",
      },
      {
        'hc-a2': 'Смол',
        name: 'Смоленская',
        region: 'South',
        x: 3,
        y: 6,
        value:...