How to change date format on chart x axis? I want to change "22 May" to "May 22" etc, is that possible?
How to change date format on chart?
Read the docs under API Docs -> components -> maSerialChart
there's an attribute you can set to alter the format:
time-format (optional) string The moment.js time format to be used in displaying timestamps on the X axis.
Put your moment.js format in there and that will let you set the format to 'DD mm' etc
Just to ensure for timkk880, when he says,
he means Moment.js format
Thank you MattFox, phildunlap and Jared Wiltshire,
I searched the folder, and only found momentFilter.js, moment-timezone-with-data.js, moment-with-locales.js, moment-timezone-with-data.min.js, moment-with-locales.min.js, which one I should modify? Is that mean to replace "string" to "YYYY/MM/DD"?
I think I may have confused you a bit...
When you use the dashboard designer, one of the options for the maSerialChart is time-format.
<ma-serial-chart points="chartPoints" values="chartPointValues" time-format="DD mm"></ma-serial-chart>
I trust that is more along the lines of what you are trying to accomplish. Refer to the moment.js website for their docs if you are looking to format the time value in a specific manner.
Thank you MattFox, I get it!