Highcharts Demo
author(s):
Torstein Hønsi
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
function completeSeries(series) {
var max = series.yAxis.max;
var data = series.data.map(p => max);
series.chart.addSeries({
data: data,
showInLegend: false,
enableMouseTracking: false,
dataLabels: {
enabled: false
},
grouping: false,
color: 'rgba(94, 143, 184, 0.5)',
zIndex: -1
}, false);
series.yAxis.update({max: max});
}
Highcharts.chart('container', {
chart: {
type: 'column',
backgroundColor: 'rgb(0,0,139)',
events: {
load: function() {
completeSeries(this.series[0]);
}
}
},
series: [{
id: 'actual',
name: 'Actual',
data: [49.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4],
color: '#ffffff',
dataLabels: {
enabled: false
}
}]
});