Basic line
by Black Label
HTML
<script src="https://code.highcharts.com/highcharts.js"></script>
<div id="container" style="height:300px"></div>
JavaScript
Highcharts.chart('container', {
chart: {
events: {
selection: function(event) {
if (event.xAxis) {
let min = Highcharts.numberFormat(event.xAxis[0].min, 2),
max = Highcharts.numberFormat(event.xAxis[0].max, 2)
this.setSubtitle({
text: `From ${min} to ${max}`
})
} else {
this.setSubtitle({
text: "From 0 to 15"
})
}
}
},
zoomType: 'x'
},
title: {
text: "Some values"
},
subtitle: {
text: "From 0 to 15"
},
series: [{
data: [2, 5, 1, 6, 7, 8, 5, 5, 35, 34, 34, 63, 46, 34, 4, 53]
}],
});