How to display only month and date in 07/12 format on scaleX and export the data in the same format

Problem:

For scale-x, I am giving date values in label which I am getting from the backend API in the following date format 2023-07-12. In the line graph, I would like to display only month and date in 07/12 format and I would like to export that data in month and date format itself as 07/12. Can you please help how to achieve that?

Solution:

If you put "export-format":"%M %d" under scale-x -> transform as you can see in this demo and screenshot, you customize the format of the exported timestamp. Same applies to displaying the month and date in 07/12 format, you need to put "all": "%M/%d", under scale-x -> transform. One thing to note though is you might need to retrieve the date values from the back-end in UNIX/epoch time(time by the number of seconds).

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us