JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="http://code.highcharts.com/highcharts-more.js"></script>
<script src="http://code.highcharts.com/modules/exporting.js"></script>
<div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
JavaScript
$(function () {
var absMin = 1356998400000;
var absMax = 1388448000000;
$('#container').highcharts({
chart: {
type: 'columnrange',
inverted: true
},
"xAxis": {
"categories": ["#1", "#2"],
"labels": {
"align": "right",
"useHTML": true
},
"tickWidth": 0
},
"yAxis": {
"max": absMax,
"min": absMin,
"opposite": true,
"type": "datetime",
"dateTimeLabelFormats": {
"month": "%b %y"
},
"endOnTick": false,
"labels": {
"align": "left"
},
tickPositioner: function () {
var gridLines = [];
var date = new Date(absMin);
var daysArray = [];
var startMonth = date.getMonth();
var startYear = date.getYear();
var daysInMonth = new Date(startYear, startMonth + 1, 0).getDate();
for (var i = absMin; i <= absMax; i += (daysInMonth * 24 * 3600 * 1000)) {
var newDate = new Date(i);
var newStartMonth = newDate.getMonth();
var newStartYear = newDate.getYear();
var daysInMonth = new Date(newStartYear, newStartMonth + 1, 0).getDate();
gridLines.push(i);
}
//return gridLines;
}
},
"plotOptions": {
"series": {
"animation": false,
"borderWidth": 0,
"borderColor": "transparent",
"borderRadius": 0,
"groupPadding": 0.05
},
"columnrange": {
"dataLabels": {
"enabled": true,
"distance": -1
},
"animation": false,
...