JSFiddle - React, Tailwind, and code Playground
HTML
<script type="text/javascript" src="http://highcharts.com/js/testing.js"></script>
<div id="container" style="height: 300px"></div>
JavaScript
var data = [
[Date.UTC(2010, 0, 1), 29.9],
[Date.UTC(2010, 0, 2), 71.5],
[Date.UTC(2010, 0, 3), 106.4],
[Date.UTC(2010, 0, 6), 129.2],
[Date.UTC(2010, 0, 7), 144.0],
[Date.UTC(2010, 0, 8), 176.0]];
var chart = new Highcharts.Chart({
chart: {
renderTo: 'container'
},
xAxis: {
type: 'datetime',
tickInterval : 24 * 3600 * 1000,
dateTimeLabelFormats: {
day: '%e %b',
week:'%e %b',
month:'%b %y'
},
labels: {
formatter: function() {
//console.log(this.toSource());
alert(this.toSource());
return Highcharts.dateFormat('%a %d %b', this.value);
}
}
},
series: [{
data: data
}]
});