JSFiddle - React, Tailwind, and code Playground
Percent example
by pepperdigital
HTML
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
JavaScript
Highcharts.chart('container', {
chart: {
type: 'bar'
},
credits: {
enabled: false
},
exporting: {
enabled: false
},
colors: ['#86BC25', '#43B02A', '#046A38', '#0097A9', '#62B5E5',
'#00A3E0', '#0076A8', '#012169', '#2C5234', '#C4D600'],
title: {
text: ''
},
tooltip: {
formatter: function () {
return this.series.name +
'<br><b>' + this.y + '%</b>';
}
},
xAxis: {
categories: ['FY20',
'FY19']
},
yAxis: {
min: 0,
//max: 100,
labels: {
format: '{value}'
},
title: {
text: ''
}
},
legend: {
reversed: true
},
plotOptions: {
series: {
stacking: 'normal'
}
},
series: [
{
name: 'Consumer',
data: [1200,{y: 1092, color: '#B6D77C'}]
}, {
name: 'Energy, resources, industrial',
data: [254,{y: 254, color: '#8ED07F'}]
}, {
name: 'Financial services',
data: [123,{y: 1323, color: '#68A688'}]
}, {
name: 'Government and public services',
data: [288,{y: 288, color: '#66C1CB'}]
}, {
name: 'Life sciences & health care',
data: [298,{y: 298, color: '#A1D3EF'}]
}, {
name: 'Technology, Media & Telecommunications',
data: [428,{y: 428, color: '#66C8EC'}]
}]
});