Report module - timeseries chart axis format

V8.05.

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?

Thanks

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:
http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/axis/DateAxis.html

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:
https://docs.oracle.com/javase/10/docs/api/java/text/SimpleDateFormat.html

1 Like