how to format date on x-axis in charts?

0

I am trying to create a chart with lines where dates on the x-axis. The periods between the dates are different. First i selected a category dataset. The only problem was the formatting of the dates which i need in a dd.MM.yy pattern. Other as is in normal reports there is no pattern item. I tried to edit the xml-file but this was not successful. Next step was to try it with a time series dataset. There a period was asked for but as just mentioned a fix period doesn't exist.

The Ultimate Guide doesn't tell anything to this.

Would be more than happy for help.
Another question: is there a documentation about jrxml available?


Michael Fischer


 

kuquadrat_1's picture
Joined: Aug 16 2013 - 11:14pm
Last seen: 2 months 1 week ago

2 Answers:

0

Hi Michael,

you could have formatted the dates in your line chart in the category expression directly (in java), like:

java.text.SimpleDateFormat("MM.dd.yy").format($F{date-field})

Cheers, Thomas

http://www.ThomasZimmer.net

Thomas Zimmer's picture
Joined: Oct 2 2012 - 1:35am
Last seen: 1 week 6 days ago

new java.text.SimpleDateFormat("MM.dd.yy").format($F{date-field})
or simply
new SimpleDateFormat("MM.dd.yy").format($F{date-field})

kcd83 - 5 years 7 months ago
0

Hi Thomas,

thank you so much for your reply.

First i did was to change the class type from java.sql.Timestamp to java.util.Date.

Second i changed the caategory expression as you have suggested. After this the filling process could not work. Maybe a syntax error?

 

In the attached file all is documented.
Would be wonderful to hear from you again.

Best regards Michael

Attachments: 
AttachmentSize
File xmlcode_date_in_chart.rtf8 KB
kuquadrat_1's picture
Joined: Aug 16 2013 - 11:14pm
Last seen: 2 months 1 week ago
Feedback