Highcharts Column Chart

Get the all transactions in a given date in a series on the chart

by Musale Martin

HTML

<script src="http://code.highcharts.com/stock/highstock.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

$(function() {
  $('#container').highcharts('StockChart', {
    chart: {
      type: 'column',
      spacingRight: 20,
      zoomType: 'x'
    },
    title: {
      text: 'Transactions Done'
    },
    subtitle: {
      text: 'All the disbursements done'
    },
    xAxis: {
      type: 'datetime',
      crosshair: true,
      ordinal: true,
      title: {
        text: 'Dates'
      },
      tickInterval: 24 * 3600 * 1000,
      dateTimeLabelFormats: {
        day: '%b of %e'
      },
    },
    yAxis: {
      min: 0,
      title: {
        text: 'Transanctions'
      }
    },
    tooltip: {
      shared: true,
    },
    plotOptions: {
      series: {
        stacking: 'normal'
      },
      column: {
        pointPadding: 0.2,
        borderWidth: 0
      }
    },
    series: [{
      name: 'success',
      data: [
        [1459555200000, 10],
        [1459728000000, 7],
        [1462233600000, 5],
        [1464825600000, 5],
        [1464912000000, 4],
        [1465084800000, 6],

      ]
    }, {
      name: 'failed',
      data: [
        [1459555200000, 1],
        [1459728000000, 2],
        [1462233600000, 7],
        [1464825600000, 0],
        [1464912000000, 4],
        [1465084800000, 6],
      ]
    }, {
      name: 'in progress',
      data: [
        [1459555200000, 0],
        [1459728000000, 5],
        [1462233600000, 7],
        [1464825600000, 0],
        [1464912000000, 10],
        [1465084800000, 6],
      ]
    }, {
      name: 'sent',
      data: [
        [1459555200000, 10],
        [1459728000000, 20],
        [1462233600000, 20],
        [1464825600000, 50],
        [1464912000000, 40],
        [1465084800000, 60],
      ]
    }]
  });
});