Marimekko - Percentage Stacked

author(s): Torstein Hønsi

by Rajesh Danabal

HTML

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

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

CSS

#container {
  max-width: 800px;
  min-width: 380px;
  margin: 0 auto;
}

JavaScript

Highcharts.chart('container', {

  chart: {
    type: 'variwide'
  },

  title: {
    text: 'Verdeling DBCs type per specialist'
  },

  xAxis: [{
    type: 'category'
  }, {
    type: 'category',
    linkedTo: 0,
    opposite: true,
    title: {
      text: 'Days Since Start'
    }
  }],

  yAxis: {
    max: 100,
    labels: {
      format: '{value}%'
    }
  },

  legend: {
    enabled: true,
    reversed: true
  },
  plotOptions: {
    variwide: {
      stacking: 'percent',
    }
  },
  series: [{
    name: 'Type B',
    data: [
      ['Specialist A', 49.8, 335504],
      ['Specialist B', 58, 277339],
      ['Specialist C', 11, 421611],
    ],
    tooltip: {
      pointFormat: 'Type B: <b>{point.y}%</b><br>' +
        'Totaal # DBCs: <b> {point.z} </b><br>'
    },
    // colorByPoint: true
  }, {
    name: 'Type A',
    data: [
      ['Specialist A', 50.2, 335504],
      ['Specialist B', 42, 277339],
      ['Specialist C', 89, 421611],

    ],
    tooltip: {
      pointFormat: '{point.series.name}: <b>{point.y}%</b><br>' +
        'Totaal # DBCs: <b> {point.z} </b><br>'
    },
    // colorByPoint: true
  }]
});