We have updated Flexmonster Software License Agreement, effective as of September 30, 2024. Learn more about what’s changed.

How to format date string in Chart reports

Answered
Brian asked on April 22, 2020

Hello,
 
I want to format the date string when displaying a chart. I'm able to format date strings for Table date (pivot table) view using customizeCell. But It seems like that doesn't get applied when showing charts. 
Is there any way to format dates in Charts? Would need this on the chart itself, the legend, etc.

1 answer

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster April 23, 2020

Hello, Brian,
 
Our team would like to kindly inform you that the customizeCell API call is dedicated to the grid customization and is not applied when switching to charts.
 
We would like to kindly suggest you check out the following set of properties allowing to specify the date and time formatting both for grid and charts:

  • datePattern is used to format “date string” date fields ("type": "date string" in JSON, "ds+" prefix in CSV). Default pattern string:"dd/MM/yyyy"`.
  • dateTimePattern is used to format “datetime” date fields ("type": "datetime" in JSON, "dt+" prefix in CSV). Default pattern string: "dd/MM/yyyy HH:mm:ss".
  • timePattern is used to format “time” date fields ("type": "time" in JSON, "t+" prefix in CSV). For more details refer to the time pattern section. Default pattern string: "HH:mm:ss".

Detailed information about properties and about the pattern syntax itself can be found in our documentation.
 
Please check out an example using the datePattern property in order to apply formatting both for the grid and charts.
 
We hope it helps.
Do not hesitate to contact us in case additional questions on this point occur.
 
Best regards,
Illia

Please login or Register to Submit Answer