Axis Format bar chart Vision

Hi everyone,

I appreciate your help with this issue:

I'm doing a report with a bar chart in Vision but the date in the X-Axis is showed as it is in the database

image

I need to showed in different format, like 08-Nov-23, but I tried every where and I Can't see how to change it in the properties. I think this could be done scripting here:

image

I tried with some getXAxes(data["mykey"]) with no success

If you have another way to show this dates in the report in a shorter form please help me.

Thank you

The simplest approach would be to edit the query, so it returns the date labels in the format you want. The alternative would be to iterate through label column of the dataset and transform each date into the format you want.

1 Like

I'm not sure if the reporting chart is an XYPlot or a Category Plot. Assuming that it's an XYPlot then you should be able to do something along the lines of this:

from java.text import SimpleDateFormat
axis = chart.plot.domainAxis
axis.setDateFormatOverride(SimpleDateFormat("dd-MMM-yy"))
chart.plot.setDomainAixis(axis)
1 Like

He said Vision Bar Chart, so I suspect that his use of the word report and his reporting tag are misleading.

You are awesome!

I just did this:

SELECT FORMAT(date,'MMM/dd')

And my life changed :smiling_face_with_tear:

image

Thank you for your help!

1 Like