JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://code.highcharts.com/stock/highstock.js"></script>
<script src="http://code.highcharts.com/stock/modules/exporting.js"></script>
<div id="container" style="height: 500px; min-width: 500px"></div>
JavaScript
$(function() {
$.getJSON('http://www.highcharts.com/samples/data/jsonp.php?filename=aapl-c.json&callback=?', function(data) {
// Create the chart
var chart = new Highcharts.StockChart({
chart : {
renderTo : 'container',
zoomType : 'x'
},
rangeSelector : {
selected : 1
},
title : {
text : 'AAPL Stock Price'
},
series : [{
name : 'AAPL',
data : data,
tooltip: {
valueDecimals: 2
}
}]
});
jQuery(chart.xAxis[0]).bind('setExtremes', function(e) {
// e.(min|max) contains the new extremes
// this.getExtremes().user(Min|Max) will give u the prev min|max.
console.log(e);
console.log(this.getExtremes());
});
});
});