Jordi
Posts: 1
Joined: Tue Jun 28, 2022 3:38 pm

Xaxis not displaying seconds

Hi,
I want to display a sensor lecture for the period of 1 minute, I tried to configure it but I always get year/month/day/hour/minute/seconds.
I just want to display the seconds, and when I want to export the data, the seconds doesn't display.
I call a setInterval method every 0.5s, how can I display these values instead of a date format?
I would like to export a .xls with seconds for Xaxis and the sensor value for the Yaxis (this one is right).
Thanks in advance.
Attachments
Highcharts.png
Highcharts.png (51.2 KiB) Viewed 129 times
hubert.k
Posts: 1164
Joined: Mon Apr 11, 2022 11:48 am

Re: Xaxis not displaying seconds

Hello Jordi!
Welcome to our forum and thanks for contacting us with your question!

If I understand you correctly you are looking for exporting.csv.dateFormat property. Using this, you can set the format of the date as you wanted while exporting. You can see it in the demo below, I set the date format to show only seconds and milliseconds from the chart and if I show the data table view it is showing as set.

Demo: https://jsfiddle.net/BlackLabel/jq9yfzo3/
API Reference: https://api.highcharts.com/highcharts/e ... dateFormat
https://api.highcharts.com/class-refere ... dateFormat

If you have any further questions, feel free to ask them.
Kind regards!
Hubert Kozik
Highcharts Developer

Return to “Highcharts Usage”