0

I'm using a highstock column type chart, and I want to set the xAxis extremes with the options.

Basically I'm looking for the options equivalent of the setExtremes method:

this.chart.xAxis[0].setExtremes(null, null)
Norbert Huurnink
  • 1,326
  • 10
  • 18

1 Answers1

1

You can use min and max properties or call setExtremes method after the chart is created.

xAxis: {
    ...,
    min: -10,
    max: 20
}

Live demo: http://jsfiddle.net/BlackLabel/2b9zomxh/

API Reference: https://api.highcharts.com/highcharts/xAxis

ppotaczek
  • 36,341
  • 2
  • 14
  • 24
  • This worked. The problem I had was that I used setExtremes first, then trying to set min/max to null to reset. This doesn't work, I guess because the options don't change when calling setExtremes, therefore the min/max was already null. – Norbert Huurnink Oct 07 '22 at 08:59
  • Removing the setExtremes completely and setting min/max whenever I need to change the xAxis did the trick for me. Thanks! – Norbert Huurnink Oct 07 '22 at 09:00