Power reduction chart
by Sascha
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>
<figure class="highcharts-figure">
<div id="container"></div>
</figure>
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;
}
.textLabel {
display: inline-block;
width: 150px;
font-weight: bold;
text-align: left;
}
JavaScript
Highcharts.chart('container', {
chart: {
type: 'column',
marginRight: 240,
marginTop: 100
},
title: {
text: 'Power reduction report'
},
subtitle: {
text: '2020-03-01 00:00:00 - 2020-03-02 00:00:00'
},
legend: {
enabled: false
},
credits: {
enabled: false
},
xAxis: {
categories: [
'Power reduction'
]
},
yAxis: {
min: 0,
max: 100,
title: {
text: 'Performance'
}
},
plotOptions: {
column: {
pointPadding: 0.2,
borderWidth: 0,
dataLabels: {
enabled: true,
crop: false,
overflow: 'none',
backgroundColor: 'white',
color: 'black',
borderWidth: 1,
borderColor: '#CCC',
y: -6,
format: '{point.category}<br/>{point.y:.2f} %'
}
}
},
series: [{
name: 'Maximum speed',
data: [73.1],
color: '#4D4'
}, {
name: 'Reduced speed',
data: [26.9],
color: '#fa4'
}],
caption: {
useHTML: true,
verticalAlign: 'middle',
align: 'right',
text: '<table><tr><th>Produced quantity (max.):</th><td>120.000</td></tr>' +
'<tr><th>Theoretic max.:</th><td>160.000</td></tr>' +
'<tr><th>Execution time:</th><td>15:24:36</td></tr>' +
'<tr><th>Execution time (eff.):</th><td>11:12:13</td></tr>' +
'<tr><th>Execution time loss:</th><td>04:12:23</td></tr>' +
'<tr><th>Produced quantity loss:</th><td>40.000</td></tr>' +
'</table>'
}
});