JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/highcharts-more.js"></script>
<script src="https://code.highcharts.com/modules/solid-gauge.js"></script>
<div style="width: 600px; height: 400px; margin: 0 auto">
<div id="container-speed" style="width: 300px; height: 200px; float: left"></div>
</div>
JavaScript
var fullData = [
[{
'name': 'A',
'innerRadius': 50,
'radius': 70,
'y': 440
}, {
'name': 'E',
'innerRadius': 70,
'radius': 100,
'y': 239
}],
[{
'name': 'A',
'innerRadius': 50,
'radius': 70,
'y': 200
}, {
'name': 'E',
'innerRadius': 70,
'radius': 100,
'y': 320
}]
];
var cont = 1;
var series = [];
series.push({
'name': 'Name serie',
'data': [
Object.assign({}, fullData[0][0]),
Object.assign({}, fullData[0][1]),
],
'dataLabels': false
});
var gaugeOptions = {
chart: {
type: 'solidgauge',
},
title: {
text: 'Ejemplo'
},
tooltip: {
enabled: true,
pointFormat: '{point.name}: <b>{point.y}</b>'
},
pane: {
center: ['50%', '85%'],
size: '150%',
startAngle: -90,
endAngle: 90,
background: {
backgroundColor: (Highcharts.theme && Highcharts.theme.background2) || '#EEE',
innerRadius: '50%',
outerRadius: '100%',
shape: 'arc'
}
},
// the value axis
yAxis: {
min: 0,
max: 440,
lineWidth: 0,
minorTickInterval: null,
tickPixelInterval: 400,
tickWidth: 0,
tickAmount: null,
},
plotOptions: {
solidgauge: {
dataLabels: {
y: 5,
borderWidth: 0,
useHTML: true
}
}
},
};
$('#container-speed').highcharts(Highcharts.merge(gaugeOptions, {
credits: {
enabled: false
},
series: series
}), function(chart) {
if (!chart.renderer.forExport) {
setInterval(function() {
if (chart && chart.series) {
chart.series[0].points.forEach((point, i) => {
point.update(fullData[cont][i])
})
cont = (cont + 1 === 2) ? 0 : cont + 1;
}
}, 1000);
}
});
console.log(fullData)