nectum
Posts: 26
Joined: Wed Jul 24, 2019 8:38 pm

Center chart on a datetime

Hi, how a can center the chart on a especific datetime? I need send a datetime to chart and this center on this datetame.
kamil.m
Posts: 892
Joined: Thu May 19, 2022 1:33 pm

Re: Center chart on a datetime

Hi there,

Thank you for contacting us with your question!

In that case, I would suggest setting a specific extremes via the xAxis.setExtremes method on load event. To put it simple, when the chart loads it will display a specified time period.

Axis.setExtremes: https://api.highcharts.com/class-refere ... etExtremes
Set extremes on a button click: https://jsfiddle.net/BlackLabel/e3g8qmvh/
chart.events.load: https://api.highcharts.com/highcharts/chart.events.load
Set extremes on load event: https://jsfiddle.net/BlackLabel/oLwrh18n/

Let me know if that's what you were looking for, and do not hesitate to contact us with any other questions,
Best regards!
Kamil Musiałowski
Highcharts Developer

Return to “Highcharts Stock”