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 class="">
<div id="container" style="width:250px; height:250px; margin: 0 auto"></div>
</div>
JavaScript
$(function() {
if (!Highcharts.theme) {
Highcharts.setOptions({
chart: {
borderWidth: 1,
backgroundColor: '#f9f9f9',
borderColor: '#dadada',
//spacingRight: -50,
//spacingLeft: -50
//height:240,
//width:250
},
//colors: ['#f48627', '#359b64', '#e5c100']
});
}
//
Highcharts.chart('container', {
chart: {
type: 'solidgauge',
marginTop: 10,
marginBottom: 38,
//marginRight: -15,
//marginLeft: -15,
//width:250
},
title: {
text: 'Event Duration',
style: {
fontSize: '14px',
color: '#7e7e7e'
},
x: 0,
y: 220
},
subtitle: {
text: '<div style="text-align:center"><p style="float:left;width:100%;"><span style="font-size:16px; color:#571e4f"> 4 Days </span><br /><span style="font-size:16px; color:#571e4f"> 12 Hours</span></p></div>',
x: 0,
y: 100
},
/*tooltip: {
enabled: false
},*/
tooltip: {
borderWidth: 1,
//backgroundColor: 'none',
//shadow: false,
style: {
fontSize: '13px',
fontWeight: 'thin'
},
pointFormat: '{series.name}',
positioner: function(boxWidth, boxHeight, point) {
//alert(point.plotY);
return {
x: 10,
y: 10
};
}
},
pane: {
startAngle: 180,
endAngle: 540,
background: [{ // Track for Move
outerRadius: '112%',
innerRadius: '88%',
backgroundColor: '#DEDEDE',
borderWidth: 0
}, { // Track for Exercise
outerRadius: '87%',
innerRadius: '63%',
backgroundColor: '#DEDEDE',
borderWidth: 0
}/*, { // Track for Stand
outerRadius: '62%',
innerRadius: '38%',
backgroundColor: '#DEDEDE',
borderWidth: 0
}*/]
},
yAxis: [{
min: 0,
max: 100,
lineWidth: 0,
tickPositions: [],
...