JSFiddle - React, Tailwind, and code Playground
by Rajesh Danabal
HTML
<script src="http://code.highcharts.com/highcharts.js"></script>
<div id="container" style="height: 400px; width: 500px"></div>
JavaScript
$(function () {
$('#container').highcharts({
chart: {},
xAxis: {
categories: ['Adjusteddddddd May: fiddle external damaged (% of Ajax)', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
labels: {
step: 1,
formatter: function () {
var len = this.axis.categories.length;
var plotWidth = this.chart.plotWidth;
var width = Math.floor(plotWidth/len);
console.log("len", len, "plotWidth", plotWidth, " width", width);
return this.value.replace(/ /g, '<br />');
}
}
},
series: [{
type: "column",
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
}]
});
Highcharts.charts[0].redraw();
});