Skip to main content
Dec 2, 2020 6:14 PM UTC
Question

Bar Chart xAxis Data Formatting

Hello everyone,

 

I've noticed that on the Bar Chart widget, it's not possible to format the xAxis format. In my case I'm using a DATETIME for the xAxis and I would like to display it as ('MM:dd') and by default this is applied as ('yyyy-MM-dd'). (See image in attachment).

 

Are there any workarounds for this matter? I'm using ThingWorx v9.1

 

Best regards,

 

 

 

3 replies

Dec 3, 2020 9:29 AM UTC

Hi @rnfonseca , You can modify the service code mentioned in below link to get only dd:MM format.

 

https://www.ptc.com/en/support/article/CS320887 

Dec 3, 2020 9:33 AM UTC

Hello @anarwal ,

 

The code you provided is for the Label Chart (not sure if it's applicable to Bar Chart widgets). And it works around the issue. It casts the DATETIME to a STRING value and formats it. If I wanted to I could have created a datashape with a Date under a STRING format, and passed it to the Bar Chart. I was asking for a cleaner way to do it.

Dec 3, 2020 10:57 AM UTC


Hello @cdias,

 

Have you tried using the Schedule Chart Widget. You can define the xAxis format by changing the TimeAxisDateFormatToken using MM-dd.

 

Hope it helps,