HighStock bug
Default zoom range not highlighted but still functions (for Highcharts bug report)
by Bryan McIntosh
HTML
<div id="container" style="height: 400px; min-width: 600px; max-width: 800px; margin: 0 auto"></div>
<script src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="https://code.highcharts.com/stock/highstock.js"></script>
<script src="https://code.highcharts.com/stock/modules/data.js"></script>
<script src="https://code.highcharts.com/stock/modules/exporting.js"></script>
<script src="https://code.highcharts.com/stock/modules/accessibility.js"></script>
JavaScript
//Issue of selected Range button not showing if:
// Navigator is false and xAxis endOnTick is false
$( document ).ready(function() {
Highcharts.getJSON('https://demo-live-data.highcharts.com/aapl-c.json', function (data) {
$('#container').highcharts('StockChart', {
title: {text: "Apple Stock Price"},
rangeSelector: {
selected: 1,
buttons: [
{type: 'day', count: 5, text: '5d'},
{type: 'day', count: 7, text: '7d'},
{type: 'all', text: 'All'}
]
},
navigator: {
enabled: false
},
xAxis: {
gridLineWidth: 1,
endOnTick: true
},
yAxis: {
opposite: false,
showLastLabel: true,
startOnTick: true,
endOnTick: true,
title: {text: 'Bling Bling'},
accessibility: {description: 'Bling Bling'}
},
caption: {
text: "<strong>Apple Stock</strong><br>Apple live data from APPL-C"
},
series: [{
name: 'AAPL',
data: data,
tooltip: {valueDecimals: 2}
}]
});
});
});