Orders by Cutoff time: 3 days

author(s): Koushlendra

by KSK Kushwah

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',
         zoomType: 'x'
    },
    title: {
        text: 'Orders by Cutoff time: 3 days'
      },
      subtitle: {
        text: document.ontouchstart === undefined ?
          'Click and drag in the plot area to zoom in' : 'Pinch the chart to zoom in'
      },
      xAxis: {
        type: 'datetime',
        labels: {
          formatter: function () {
            var date = new Date(this.value);
            console.log(date);
            return date.getMonth()+ ' ' + date.getDate();
          }
        },
        categories:["2008-07-28T00:00:00.000Z", "2010-09-14T19:30:00.000Z", "2011-10-17T00:00:00.000Z", "2012-04-06T00:00:00.000Z", "2012-07-26T00:00:00.000Z", "2012-09-20T23:30:00.000Z", "2012-11-17T00:00:00.000Z", "2012-12-17T00:00:00.000Z", "2016-09-20T19:30:00.000Z", "2018-01-05T01:00:00.000Z"],
        title: {
          text : 'Cutoff time'
        }
      },
      yAxis: {
        title: {
          text: 'Number of orders'
        }
      },
      plotOptions: {
        column: {
          dataLabels: {
            enabled: true,
            color: 'white'
          }
        }
      },
      legend: {
        enabled: false
      },
      series: [{
      name: 'Number of orders',
      data:[ 
          [5],
          [8],
          [25],
          [15],
          [60],
          [5]
        ]
      }]
});