JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://code.highcharts.com/highcharts.js"></script>
<div id="container">
</div>
JavaScript
//aqui seria seus dados que vem da requisição...
var graph_data = [
{date:'10-08-2019', valor: 12.00, turno: T},
{date:'10-09-2019', valor: 10.30, turno: T},
{date:'10-10-2019', valor: 9.30, turno: T}
];
var graph_keys = [], graph_values = [];
for (var i in graph_data) {
var date = new Date(graph_data[i].date + " 23:59:59");
var day = date.getDate();
var monthIndex = date.getMonth();
var year = date.getFullYear();
graph_keys.push(day + "/" + monthIndex + "/" + year);
graph_values.push(graph_data[i].valor.turno);
}
$(function () {
$('#container').highcharts({
chart: {
renderTo: 'container',
type: 'column'
},
title: {
text: 'Mês atual',
x: -20 //center
},
subtitle: {
text: 'Subtítulo',
x: -20
},
xAxis: {
categories: graph_keys
},
yAxis: {
title: {
text: 'Percentagem'
},
plotLines: [{
value: 1,
width: 0,
color: '#808080'
}]
},
tooltip: {
valueSuffix: ''
},
legend: {},
series: [{
name: 'Tarefas Gerais',
data: graph_values
}]
});
});