Highcharts Demo

author(s): Torstein Hønsi

by Black Label

HTML

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

<div id="container"></div>

JavaScript

const offset = 0.5;

var chart = Highcharts.chart('container', {


  xAxis: {
    tickPositioner: function() {
      // manually apply offset to all ticks
      this.tickPositions = this.tickPositions.map(x => x - offset);
    },
    labels: {
      formatter: function() {
        // print the original value to the user
        return this.value + offset;
      }
    }
  },

  chart: {
    type: 'heatmap'
  },

  series: [{
    pointRange: 1,
    data: [
      [0, 0, 5],
      [1, 0, 6],
      [0, 1, 2],
      [1, 1, 1]
    ]
  }]
});