Skip to main content
1-Visitor
December 2, 2020
Question

Bar Chart xAxis Data Formatting

  • December 2, 2020
  • 2 replies
  • 2044 views

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,

 

 

 

2 replies

5-Regular Member
December 3, 2020

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 

1-Visitor
December 3, 2020

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.

5-Regular Member
December 3, 2020


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,