JSFiddle - React, Tailwind, and code Playground
by Sascha
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/solid-gauge.js"></script>
<div style="width: 800px; height: 500px; margin: 0 auto">
<div id="container-speed" style="width: 400px; height: 300px; float: left"></div>
</div>
JavaScript
$(function () {
var gaugeOptions = {
chart: {
type: 'solidgauge'
},
title: null,
pane: {
center: ['50%', '50%'],
size: '100%',
startAngle: 0,
endAngle: 360,
background: {
backgroundColor: Highcharts.Color("#55BF3B")
.setOpacity(0.3)
.get(),
innerRadius: '75%',
outerRadius: '100%',
shape: 'arc'
}
},
tooltip: {
enabled: false
},
// the value axis
yAxis: {
stops: [
[0.1, '#55BF3B'], // green
[0.5, '#DDDF0D'], // yellow
[0.9, '#DF5353'] // red
],
lineWidth: 0,
minorTickInterval: null,
tickPixelInterval: 400,
tickWidth: 0,
title: {
y: -70
},
labels: {
enabled:false
}
},
plotOptions: {
solidgauge: {
dataLabels: {
y: -50,
borderWidth: 0,
useHTML: true
},
linecap: 'round',
stickyTracking: false,
rounded: true
}
}
};
// The speed gauge
$('#container-speed').highcharts(Highcharts.merge(gaugeOptions, {
yAxis: {
min: 0,
max: 200,
title: {
text: 'Speed'
}
},
credits: {
enabled: false
},
series: [{
name: 'Speed',
data: [80],
radius: '112%',
innerRadius: '88%',
dataLabels: {
format: '<div style="text-align:center"><span style="font-size:25px;color:' +
((Highcharts.theme &&...