Highcharts Demo

author(s): Torstein Hønsi

by toninho09

HTML

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

<div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>

JavaScript

Highcharts.chart('container', {
  chart: {
    type: 'column'
  },
  title: {
    text: 'Stacked column chart'
  },
  xAxis: {
    type: 'category',
    labels: {
      rotation: 60,
      useHTML: true,
      formatter: function() {
        return this.value;
      },
      style: {
        textOverflow: 'none'
      }
    }
  },
  yAxis: {
    min: 0,
    title: {
      text: 'Total fruit consumption'
    }
  },
  tooltip: {
    pointFormat: '<span style="color:{series.color}">{series.name}</span>: <b>{point.y}</b> ({point.percentage:.0f}%)<br/>',
    shared: true
  },
  plotOptions: {
    column: {
      stacking: 'percent'
    }
  },
  series: [{
    name: 'John',
    data: [['Long Name 0',1],
    ['Long Name 1',1],
    ['Long Name 2',1],
    ['Long Name 3',1]
    ]
  }]
});