Report module - timeseries chart axis format


Please can someone tell me how to change the text format on the x axis (time) of a time series chart in the report designer?


Any suggestions or is this a missing feature? I would like to purchase the reporting module but without this functionality, it is unuseable.

You’ll need to go into the configureChart function. It’s almost certainly possible, but isn’t easily exposed as a setting in the API. If you dig through the forum, there are various examples of working with the chart. In general, you probably need to do something like:
chart.getPlot().getDomainAxis() which will return (probably) a DateAxis (or some similar class) that has various useful methods:

This is untested, but start with something like this:

from java.text import SimpleDateFormat
df = SimpleDateFormat("h:mm a")
chart.plot.domainAxis.dateFormatOverride = df

Where the date format can use any of the formatting characters specified in SimpleDateFormat, detailed here:

1 Like