Code: Select all
rangeSelector: {
buttons: [{
{
text: 'D',
preserveDataGrouping: true,
title: 'Groups data by Days',
dataGrouping: {
forced: true,
units: [
['day', [1]]
]
},
events: {
click: function (e) {
const xAxis = chart.xAxis[0];
var extremes = xAxis.getExtremes();
xAxis.setExtremes(extremes.min, extremes.max);
}
}
}],
}
Would be grateful for any help as to how I can stop the xAXis extremes from changing on clicking the button?
My second question is because I have multiple charts on one page, how would I ensure that the correct chart / xAxis is selected by the events: click function?