RIsks in Business Units by Severity
author(s): Torstein Hønsi
by Amit Sinha
HTML
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<script src="https://code.highcharts.com/modules/export-data.js"></script>
<script src="https://code.highcharts.com/modules/accessibility.js"></script>
<div id="container"></div>
CSS
.highcharts-figure, .highcharts-data-table table {
min-width: 310px;
max-width: 800px;
margin: 1em auto;
}
#container {
height: 400px;
}
.highcharts-data-table table {
font-family: Verdana, sans-serif;
border-collapse: collapse;
border: 1px solid #EBEBEB;
margin: 10px auto;
text-align: center;
width: 100%;
max-width: 500px;
}
.highcharts-data-table caption {
padding: 1em 0;
font-size: 1.2em;
color: #555;
}
.highcharts-data-table th {
font-weight: 600;
padding: 0.5em;
}
.highcharts-data-table td, .highcharts-data-table th, .highcharts-data-table caption {
padding: 0.5em;
}
.highcharts-data-table thead tr, .highcharts-data-table tr:nth-child(even) {
background: #f8f8f8;
}
.highcharts-data-table tr:hover {
background: #f1f7ff;
}
JavaScript
Highcharts.chart('container', {
chart: {
type: 'column'
},
title: {
text: 'Risk(s) In Business Unit'
},
credits:{
enabled: false
},
subtitle: {
text: 'By Severity'
},
xAxis: {
categories: [
'BU1',
'BU2',
'BU3',
'BU4',
'BU5',
'BU6',
'BU7',
'BU8',
'BU9',
'BU10',
'BU11',
'BU12'
],
crosshair: true
},
yAxis: {
min: 0,
title: {
text: 'Risks'
}
},
tooltip: {
headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
'<td style="padding:0"><b>{point.y}</b></td></tr>',
footerFormat: '</table>',
shared: true,
useHTML: true
},
plotOptions: {
column: {
pointPadding: 0.2,
borderWidth: 0
}
},
series: [{
name: 'High',
data: [49, 71, 106, 129, 144, 176, 135, 148, 216, 194, 95, 54]
}, {
name: 'Medium',
data: [83, 78, 98, 93, 106, 84, 105, 104, 91, 83, 106, 92]
}, {
name: 'Low',
data: [48, 38, 39, 41, 47, 48, 59, 59, 52, 65, 59, 51]
}, {
name: 'Critical',
data: [42, 33, 34, 39, 52, 75, 57, 60, 47, 39, 46, 51]
}]
});