How format date axis axis for bar chart component in Report Module

Hi
There is no option for formatting the date in horizontal axis in bar component in Report module.
I want to show only yyyy/DD/MM and hide time section. How can I do this?

I have the same problem. I would also like to rotate the date 45° or 90°.

1 Like

I enabled scripting and put this code into the def configureChart(data, chart) script:

plot = chart.getPlot()
axis = plot.getDomainAxis()
axis.setCategoryLabelPositions(CategoryLabelPositions.UP_45)

According to JFreeChart this should work but it doesn’t.

1 Like

I added
from org.jfree.chart.axis import CategoryLabelPositions
and then it worked

I formatted my date in my SQL query. Hopefully the rotate angle script will help you get to date formatting.

2 Likes